fix --version

This commit is contained in:
netblue30 2016-06-28 10:56:17 -04:00
parent e413b78c49
commit 5cd597e5df
3 changed files with 16 additions and 4 deletions

View file

@ -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

View file

@ -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 <netblue30@yahoo.com> Tue, 31 May 2016 08:00:00 -0500
firejail (0.9.40) baseline; urgency=low

View file

@ -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();