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