aboutsummaryrefslogtreecommitdiffstats
path: root/src/lib
diff options
context:
space:
mode:
authorLibravatar Glenn Washburn <development@efficientek.com>2018-10-05 13:29:10 -0500
committerLibravatar Glenn Washburn <development@efficientek.com>2018-10-05 13:29:10 -0500
commitd2367d775522bb6d7a5f23a759b05b9eda89a89d (patch)
treeca6f6847bb67fe4df7942055e00b9e3a5f7fc3a7 /src/lib
parentmount empty home if macro can't be whitelisted (diff)
downloadfirejail-d2367d775522bb6d7a5f23a759b05b9eda89a89d.tar.gz
firejail-d2367d775522bb6d7a5f23a759b05b9eda89a89d.tar.zst
firejail-d2367d775522bb6d7a5f23a759b05b9eda89a89d.zip
Firejail should look for processes with names exactly named "firejail" to avoid accounting for processes with a "firejail" prefix.
Diffstat (limited to 'src/lib')
-rw-r--r--src/lib/pid.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/lib/pid.c b/src/lib/pid.c
index 75576c787..ee1550e57 100644
--- a/src/lib/pid.c
+++ b/src/lib/pid.c
@@ -359,7 +359,10 @@ void pid_read(pid_t mon_pid) {
359 char buf[PIDS_BUFLEN]; 359 char buf[PIDS_BUFLEN];
360 while (fgets(buf, PIDS_BUFLEN - 1, fp)) { 360 while (fgets(buf, PIDS_BUFLEN - 1, fp)) {
361 if (strncmp(buf, "Name:", 5) == 0) { 361 if (strncmp(buf, "Name:", 5) == 0) {
362 char *ptr = buf + 5; 362 char *ptr = strchr(buf, '\n');
363 if (ptr)
364 *ptr = '\0';
365 ptr = buf + 5;
363 while (*ptr != '\0' && (*ptr == ' ' || *ptr == '\t')) { 366 while (*ptr != '\0' && (*ptr == ' ' || *ptr == '\t')) {
364 ptr++; 367 ptr++;
365 } 368 }
@@ -368,7 +371,7 @@ void pid_read(pid_t mon_pid) {
368 exit(1); 371 exit(1);
369 } 372 }
370 373
371 if ((strncmp(ptr, "firejail", 8) == 0) && (mon_pid == 0 || mon_pid == pid)) { 374 if ((strcmp(ptr, "firejail") == 0) && (mon_pid == 0 || mon_pid == pid)) {
372 if (pid_proc_cmdline_x11_xpra_xephyr(pid)) 375 if (pid_proc_cmdline_x11_xpra_xephyr(pid))
373 pids[pid].level = -1; 376 pids[pid].level = -1;
374 else 377 else