diff options
author | netblue30 <netblue30@yahoo.com> | 2015-11-25 10:33:04 -0500 |
---|---|---|
committer | netblue30 <netblue30@yahoo.com> | 2015-11-25 10:33:04 -0500 |
commit | 076b17788be2c1f1138e6bc1301049b8d8b72c37 (patch) | |
tree | 1b74650f5f5c4c7c3b28501084139594d7ae7e98 | |
parent | fixes (diff) | |
download | firejail-076b17788be2c1f1138e6bc1301049b8d8b72c37.tar.gz firejail-076b17788be2c1f1138e6bc1301049b8d8b72c37.tar.zst firejail-076b17788be2c1f1138e6bc1301049b8d8b72c37.zip |
--debug enhancements
-rw-r--r-- | RELNOTES | 1 | ||||
-rw-r--r-- | src/firejail/firejail.h | 1 | ||||
-rw-r--r-- | src/firejail/main.c | 5 | ||||
-rw-r--r-- | src/firejail/util.c | 2 |
4 files changed, 8 insertions, 1 deletions
@@ -9,6 +9,7 @@ firejail (0.9.35) baseline; urgency=low | |||
9 | * manipulation of firejail configuration disabled by default | 9 | * manipulation of firejail configuration disabled by default |
10 | * added automated feature testing framework | 10 | * added automated feature testing framework |
11 | * alow default gateway configuration for --interface option | 11 | * alow default gateway configuration for --interface option |
12 | * --debug enhancements | ||
12 | * bugfixes | 13 | * bugfixes |
13 | -- netblue30 <netblue30@yahoo.com> ongoing development | 14 | -- netblue30 <netblue30@yahoo.com> ongoing development |
14 | 15 | ||
diff --git a/src/firejail/firejail.h b/src/firejail/firejail.h index a364de75f..e4e6f4fa4 100644 --- a/src/firejail/firejail.h +++ b/src/firejail/firejail.h | |||
@@ -186,6 +186,7 @@ static inline int any_interface_configured(void) { | |||
186 | 186 | ||
187 | extern int arg_private; // mount private /home | 187 | extern int arg_private; // mount private /home |
188 | extern int arg_debug; // print debug messages | 188 | extern int arg_debug; // print debug messages |
189 | extern int arg_debug_check_filename; // print debug messages for invalid_filename() | ||
189 | extern int arg_nonetwork; // --net=none | 190 | extern int arg_nonetwork; // --net=none |
190 | extern int arg_command; // -c | 191 | extern int arg_command; // -c |
191 | extern int arg_overlay; // overlay option | 192 | extern int arg_overlay; // overlay option |
diff --git a/src/firejail/main.c b/src/firejail/main.c index 891653587..02eab1a86 100644 --- a/src/firejail/main.c +++ b/src/firejail/main.c | |||
@@ -50,6 +50,7 @@ static char child_stack[STACK_SIZE]; // space for child's stack | |||
50 | Config cfg; // configuration | 50 | Config cfg; // configuration |
51 | int arg_private = 0; // mount private /home and /tmp directoryu | 51 | int arg_private = 0; // mount private /home and /tmp directoryu |
52 | int arg_debug = 0; // print debug messages | 52 | int arg_debug = 0; // print debug messages |
53 | int arg_debug_check_filename; // print debug messages for invalid_filename() | ||
53 | int arg_nonetwork = 0; // --net=none | 54 | int arg_nonetwork = 0; // --net=none |
54 | int arg_command = 0; // -c | 55 | int arg_command = 0; // -c |
55 | int arg_overlay = 0; // overlay option | 56 | int arg_overlay = 0; // overlay option |
@@ -457,6 +458,10 @@ int main(int argc, char **argv) { | |||
457 | 458 | ||
458 | if (strcmp(argv[i], "--debug") == 0) | 459 | if (strcmp(argv[i], "--debug") == 0) |
459 | arg_debug = 1; | 460 | arg_debug = 1; |
461 | else if (strcmp(argv[i], "--debug-check-filename") == 0) { | ||
462 | arg_debug = 1; | ||
463 | arg_debug_check_filename = 1; | ||
464 | } | ||
460 | else if (strcmp(argv[i], "--quiet") == 0) | 465 | else if (strcmp(argv[i], "--quiet") == 0) |
461 | arg_quiet = 1; | 466 | arg_quiet = 1; |
462 | 467 | ||
diff --git a/src/firejail/util.c b/src/firejail/util.c index 880e45465..0d9479a02 100644 --- a/src/firejail/util.c +++ b/src/firejail/util.c | |||
@@ -574,7 +574,7 @@ void invalid_filename(const char *fname) { | |||
574 | assert(fname); | 574 | assert(fname); |
575 | const char *ptr = fname; | 575 | const char *ptr = fname; |
576 | 576 | ||
577 | if (arg_debug) | 577 | if (arg_debug && arg_debug_check_filename) |
578 | printf("Checking filename %s\n", fname); | 578 | printf("Checking filename %s\n", fname); |
579 | 579 | ||
580 | if (strncmp(ptr, "${HOME}", 7) == 0) | 580 | if (strncmp(ptr, "${HOME}", 7) == 0) |