diff options
author | Kelvin M. Klann <kmk3.code@protonmail.com> | 2022-05-16 20:32:16 -0300 |
---|---|---|
committer | Kelvin M. Klann <kmk3.code@protonmail.com> | 2022-05-16 21:04:41 -0300 |
commit | 78aaed11d85be690204fbd956732a7c1f18363e3 (patch) | |
tree | 77621cd40ef12e752f96cac5791f440ffadf560c /src | |
parent | build(deps): bump github/codeql-action from 2.1.9 to 2.1.10 (diff) | |
download | firejail-78aaed11d85be690204fbd956732a7c1f18363e3.tar.gz firejail-78aaed11d85be690204fbd956732a7c1f18363e3.tar.zst firejail-78aaed11d85be690204fbd956732a7c1f18363e3.zip |
ci: fix --version not printing compile-time features
Currently, when running on CI, `firejail --version` only prints the
following line:
firejail version 0.9.69
Add a new print_version() function that always prints both the above and
the compile-time options (like it is done outside of CI) and call it in
both of the places that handle --version on main.c.
Misc: The printing of compile-time features was added on commit
48dd1fbec ("apparmor", 2016-08-02).
Diffstat (limited to 'src')
-rw-r--r-- | src/firejail/checkcfg.c | 6 | ||||
-rw-r--r-- | src/firejail/firejail.h | 1 | ||||
-rw-r--r-- | src/firejail/main.c | 7 |
3 files changed, 9 insertions, 5 deletions
diff --git a/src/firejail/checkcfg.c b/src/firejail/checkcfg.c index 6fc70318b..8f8f5b6c3 100644 --- a/src/firejail/checkcfg.c +++ b/src/firejail/checkcfg.c | |||
@@ -300,6 +300,12 @@ errout: | |||
300 | exit(1); | 300 | exit(1); |
301 | } | 301 | } |
302 | 302 | ||
303 | void print_version(void) { | ||
304 | printf("firejail version %s\n", VERSION); | ||
305 | printf("\n"); | ||
306 | print_compiletime_support(); | ||
307 | printf("\n"); | ||
308 | } | ||
303 | 309 | ||
304 | void print_compiletime_support(void) { | 310 | void print_compiletime_support(void) { |
305 | printf("Compile time support:\n"); | 311 | printf("Compile time support:\n"); |
diff --git a/src/firejail/firejail.h b/src/firejail/firejail.h index 316518534..de11b438d 100644 --- a/src/firejail/firejail.h +++ b/src/firejail/firejail.h | |||
@@ -833,6 +833,7 @@ extern char *config_seccomp_filter_add; | |||
833 | extern char **whitelist_reject_topdirs; | 833 | extern char **whitelist_reject_topdirs; |
834 | 834 | ||
835 | int checkcfg(int val); | 835 | int checkcfg(int val); |
836 | void print_version(void); | ||
836 | void print_compiletime_support(void); | 837 | void print_compiletime_support(void); |
837 | 838 | ||
838 | // appimage.c | 839 | // appimage.c |
diff --git a/src/firejail/main.c b/src/firejail/main.c index fd96f8bb5..1d90b9fc5 100644 --- a/src/firejail/main.c +++ b/src/firejail/main.c | |||
@@ -356,10 +356,7 @@ static void run_cmd_and_exit(int i, int argc, char **argv) { | |||
356 | exit(0); | 356 | exit(0); |
357 | } | 357 | } |
358 | else if (strcmp(argv[i], "--version") == 0) { | 358 | else if (strcmp(argv[i], "--version") == 0) { |
359 | printf("firejail version %s\n", VERSION); | 359 | print_version(); |
360 | printf("\n"); | ||
361 | print_compiletime_support(); | ||
362 | printf("\n"); | ||
363 | exit(0); | 360 | exit(0); |
364 | } | 361 | } |
365 | #ifdef HAVE_OVERLAYFS | 362 | #ifdef HAVE_OVERLAYFS |
@@ -1082,7 +1079,7 @@ int main(int argc, char **argv, char **envp) { | |||
1082 | EUID_USER(); | 1079 | EUID_USER(); |
1083 | if (rv == 0) { | 1080 | if (rv == 0) { |
1084 | if (check_arg(argc, argv, "--version", 1)) { | 1081 | if (check_arg(argc, argv, "--version", 1)) { |
1085 | printf("firejail version %s\n", VERSION); | 1082 | print_version(); |
1086 | exit(0); | 1083 | exit(0); |
1087 | } | 1084 | } |
1088 | 1085 | ||