diff options
Diffstat (limited to 'src/include')
-rw-r--r-- | src/include/euid_common.h | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/include/euid_common.h b/src/include/euid_common.h index de5572fb1..752df5fff 100644 --- a/src/include/euid_common.h +++ b/src/include/euid_common.h | |||
@@ -31,6 +31,7 @@ | |||
31 | } | 31 | } |
32 | 32 | ||
33 | extern uid_t firejail_uid; | 33 | extern uid_t firejail_uid; |
34 | extern uid_t firejail_gid; | ||
34 | 35 | ||
35 | 36 | ||
36 | 37 | ||
@@ -44,16 +45,18 @@ static inline void EUID_ROOT(void) { | |||
44 | static inline void EUID_USER(void) { | 45 | static inline void EUID_USER(void) { |
45 | if (seteuid(firejail_uid) == -1) | 46 | if (seteuid(firejail_uid) == -1) |
46 | errExit("seteuid"); | 47 | errExit("seteuid"); |
47 | if (setegid(firejail_uid) == -1) | 48 | if (setegid(firejail_gid) == -1) |
48 | errExit("setegid"); | 49 | errExit("setegid"); |
49 | } | 50 | } |
50 | 51 | ||
51 | static inline void EUID_PRINT(void) { | 52 | static inline void EUID_PRINT(void) { |
52 | printf("debug: uid %d, euid %d\n", getuid(), geteuid()); | 53 | printf("debug: uid %d, euid %d\n", getuid(), geteuid()); |
54 | printf("debug: gid %d, egid %d\n", getgid(), getegid()); | ||
53 | } | 55 | } |
54 | 56 | ||
55 | static inline void EUID_INIT(void) { | 57 | static inline void EUID_INIT(void) { |
56 | firejail_uid = getuid(); | 58 | firejail_uid = getuid(); |
59 | firejail_gid = getgid(); | ||
57 | } | 60 | } |
58 | 61 | ||
59 | #endif | 62 | #endif |