mirror of
https://github.com/netblue30/firejail.git
synced 2026-05-15 14:16:14 -06:00
Print version on startup for firejail/firecfg
It is not too uncommon for the firejail version to be missing when issues are reported; this commit makes it more likely that any posted logs will contain the program version. Do so just for firejail and firecfg for now because they are the most common user-facing programs. Print the version after argument parsing, in order to avoid printing the program version more than once and to avoid interfering with commands that generate machine-readable output (like `firejail --list` and `firecfg --list`). Also, only print it after all profiles have been loaded, because a profile may contain `quiet`. Note: This does not cover the case where the program exits before the end of argument/profile parsing (such as when an error occurs).
This commit is contained in:
parent
15ad8696c7
commit
f019f0ec3f
2 changed files with 6 additions and 0 deletions
|
|
@ -413,6 +413,7 @@ int main(int argc, char **argv) {
|
|||
}
|
||||
}
|
||||
|
||||
print_version();
|
||||
if (arg_debug)
|
||||
printf("%s %d %d %d %d\n", user, getuid(), getgid(), geteuid(), getegid());
|
||||
|
||||
|
|
|
|||
|
|
@ -3010,6 +3010,11 @@ int main(int argc, char **argv, char **envp) {
|
|||
}
|
||||
EUID_ASSERT();
|
||||
|
||||
// Note: Only attempt to print non-debug information to stdout after
|
||||
// all profiles have been loaded (because a profile may set arg_quiet)
|
||||
if (!arg_quiet)
|
||||
print_version();
|
||||
|
||||
// block X11 sockets
|
||||
if (arg_x11_block)
|
||||
x11_block();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue