Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ci: fix --version not printing compile-time features #5147

Merged
merged 1 commit into from
May 17, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions src/firejail/checkcfg.c
Original file line number Diff line number Diff line change
Expand Up @@ -300,6 +300,12 @@ int checkcfg(int val) {
exit(1);
}

void print_version(void) {
printf("firejail version %s\n", VERSION);
printf("\n");
print_compiletime_support();
printf("\n");
}

void print_compiletime_support(void) {
printf("Compile time support:\n");
Expand Down
1 change: 1 addition & 0 deletions src/firejail/firejail.h
Original file line number Diff line number Diff line change
Expand Up @@ -833,6 +833,7 @@ extern char *config_seccomp_filter_add;
extern char **whitelist_reject_topdirs;

int checkcfg(int val);
void print_version(void);
void print_compiletime_support(void);

// appimage.c
Expand Down
7 changes: 2 additions & 5 deletions src/firejail/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -356,10 +356,7 @@ static void run_cmd_and_exit(int i, int argc, char **argv) {
exit(0);
}
else if (strcmp(argv[i], "--version") == 0) {
printf("firejail version %s\n", VERSION);
printf("\n");
print_compiletime_support();
printf("\n");
print_version();
exit(0);
}
#ifdef HAVE_OVERLAYFS
Expand Down Expand Up @@ -1082,7 +1079,7 @@ int main(int argc, char **argv, char **envp) {
EUID_USER();
if (rv == 0) {
if (check_arg(argc, argv, "--version", 1)) {
printf("firejail version %s\n", VERSION);
print_version();
exit(0);
}

Expand Down