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