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