aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorLibravatar netblue30 <netblue30@yahoo.com>2015-12-06 07:57:20 -0500
committerLibravatar netblue30 <netblue30@yahoo.com>2015-12-06 07:57:20 -0500
commit0695f293eb5638d6aebf6719e18994d6a0c63298 (patch)
treed90c642343f9552c786421e6e1aac3dc4675da4b /src
parentfixed downloads directory (diff)
downloadfirejail-0695f293eb5638d6aebf6719e18994d6a0c63298.tar.gz
firejail-0695f293eb5638d6aebf6719e18994d6a0c63298.tar.zst
firejail-0695f293eb5638d6aebf6719e18994d6a0c63298.zip
fixes
Diffstat (limited to 'src')
-rw-r--r--src/firejail/fs_var.c8
-rw-r--r--src/firejail/main.c1
-rw-r--r--src/libtracelog/libtracelog.c2
3 files changed, 5 insertions, 6 deletions
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) {
335 printf("Create the new utmp file\n"); 335 printf("Create the new utmp file\n");
336 336
337 /* coverity[toctou] */ 337 /* coverity[toctou] */
338 FILE *fp = fopen(UTMP_FILE, "w"); 338 FILE *fp = fopen(RUN_UTMP_FILE, "w");
339 if (!fp) 339 if (!fp)
340 errExit("fopen"); 340 errExit("fopen");
341 341
@@ -354,15 +354,15 @@ void fs_var_utmp(void) {
354 // save new utmp file 354 // save new utmp file
355 fwrite(&u_boot, sizeof(u_boot), 1, fp); 355 fwrite(&u_boot, sizeof(u_boot), 1, fp);
356 fclose(fp); 356 fclose(fp);
357 if (chown(UTMP_FILE, 0, utmp_group) < 0) 357 if (chown(RUN_UTMP_FILE, 0, utmp_group) < 0)
358 errExit("chown"); 358 errExit("chown");
359 if (chmod(UTMP_FILE, S_IRUSR | S_IWRITE | S_IRGRP | S_IWGRP | S_IROTH ) < 0) 359 if (chmod(RUN_UTMP_FILE, S_IRUSR | S_IWRITE | S_IRGRP | S_IWGRP | S_IROTH ) < 0)
360 errExit("chmod"); 360 errExit("chmod");
361 361
362 // mount the new utmp file 362 // mount the new utmp file
363 if (arg_debug) 363 if (arg_debug)
364 printf("Mount the new utmp file\n"); 364 printf("Mount the new utmp file\n");
365 if (mount(UTMP_FILE, "/var/run/utmp", NULL, MS_BIND|MS_REC, NULL) < 0) 365 if (mount(RUN_UTMP_FILE, "/var/run/utmp", NULL, MS_BIND|MS_REC, NULL) < 0)
366 errExit("mount bind utmp"); 366 errExit("mount bind utmp");
367 fs_logger("create /var/run/utmp"); 367 fs_logger("create /var/run/utmp");
368} 368}
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) {
747 } 747 }
748 custom_profile_dir = expand_home(argv[i] + 15, cfg.homedir); 748 custom_profile_dir = expand_home(argv[i] + 15, cfg.homedir);
749 invalid_filename(custom_profile_dir); 749 invalid_filename(custom_profile_dir);
750 char *ptr = argv[i] + 15;
751 if (!is_dir(custom_profile_dir) || is_link(custom_profile_dir) || strstr(custom_profile_dir, "..")) { 750 if (!is_dir(custom_profile_dir) || is_link(custom_profile_dir) || strstr(custom_profile_dir, "..")) {
752 fprintf(stderr, "Error: invalid profile path\n"); 751 fprintf(stderr, "Error: invalid profile path\n");
753 exit(1); 752 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) {
62 return hash & HMASK; 62 return hash & HMASK;
63} 63}
64 64
65static storage_add(const char *str) { 65static void storage_add(const char *str) {
66 ListElem *ptr = malloc(sizeof(ListElem)); 66 ListElem *ptr = malloc(sizeof(ListElem));
67 if (!ptr) { 67 if (!ptr) {
68 fprintf(stderr, "Error: cannot allocate memory\n"); 68 fprintf(stderr, "Error: cannot allocate memory\n");