[CRIU] [PATCH] check: Implement F_GETOWNER_UIDS

Cyrill Gorcunov gorcunov at openvz.org
Wed Nov 19 00:18:43 PST 2014


It is in mainline and required for proper CRIU work.

Signed-off-by: Cyrill Gorcunov <gorcunov at openvz.org>
---
 cr-check.c | 20 +++++++++++++++-----
 1 file changed, 15 insertions(+), 5 deletions(-)

diff --git a/cr-check.c b/cr-check.c
index 6eb9a767e95b..570f945ea7d1 100644
--- a/cr-check.c
+++ b/cr-check.c
@@ -217,11 +217,21 @@ static int check_prctl(void)
 
 static int check_fcntl(void)
 {
-	/*
-	 * FIXME Add test for F_GETOWNER_UIDS once
-	 * it's merged into mainline and kernel part
-	 * settle down.
-	 */
+	u32 v[2];
+	int fd;
+
+	fd = open("/proc/self/comm", O_RDONLY);
+	if (fd < 0) {
+		pr_perror("Can't open self comm file");
+		return -1;
+	}
+
+	if (fcntl(fd, F_GETOWNER_UIDS, (long)v)) {
+		pr_perror("Can'r fetch file owner UIDs");
+		return -1;
+	}
+
+	close(fd);
 	return 0;
 }
 
-- 
1.9.3



More information about the CRIU mailing list