diff options
author | netblue30 <netblue30@yahoo.com> | 2016-06-28 10:56:17 -0400 |
---|---|---|
committer | netblue30 <netblue30@yahoo.com> | 2016-06-28 10:56:17 -0400 |
commit | 5cd597e5dfe13afa097e0a7b9d2344b204be2ec6 (patch) | |
tree | f78d66ce40626fefd370bd4f8e06889d5494445a /src | |
parent | sysutils (diff) | |
download | firejail-5cd597e5dfe13afa097e0a7b9d2344b204be2ec6.tar.gz firejail-5cd597e5dfe13afa097e0a7b9d2344b204be2ec6.tar.zst firejail-5cd597e5dfe13afa097e0a7b9d2344b204be2ec6.zip |
fix --version
Diffstat (limited to 'src')
-rw-r--r-- | src/firejail/main.c | 15 |
1 files changed, 13 insertions, 2 deletions
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) { | |||
766 | if (*argv[0] != '-') | 766 | if (*argv[0] != '-') |
767 | run_symlink(argc, argv); | 767 | run_symlink(argc, argv); |
768 | 768 | ||
769 | |||
770 | // check if we already have a sandbox running | 769 | // check if we already have a sandbox running |
771 | // If LXC is detected, start firejail sandbox | 770 | // If LXC is detected, start firejail sandbox |
772 | // otherwise try to detect a PID namespace by looking under /proc for specific kernel processes and: | 771 | // 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) { | |||
836 | // check root/suid | 835 | // check root/suid |
837 | EUID_ROOT(); | 836 | EUID_ROOT(); |
838 | if (geteuid()) { | 837 | if (geteuid()) { |
839 | fprintf(stderr, "Error: the sandbox is not setuid root\n"); | 838 | // detect --version |
839 | for (i = 1; i < argc; i++) { | ||
840 | if (strcmp(argv[i], "--version") == 0) { | ||
841 | printf("firejail version %s\n", VERSION); | ||
842 | exit(0); | ||
843 | } | ||
844 | |||
845 | // detect end of firejail params | ||
846 | if (strcmp(argv[i], "--") == 0) | ||
847 | break; | ||
848 | if (strncmp(argv[i], "--", 2) != 0) | ||
849 | break; | ||
850 | } | ||
840 | exit(1); | 851 | exit(1); |
841 | } | 852 | } |
842 | EUID_USER(); | 853 | EUID_USER(); |