aboutsummaryrefslogtreecommitdiffstats
path: root/src/firejail/no_sandbox.c
diff options
context:
space:
mode:
authorLibravatar netblue30 <netblue30@yahoo.com>2015-08-27 14:52:51 -0400
committerLibravatar netblue30 <netblue30@yahoo.com>2015-08-27 14:52:51 -0400
commit53fd3c71ab5598e7b57d7682248eab8a743c0026 (patch)
tree443d61bbf73828a861a3128f0a7a5d640032ddf2 /src/firejail/no_sandbox.c
parenttesting (diff)
downloadfirejail-53fd3c71ab5598e7b57d7682248eab8a743c0026.tar.gz
firejail-53fd3c71ab5598e7b57d7682248eab8a743c0026.tar.zst
firejail-53fd3c71ab5598e7b57d7682248eab8a743c0026.zip
cleanup
Diffstat (limited to 'src/firejail/no_sandbox.c')
-rw-r--r--src/firejail/no_sandbox.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/firejail/no_sandbox.c b/src/firejail/no_sandbox.c
index 5603974aa..04666a69f 100644
--- a/src/firejail/no_sandbox.c
+++ b/src/firejail/no_sandbox.c
@@ -36,6 +36,9 @@ int check_kernel_procs(void) {
36 }; 36 };
37 int i; 37 int i;
38 38
39 if (arg_debug)
40 printf("Looking for kernel processes\n");
41
39 // look at the first 10 processes 42 // look at the first 10 processes
40 // if a kernel process is found, return 1 43 // if a kernel process is found, return 1
41 for (i = 1; i <= 10; i++) { 44 for (i = 1; i <= 10; i++) {
@@ -73,6 +76,8 @@ int check_kernel_procs(void) {
73 int j = 0; 76 int j = 0;
74 while (kern_proc[j] != NULL) { 77 while (kern_proc[j] != NULL) {
75 if (strncmp(buf, kern_proc[j], strlen(kern_proc[j])) == 0) { 78 if (strncmp(buf, kern_proc[j], strlen(kern_proc[j])) == 0) {
79 if (arg_debug)
80 printf("Found %s process, we are not running in a sandbox\n", buf);
76 fclose(fp); 81 fclose(fp);
77 free(fname); 82 free(fname);
78 return 1; 83 return 1;
@@ -84,6 +89,9 @@ int check_kernel_procs(void) {
84 free(fname); 89 free(fname);
85 } 90 }
86 91
92 if (arg_debug)
93 printf("No kernel processes found, we are already running in a sandbox\n");
94
87 return 0; 95 return 0;
88} 96}
89 97