diff options
Diffstat (limited to 'src/firejail/fs_logger.c')
-rw-r--r-- | src/firejail/fs_logger.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/src/firejail/fs_logger.c b/src/firejail/fs_logger.c index 0829ad7ac..f803982d7 100644 --- a/src/firejail/fs_logger.c +++ b/src/firejail/fs_logger.c | |||
@@ -122,6 +122,8 @@ void fs_logger_change_owner(void) { | |||
122 | } | 122 | } |
123 | 123 | ||
124 | void fs_logger_print_log_name(const char *name) { | 124 | void fs_logger_print_log_name(const char *name) { |
125 | EUID_ASSERT(); | ||
126 | |||
125 | if (!name || strlen(name) == 0) { | 127 | if (!name || strlen(name) == 0) { |
126 | fprintf(stderr, "Error: invalid sandbox name\n"); | 128 | fprintf(stderr, "Error: invalid sandbox name\n"); |
127 | exit(1); | 129 | exit(1); |
@@ -136,6 +138,8 @@ void fs_logger_print_log_name(const char *name) { | |||
136 | } | 138 | } |
137 | 139 | ||
138 | void fs_logger_print_log(pid_t pid) { | 140 | void fs_logger_print_log(pid_t pid) { |
141 | EUID_ASSERT(); | ||
142 | |||
139 | // if the pid is that of a firejail process, use the pid of the first child process | 143 | // if the pid is that of a firejail process, use the pid of the first child process |
140 | char *comm = pid_proc_comm(pid); | 144 | char *comm = pid_proc_comm(pid); |
141 | if (comm) { | 145 | if (comm) { |
@@ -163,6 +167,7 @@ void fs_logger_print_log(pid_t pid) { | |||
163 | } | 167 | } |
164 | 168 | ||
165 | // print RUN_FSLOGGER_FILE | 169 | // print RUN_FSLOGGER_FILE |
170 | EUID_ROOT(); | ||
166 | char *fname; | 171 | char *fname; |
167 | if (asprintf(&fname, "/proc/%d/root%s", pid, RUN_FSLOGGER_FILE) == -1) | 172 | if (asprintf(&fname, "/proc/%d/root%s", pid, RUN_FSLOGGER_FILE) == -1) |
168 | errExit("asprintf"); | 173 | errExit("asprintf"); |