aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLibravatar netblue30 <netblue30@yahoo.com>2016-03-10 12:14:39 -0500
committerLibravatar netblue30 <netblue30@yahoo.com>2016-03-10 12:14:39 -0500
commit4d66d7f70eed99aeadce7c50674eebe3c6d3ed66 (patch)
treea57c77042c0d42dd450f47e8491101f4ed3f525f
parentMerge pull request #363 from ligthyear/fixing-exit-code (diff)
downloadfirejail-4d66d7f70eed99aeadce7c50674eebe3c6d3ed66.tar.gz
firejail-4d66d7f70eed99aeadce7c50674eebe3c6d3ed66.tar.zst
firejail-4d66d7f70eed99aeadce7c50674eebe3c6d3ed66.zip
cleanup
-rw-r--r--README2
-rw-r--r--src/firejail/fs_bin.c1
-rw-r--r--src/firejail/ls.c4
-rw-r--r--src/firejail/sandbox.c2
-rw-r--r--src/lib/common.c4
5 files changed, 6 insertions, 7 deletions
diff --git a/README b/README
index aac7a6855..1bb6bb998 100644
--- a/README
+++ b/README
@@ -18,6 +18,8 @@ License: GPL v2
18Firejail Authors: 18Firejail Authors:
19 19
20netblue30 (netblue30@yahoo.com) 20netblue30 (netblue30@yahoo.com)
21Benjamin Kampmann (https://github.com/ligthyear)
22 - Forward exit code from child process
21dshmgh (https://github.com/dshmgh) 23dshmgh (https://github.com/dshmgh)
22 - overlayfs fix for systems with /home mounted on a separate partition 24 - overlayfs fix for systems with /home mounted on a separate partition
23Fred-Barclay (https://github.com/Fred-Barclay) 25Fred-Barclay (https://github.com/Fred-Barclay)
diff --git a/src/firejail/fs_bin.c b/src/firejail/fs_bin.c
index 228ed347a..2ee7f7504 100644
--- a/src/firejail/fs_bin.c
+++ b/src/firejail/fs_bin.c
@@ -243,5 +243,6 @@ void fs_private_bin_list(void) {
243 } 243 }
244 ptr = strtok(NULL, ","); 244 ptr = strtok(NULL, ",");
245 } 245 }
246 free(dlist);
246} 247}
247 248
diff --git a/src/firejail/ls.c b/src/firejail/ls.c
index 90ef43a62..fe6348312 100644
--- a/src/firejail/ls.c
+++ b/src/firejail/ls.c
@@ -32,8 +32,6 @@
32// uid/gid cache 32// uid/gid cache
33static uid_t c_uid = 0; 33static uid_t c_uid = 0;
34static char *c_uid_name = NULL; 34static char *c_uid_name = NULL;
35static gid_t c_gid = 0;
36static char *g_uid_name = NULL;
37 35
38static void print_file_or_dir(const char *path, const char *fname, int separator) { 36static void print_file_or_dir(const char *path, const char *fname, int separator) {
39 assert(fname); 37 assert(fname);
@@ -49,9 +47,7 @@ static void print_file_or_dir(const char *path, const char *fname, int separator
49 } 47 }
50 48
51 struct stat s; 49 struct stat s;
52 int is_broken_link = 0;
53 if (stat(name, &s) == -1) { 50 if (stat(name, &s) == -1) {
54 is_broken_link = 1;
55 if (lstat(name, &s) == -1) { 51 if (lstat(name, &s) == -1) {
56 printf("Error: cannot access %s\n", name); 52 printf("Error: cannot access %s\n", name);
57 return; 53 return;
diff --git a/src/firejail/sandbox.c b/src/firejail/sandbox.c
index 044b2b244..5bd86019a 100644
--- a/src/firejail/sandbox.c
+++ b/src/firejail/sandbox.c
@@ -687,7 +687,7 @@ int sandbox(void* sandbox_arg) {
687 687
688 int status = monitor_application(app_pid); // monitor application 688 int status = monitor_application(app_pid); // monitor application
689 689
690 if WIFEXITED(status) { 690 if (WIFEXITED(status)) {
691 // if we had a proper exit, return that exit status 691 // if we had a proper exit, return that exit status
692 return WEXITSTATUS(status); 692 return WEXITSTATUS(status);
693 } else { 693 } else {
diff --git a/src/lib/common.c b/src/lib/common.c
index fd3ab7071..8ea926df1 100644
--- a/src/lib/common.c
+++ b/src/lib/common.c
@@ -137,7 +137,7 @@ char *pid_proc_comm(const pid_t pid) {
137 free(fname); 137 free(fname);
138 138
139 // read file 139 // read file
140 unsigned char buffer[BUFLEN]; 140 char buffer[BUFLEN];
141 ssize_t len; 141 ssize_t len;
142 if ((len = read(fd, buffer, sizeof(buffer) - 1)) <= 0) { 142 if ((len = read(fd, buffer, sizeof(buffer) - 1)) <= 0) {
143 close(fd); 143 close(fd);
@@ -152,7 +152,7 @@ char *pid_proc_comm(const pid_t pid) {
152 *ptr = '\0'; 152 *ptr = '\0';
153 153
154 // return a malloc copy of the command line 154 // return a malloc copy of the command line
155 char *rv = strdup((char *) buffer); 155 char *rv = strdup(buffer);
156 if (strlen(rv) == 0) { 156 if (strlen(rv) == 0) {
157 free(rv); 157 free(rv);
158 return NULL; 158 return NULL;