From 0695f293eb5638d6aebf6719e18994d6a0c63298 Mon Sep 17 00:00:00 2001 From: netblue30 Date: Sun, 6 Dec 2015 07:57:20 -0500 Subject: fixes --- src/firejail/fs_var.c | 8 ++++---- src/firejail/main.c | 1 - src/libtracelog/libtracelog.c | 2 +- 3 files changed, 5 insertions(+), 6 deletions(-) (limited to 'src') diff --git a/src/firejail/fs_var.c b/src/firejail/fs_var.c index a53c22093..372765cd4 100644 --- a/src/firejail/fs_var.c +++ b/src/firejail/fs_var.c @@ -335,7 +335,7 @@ void fs_var_utmp(void) { printf("Create the new utmp file\n"); /* coverity[toctou] */ - FILE *fp = fopen(UTMP_FILE, "w"); + FILE *fp = fopen(RUN_UTMP_FILE, "w"); if (!fp) errExit("fopen"); @@ -354,15 +354,15 @@ void fs_var_utmp(void) { // save new utmp file fwrite(&u_boot, sizeof(u_boot), 1, fp); fclose(fp); - if (chown(UTMP_FILE, 0, utmp_group) < 0) + if (chown(RUN_UTMP_FILE, 0, utmp_group) < 0) errExit("chown"); - if (chmod(UTMP_FILE, S_IRUSR | S_IWRITE | S_IRGRP | S_IWGRP | S_IROTH ) < 0) + if (chmod(RUN_UTMP_FILE, S_IRUSR | S_IWRITE | S_IRGRP | S_IWGRP | S_IROTH ) < 0) errExit("chmod"); // mount the new utmp file if (arg_debug) printf("Mount the new utmp file\n"); - if (mount(UTMP_FILE, "/var/run/utmp", NULL, MS_BIND|MS_REC, NULL) < 0) + if (mount(RUN_UTMP_FILE, "/var/run/utmp", NULL, MS_BIND|MS_REC, NULL) < 0) errExit("mount bind utmp"); fs_logger("create /var/run/utmp"); } diff --git a/src/firejail/main.c b/src/firejail/main.c index eecb5b0a0..aad0af3e4 100644 --- a/src/firejail/main.c +++ b/src/firejail/main.c @@ -747,7 +747,6 @@ int main(int argc, char **argv) { } custom_profile_dir = expand_home(argv[i] + 15, cfg.homedir); invalid_filename(custom_profile_dir); - char *ptr = argv[i] + 15; if (!is_dir(custom_profile_dir) || is_link(custom_profile_dir) || strstr(custom_profile_dir, "..")) { fprintf(stderr, "Error: invalid profile path\n"); exit(1); diff --git a/src/libtracelog/libtracelog.c b/src/libtracelog/libtracelog.c index 26787daed..3124dafa0 100644 --- a/src/libtracelog/libtracelog.c +++ b/src/libtracelog/libtracelog.c @@ -62,7 +62,7 @@ static inline uint32_t hash(const char *str) { return hash & HMASK; } -static storage_add(const char *str) { +static void storage_add(const char *str) { ListElem *ptr = malloc(sizeof(ListElem)); if (!ptr) { fprintf(stderr, "Error: cannot allocate memory\n"); -- cgit v1.2.3-54-g00ecf