Skip to content

Commit

Permalink
fix: main: add check for --debug at the start of main()
Browse files Browse the repository at this point in the history
The arg_debug flag is set after some function check for it.
A function in this situation is check_kernel_procs().
  • Loading branch information
powerjungle committed Dec 27, 2024
1 parent afce467 commit 62b1a75
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/firejail/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -1110,6 +1110,13 @@ int main(int argc, char **argv, char **envp) {
if (check_arg(argc, argv, "--quiet", 1) || (env_quiet && strcmp(env_quiet, "yes") == 0))
arg_quiet = 1;

// process --debug
const char *env_debug = env_get("FIREJAIL_DEBUG");
if (check_arg(argc, argv, "--debug", 1) || (env_debug && strcmp(env_debug, "yes") == 0)) {
arg_debug = 1;
arg_quiet = 0;
}

// check if the user is allowed to use firejail
init_cfg(argc, argv);

Expand Down

0 comments on commit 62b1a75

Please sign in to comment.