diff options
author | netblue30 <netblue30@yahoo.com> | 2015-08-27 14:52:51 -0400 |
---|---|---|
committer | netblue30 <netblue30@yahoo.com> | 2015-08-27 14:52:51 -0400 |
commit | 53fd3c71ab5598e7b57d7682248eab8a743c0026 (patch) | |
tree | 443d61bbf73828a861a3128f0a7a5d640032ddf2 /src | |
parent | testing (diff) | |
download | firejail-53fd3c71ab5598e7b57d7682248eab8a743c0026.tar.gz firejail-53fd3c71ab5598e7b57d7682248eab8a743c0026.tar.zst firejail-53fd3c71ab5598e7b57d7682248eab8a743c0026.zip |
cleanup
Diffstat (limited to 'src')
-rw-r--r-- | src/firejail/main.c | 3 | ||||
-rw-r--r-- | src/firejail/no_sandbox.c | 8 |
2 files changed, 10 insertions, 1 deletions
diff --git a/src/firejail/main.c b/src/firejail/main.c index e02cf6215..91a8380f3 100644 --- a/src/firejail/main.c +++ b/src/firejail/main.c | |||
@@ -998,7 +998,8 @@ int main(int argc, char **argv) { | |||
998 | } | 998 | } |
999 | 999 | ||
1000 | // if a sandbox is already running, start the program directly without sandboxing | 1000 | // if a sandbox is already running, start the program directly without sandboxing |
1001 | if (check_kernel_procs() == 0) { | 1001 | int rv = check_kernel_procs(); |
1002 | if (rv) { | ||
1002 | run_no_sandbox(argc, argv); | 1003 | run_no_sandbox(argc, argv); |
1003 | // it will never get here! | 1004 | // it will never get here! |
1004 | assert(0); | 1005 | assert(0); |
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 | ||