[CRIU] [PATCH 1/4] security: create separate security.h header

Ruslan Kuprieiev kupruser at gmail.com
Thu Jan 29 12:59:27 PST 2015


Signed-off-by: Ruslan Kuprieiev <kupruser at gmail.com>
---
 cr-dump.c          |  1 +
 cr-restore.c       |  1 +
 cr-service.c       |  1 +
 crtools.c          |  1 +
 include/crtools.h  |  6 ------
 include/security.h | 12 ++++++++++++
 ptrace.c           |  1 +
 7 files changed, 17 insertions(+), 6 deletions(-)
 create mode 100644 include/security.h

diff --git a/cr-dump.c b/cr-dump.c
index cfdde34..cc52455 100644
--- a/cr-dump.c
+++ b/cr-dump.c
@@ -73,6 +73,7 @@
 #include "sysfs_parse.h"
 #include "action-scripts.h"
 #include "aio.h"
+#include "security.h"
 
 #include "asm/dump.h"
 
diff --git a/cr-restore.c b/cr-restore.c
index 0a178ee..95e6fd1 100644
--- a/cr-restore.c
+++ b/cr-restore.c
@@ -73,6 +73,7 @@
 #include "file-lock.h"
 #include "action-scripts.h"
 #include "aio.h"
+#include "security.h"
 
 #include "parasite-syscall.h"
 
diff --git a/cr-service.c b/cr-service.c
index eb33048..d202d14 100644
--- a/cr-service.c
+++ b/cr-service.c
@@ -27,6 +27,7 @@
 #include "mount.h"
 #include "cgroup.h"
 #include "action-scripts.h"
+#include "security.h"
 
 #include "setproctitle.h"
 
diff --git a/crtools.c b/crtools.c
index cf2fdf2..0b3c497 100644
--- a/crtools.c
+++ b/crtools.c
@@ -38,6 +38,7 @@
 #include "cgroup.h"
 #include "cpu.h"
 #include "action-scripts.h"
+#include "security.h"
 
 #include "setproctitle.h"
 
diff --git a/include/crtools.h b/include/crtools.h
index 176e8b3..bbed0ef 100644
--- a/include/crtools.h
+++ b/include/crtools.h
@@ -24,12 +24,6 @@ extern int cr_check(void);
 extern int cr_exec(int pid, char **opts);
 extern int cr_dedup(void);
 
-extern int restrict_uid(unsigned int uid, unsigned int gid);
-struct proc_status_creds;
-extern bool may_dump(struct proc_status_creds *);
-struct _CredsEntry;
-extern bool may_restore(struct _CredsEntry *);
-extern bool cr_user_is_root(void);
 extern int check_add_feature(char *arg);
 
 #endif /* __CR_CRTOOLS_H__ */
diff --git a/include/security.h b/include/security.h
new file mode 100644
index 0000000..43bfb45
--- /dev/null
+++ b/include/security.h
@@ -0,0 +1,12 @@
+#ifndef __CR_SECURITY_H__
+#define __CR_SECURITY_H__
+
+#include "proc_parse.h"
+#include "protobuf/creds.pb-c.h"
+
+extern int restrict_uid(unsigned int uid, unsigned int gid);
+extern bool may_dump(struct proc_status_creds *);
+extern bool may_restore(struct _CredsEntry *);
+extern bool cr_user_is_root(void);
+
+#endif /* __CR_SECURITY_H__ */
diff --git a/ptrace.c b/ptrace.c
index b102a1b..f258a43 100644
--- a/ptrace.c
+++ b/ptrace.c
@@ -19,6 +19,7 @@
 #include "ptrace.h"
 #include "proc_parse.h"
 #include "crtools.h"
+#include "security.h"
 
 int unseize_task(pid_t pid, int orig_st, int st)
 {
-- 
2.1.0



More information about the CRIU mailing list