aboutsummaryrefslogtreecommitdiffstats
path: root/src/firejail/fs_logger.c
diff options
context:
space:
mode:
authorLibravatar smitsohu <smitsohu@gmail.com>2018-08-22 13:17:38 +0200
committerLibravatar smitsohu <smitsohu@gmail.com>2018-08-22 13:17:38 +0200
commitb23e80de466458750f6ac36ed5cf3c6c2a19ad1c (patch)
tree972a9eef9fff650365604dfe926cd0d9f383f7b4 /src/firejail/fs_logger.c
parentclose private-cache memleak (diff)
downloadfirejail-b23e80de466458750f6ac36ed5cf3c6c2a19ad1c.tar.gz
firejail-b23e80de466458750f6ac36ed5cf3c6c2a19ad1c.tar.zst
firejail-b23e80de466458750f6ac36ed5cf3c6c2a19ad1c.zip
relax restrictions imposed on filesystem log (fslogger) in ec7f59b8d370c29bd229fa9124640611c0667159
Diffstat (limited to 'src/firejail/fs_logger.c')
-rw-r--r--src/firejail/fs_logger.c8
1 files changed, 1 insertions, 7 deletions
diff --git a/src/firejail/fs_logger.c b/src/firejail/fs_logger.c
index bf3ac26be..02e2ba5d7 100644
--- a/src/firejail/fs_logger.c
+++ b/src/firejail/fs_logger.c
@@ -123,12 +123,6 @@ void fs_logger_print_log(pid_t pid) {
123 // in case the pid is that of a firejail process, use the pid of the first child process 123 // in case the pid is that of a firejail process, use the pid of the first child process
124 pid = switch_to_child(pid); 124 pid = switch_to_child(pid);
125 125
126 // now check if the pid belongs to a firejail sandbox
127 if (invalid_sandbox(pid)) {
128 fprintf(stderr, "Error: no valid sandbox\n");
129 exit(1);
130 }
131
132 // check privileges for non-root users 126 // check privileges for non-root users
133 uid_t uid = getuid(); 127 uid_t uid = getuid();
134 if (uid != 0) { 128 if (uid != 0) {
@@ -146,7 +140,7 @@ void fs_logger_print_log(pid_t pid) {
146 140
147 EUID_ROOT(); 141 EUID_ROOT();
148 struct stat s; 142 struct stat s;
149 if (stat(fname, &s) == -1) { 143 if (stat(fname, &s) == -1 || s.st_uid != 0) {
150 fprintf(stderr, "Error: Cannot access filesystem log\n"); 144 fprintf(stderr, "Error: Cannot access filesystem log\n");
151 exit(1); 145 exit(1);
152 } 146 }