[CRIU] [PATCH 08/12] kdat: Config for loginuid

Pavel Emelyanov xemul at virtuozzo.com
Mon Apr 24 13:08:26 PDT 2017


The write- or readability of /proc/pid/loginuid can be determined
compile-time.

Signed-off-by: Pavel Emelyanov <xemul at virtuozzo.com>
---
 criu/kerndat.c | 16 ++++++++++++++++
 1 file changed, 16 insertions(+)

diff --git a/criu/kerndat.c b/criu/kerndat.c
index 837ddee..90fca22 100644
--- a/criu/kerndat.c
+++ b/criu/kerndat.c
@@ -471,6 +471,21 @@ int check_loginuid_op(bool full)
 	return 1;
 }
 
+#ifdef CONFIG_KERNEL_LOGINUID
+static inline int kerndat_loginuid(bool for_restore)
+{
+# if CONFIG_KERNEL_LOGINUID == 0
+	kdat.has_loginuid = false;
+# elif CONFIG_KERNEL_LOGINUID == 1
+	kdat.has_loginuid = !for_restore;
+# elif CONFIG_KERNEL_LOGINUID == 2
+	kdat.has_loginuid = true;
+# else
+#       error "Bad CONFIG_KERNEL_LOGINUID config value"
+# endif
+	return 0;
+}
+#else
 static int kerndat_loginuid(bool for_restore)
 {
 	int ret;
@@ -483,6 +498,7 @@ static int kerndat_loginuid(bool for_restore)
 	}
 	return ret;
 }
+#endif
 
 #ifdef CONFIG_IPTABLES_HAS_XTLOCKS
 static inline int kerndat_iptables_has_xtlocks(void)
-- 
2.5.5



More information about the CRIU mailing list