diff options
author | netblue30 <netblue30@yahoo.com> | 2016-03-10 12:14:39 -0500 |
---|---|---|
committer | netblue30 <netblue30@yahoo.com> | 2016-03-10 12:14:39 -0500 |
commit | 4d66d7f70eed99aeadce7c50674eebe3c6d3ed66 (patch) | |
tree | a57c77042c0d42dd450f47e8491101f4ed3f525f /src | |
parent | Merge pull request #363 from ligthyear/fixing-exit-code (diff) | |
download | firejail-4d66d7f70eed99aeadce7c50674eebe3c6d3ed66.tar.gz firejail-4d66d7f70eed99aeadce7c50674eebe3c6d3ed66.tar.zst firejail-4d66d7f70eed99aeadce7c50674eebe3c6d3ed66.zip |
cleanup
Diffstat (limited to 'src')
-rw-r--r-- | src/firejail/fs_bin.c | 1 | ||||
-rw-r--r-- | src/firejail/ls.c | 4 | ||||
-rw-r--r-- | src/firejail/sandbox.c | 2 | ||||
-rw-r--r-- | src/lib/common.c | 4 |
4 files changed, 4 insertions, 7 deletions
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 |
33 | static uid_t c_uid = 0; | 33 | static uid_t c_uid = 0; |
34 | static char *c_uid_name = NULL; | 34 | static char *c_uid_name = NULL; |
35 | static gid_t c_gid = 0; | ||
36 | static char *g_uid_name = NULL; | ||
37 | 35 | ||
38 | static void print_file_or_dir(const char *path, const char *fname, int separator) { | 36 | static 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; |