aboutsummaryrefslogtreecommitdiffstats
path: root/src/firecfg/main.c
diff options
context:
space:
mode:
authorLibravatar Kelvin M. Klann <kmk3.code@protonmail.com>2023-05-11 21:02:46 -0300
committerLibravatar Kelvin M. Klann <kmk3.code@protonmail.com>2023-05-14 16:58:38 -0300
commitf019f0ec3fd807676855c99f11dd2fcebfc1da27 (patch)
tree33c496e8d8cf5c05946217f999031b18e9b6a312 /src/firecfg/main.c
parentMove usage text into usage_str var (diff)
downloadfirejail-f019f0ec3fd807676855c99f11dd2fcebfc1da27.tar.gz
firejail-f019f0ec3fd807676855c99f11dd2fcebfc1da27.tar.zst
firejail-f019f0ec3fd807676855c99f11dd2fcebfc1da27.zip
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).
Diffstat (limited to 'src/firecfg/main.c')
-rw-r--r--src/firecfg/main.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/firecfg/main.c b/src/firecfg/main.c
index aadc93579..da962c35d 100644
--- a/src/firecfg/main.c
+++ b/src/firecfg/main.c
@@ -413,6 +413,7 @@ int main(int argc, char **argv) {
413 } 413 }
414 } 414 }
415 415
416 print_version();
416 if (arg_debug) 417 if (arg_debug)
417 printf("%s %d %d %d %d\n", user, getuid(), getgid(), geteuid(), getegid()); 418 printf("%s %d %d %d %d\n", user, getuid(), getgid(), geteuid(), getegid());
418 419