aboutsummaryrefslogtreecommitdiffstats
path: root/src/firejail/fs_logger.c
diff options
context:
space:
mode:
authorLibravatar netblue30 <netblue30@yahoo.com>2016-02-19 14:57:58 -0500
committerLibravatar netblue30 <netblue30@yahoo.com>2016-02-19 14:57:58 -0500
commit02a66f7e4086097a98dfdac0b47c9909908360a0 (patch)
tree443fb269e84c89842965677386260e71b85de227 /src/firejail/fs_logger.c
parentmoved sandbox name to /run/firejail/name/<PID> (diff)
downloadfirejail-02a66f7e4086097a98dfdac0b47c9909908360a0.tar.gz
firejail-02a66f7e4086097a98dfdac0b47c9909908360a0.tar.zst
firejail-02a66f7e4086097a98dfdac0b47c9909908360a0.zip
euid switching
Diffstat (limited to 'src/firejail/fs_logger.c')
-rw-r--r--src/firejail/fs_logger.c5
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
124void fs_logger_print_log_name(const char *name) { 124void 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
138void fs_logger_print_log(pid_t pid) { 140void 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");