From 5cd597e5dfe13afa097e0a7b9d2344b204be2ec6 Mon Sep 17 00:00:00 2001 From: netblue30 Date: Tue, 28 Jun 2016 10:56:17 -0400 Subject: fix --version --- README.md | 3 ++- RELNOTES | 2 +- src/firejail/main.c | 15 +++++++++++++-- 3 files changed, 16 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index b11dc8249..230657756 100644 --- a/README.md +++ b/README.md @@ -77,4 +77,5 @@ Office: evince, gthumb, fbreader, pix ## New security profiles -Gitter, gThumb, mpv, Franz messenger, LibreOffice, pix, audacity, strings, xz, gzip, cpio +Gitter, gThumb, mpv, Franz messenger, LibreOffice, pix, audacity, strings, xz, xzdec, gzip, cpio, less + diff --git a/RELNOTES b/RELNOTES index 78a21bd2b..8d170a9b3 100644 --- a/RELNOTES +++ b/RELNOTES @@ -4,7 +4,7 @@ firejail (0.9.41) baseline; urgency=low * compile time support to disable global configuration file * some profiles have been converted to private-bin * new profiles: Gitter, gThumb, mpv, Franz messenger, LibreOffice - * new profiles: pix, audacity + * new profiles: pix, audacity, strings, xz, xzdec, gzip, cpio, less -- netblue30 Tue, 31 May 2016 08:00:00 -0500 firejail (0.9.40) baseline; urgency=low diff --git a/src/firejail/main.c b/src/firejail/main.c index 463bf4f31..6faec9109 100644 --- a/src/firejail/main.c +++ b/src/firejail/main.c @@ -766,7 +766,6 @@ int main(int argc, char **argv) { if (*argv[0] != '-') run_symlink(argc, argv); - // check if we already have a sandbox running // If LXC is detected, start firejail sandbox // otherwise try to detect a PID namespace by looking under /proc for specific kernel processes and: @@ -836,7 +835,19 @@ int main(int argc, char **argv) { // check root/suid EUID_ROOT(); if (geteuid()) { - fprintf(stderr, "Error: the sandbox is not setuid root\n"); + // detect --version + for (i = 1; i < argc; i++) { + if (strcmp(argv[i], "--version") == 0) { + printf("firejail version %s\n", VERSION); + exit(0); + } + + // detect end of firejail params + if (strcmp(argv[i], "--") == 0) + break; + if (strncmp(argv[i], "--", 2) != 0) + break; + } exit(1); } EUID_USER(); -- cgit v1.2.3-70-g09d2