695357
From b9e9e3903c78ba5d243b4176e82bf4b82342cb6a Mon Sep 17 00:00:00 2001
695357
From: Adrian Reber <areber@redhat.com>
695357
Date: Sat, 4 May 2019 15:27:32 +0200
695357
Subject: [PATCH] lsm: fix compiler error on Fedora 30
695357
MIME-Version: 1.0
695357
Content-Type: text/plain; charset=UTF-8
695357
Content-Transfer-Encoding: 8bit
695357
695357
This fixes following compiler error:
695357
695357
criu/lsm.c: In function ‘dump_xattr_security_selinux’:
695357
criu/include/log.h:51:2: error: ‘%s’ directive argument is null [-Werror=format-overflow=]
695357
   51 |  print_on_level(LOG_ERROR,     \
695357
      |  ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
695357
   52 |          "Error (%s:%d): " LOG_PREFIX fmt,  \
695357
      |          ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
695357
   53 |          __FILE__, __LINE__, ##__VA_ARGS__)
695357
      |          ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
695357
criu/lsm.c:166:3: note: in expansion of macro ‘pr_err’
695357
  166 |   pr_err("Reading xattr %s to FD %d failed\n", ctx, fd);
695357
      |   ^~~~~~
695357
695357
Signed-off-by: Adrian Reber <areber@redhat.com>
695357
---
695357
 criu/lsm.c | 2 +-
695357
 1 file changed, 1 insertion(+), 1 deletion(-)
695357
695357
diff --git a/criu/lsm.c b/criu/lsm.c
695357
index 5921138392..420585ba4f 100644
695357
--- a/criu/lsm.c
695357
+++ b/criu/lsm.c
695357
@@ -175,7 +175,7 @@ int dump_xattr_security_selinux(int fd, FdinfoEntry *e)
695357
 	/* Get the size of the xattr. */
695357
 	len = fgetxattr(fd, "security.selinux", ctx, 0);
695357
 	if (len == -1) {
695357
-		pr_err("Reading xattr %s to FD %d failed\n", ctx, fd);
695357
+		pr_err("Reading xattr security.selinux from FD %d failed\n", fd);
695357
 		return -1;
695357
 	}
695357