diff options
Diffstat (limited to 'src/firejail/git.c')
-rw-r--r-- | src/firejail/git.c | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/src/firejail/git.c b/src/firejail/git.c index c4dd54a1b..ae28f7ec1 100644 --- a/src/firejail/git.c +++ b/src/firejail/git.c | |||
@@ -19,7 +19,7 @@ | |||
19 | */ | 19 | */ |
20 | 20 | ||
21 | #ifdef HAVE_GIT_INSTALL | 21 | #ifdef HAVE_GIT_INSTALL |
22 | 22 | ||
23 | #include "firejail.h" | 23 | #include "firejail.h" |
24 | #include <sys/utsname.h> | 24 | #include <sys/utsname.h> |
25 | #include <sched.h> | 25 | #include <sched.h> |
@@ -46,7 +46,7 @@ static void sbox_ns(void) { | |||
46 | errExit("setgid/getgid"); | 46 | errExit("setgid/getgid"); |
47 | if (setuid(getuid()) < 0) | 47 | if (setuid(getuid()) < 0) |
48 | errExit("setuid/getuid"); | 48 | errExit("setuid/getuid"); |
49 | assert(getenv("LD_PRELOAD") == NULL); | 49 | assert(getenv("LD_PRELOAD") == NULL); |
50 | 50 | ||
51 | printf("Running as "); fflush(0); | 51 | printf("Running as "); fflush(0); |
52 | int rv = system("whoami"); | 52 | int rv = system("whoami"); |
@@ -55,16 +55,16 @@ static void sbox_ns(void) { | |||
55 | rv = system("ls -l /tmp"); | 55 | rv = system("ls -l /tmp"); |
56 | (void) rv; | 56 | (void) rv; |
57 | } | 57 | } |
58 | 58 | ||
59 | 59 | ||
60 | void git_install(void) { | 60 | void git_install(void) { |
61 | // redirect to "/usr/bin/firejail --noprofile --private-tmp /usr/lib/firejail/fgit-install.sh" | 61 | // redirect to "/usr/bin/firejail --noprofile --private-tmp /usr/lib/firejail/fgit-install.sh" |
62 | EUID_ASSERT(); | 62 | EUID_ASSERT(); |
63 | EUID_ROOT(); | 63 | EUID_ROOT(); |
64 | 64 | ||
65 | // install a mount namespace with a tmpfs on top of /tmp | 65 | // install a mount namespace with a tmpfs on top of /tmp |
66 | sbox_ns(); | 66 | sbox_ns(); |
67 | 67 | ||
68 | // run command | 68 | // run command |
69 | const char *cmd = LIBDIR "/firejail/fgit-install.sh"; | 69 | const char *cmd = LIBDIR "/firejail/fgit-install.sh"; |
70 | int rv = system(cmd); | 70 | int rv = system(cmd); |
@@ -76,15 +76,15 @@ void git_uninstall(void) { | |||
76 | // redirect to "/usr/bin/firejail --noprofile --private-tmp /usr/lib/firejail/fgit-install.sh" | 76 | // redirect to "/usr/bin/firejail --noprofile --private-tmp /usr/lib/firejail/fgit-install.sh" |
77 | EUID_ASSERT(); | 77 | EUID_ASSERT(); |
78 | EUID_ROOT(); | 78 | EUID_ROOT(); |
79 | 79 | ||
80 | // install a mount namespace with a tmpfs on top of /tmp | 80 | // install a mount namespace with a tmpfs on top of /tmp |
81 | sbox_ns(); | 81 | sbox_ns(); |
82 | 82 | ||
83 | // run command | 83 | // run command |
84 | const char *cmd = LIBDIR "/firejail/fgit-uninstall.sh"; | 84 | const char *cmd = LIBDIR "/firejail/fgit-uninstall.sh"; |
85 | int rv = system(cmd); | 85 | int rv = system(cmd); |
86 | (void) rv; | 86 | (void) rv; |
87 | exit(0); | 87 | exit(0); |
88 | } | 88 | } |
89 | 89 | ||
90 | #endif // HAVE_GIT_INSTALL | 90 | #endif // HAVE_GIT_INSTALL |