From 4d66d7f70eed99aeadce7c50674eebe3c6d3ed66 Mon Sep 17 00:00:00 2001 From: netblue30 Date: Thu, 10 Mar 2016 12:14:39 -0500 Subject: cleanup --- README | 2 ++ src/firejail/fs_bin.c | 1 + src/firejail/ls.c | 4 ---- src/firejail/sandbox.c | 2 +- src/lib/common.c | 4 ++-- 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 Firejail Authors: netblue30 (netblue30@yahoo.com) +Benjamin Kampmann (https://github.com/ligthyear) + - Forward exit code from child process dshmgh (https://github.com/dshmgh) - overlayfs fix for systems with /home mounted on a separate partition Fred-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) { } ptr = strtok(NULL, ","); } + free(dlist); } 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 @@ // uid/gid cache static uid_t c_uid = 0; static char *c_uid_name = NULL; -static gid_t c_gid = 0; -static char *g_uid_name = NULL; static void print_file_or_dir(const char *path, const char *fname, int separator) { assert(fname); @@ -49,9 +47,7 @@ static void print_file_or_dir(const char *path, const char *fname, int separator } struct stat s; - int is_broken_link = 0; if (stat(name, &s) == -1) { - is_broken_link = 1; if (lstat(name, &s) == -1) { printf("Error: cannot access %s\n", name); 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) { int status = monitor_application(app_pid); // monitor application - if WIFEXITED(status) { + if (WIFEXITED(status)) { // if we had a proper exit, return that exit status return WEXITSTATUS(status); } 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) { free(fname); // read file - unsigned char buffer[BUFLEN]; + char buffer[BUFLEN]; ssize_t len; if ((len = read(fd, buffer, sizeof(buffer) - 1)) <= 0) { close(fd); @@ -152,7 +152,7 @@ char *pid_proc_comm(const pid_t pid) { *ptr = '\0'; // return a malloc copy of the command line - char *rv = strdup((char *) buffer); + char *rv = strdup(buffer); if (strlen(rv) == 0) { free(rv); return NULL; -- cgit v1.2.3-54-g00ecf