aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLibravatar Duncaen <mail@duncano.de>2015-12-19 23:44:38 +0100
committerLibravatar Duncaen <mail@duncano.de>2015-12-20 00:42:39 +0100
commitf9a8757ee2b4be9b5fcd5237edce260e0185750a (patch)
tree36c25d5f237cf0df0a437195826a6dc7f30c509c
parentnew webpage (diff)
downloadfirejail-f9a8757ee2b4be9b5fcd5237edce260e0185750a.tar.gz
firejail-f9a8757ee2b4be9b5fcd5237edce260e0185750a.tar.zst
firejail-f9a8757ee2b4be9b5fcd5237edce260e0185750a.zip
use UTMP_FILE to check for its existence
-rw-r--r--src/firejail/fs_var.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/src/firejail/fs_var.c b/src/firejail/fs_var.c
index 372765cd4..377ce8ff3 100644
--- a/src/firejail/fs_var.c
+++ b/src/firejail/fs_var.c
@@ -320,7 +320,7 @@ void fs_var_utmp(void) {
320 320
321 // extract utmp group id 321 // extract utmp group id
322 gid_t utmp_group = 0; 322 gid_t utmp_group = 0;
323 if (stat("/var/run/utmp", &s) == 0) 323 if (stat(UTMP_FILE, &s) == 0)
324 utmp_group = s.st_gid; 324 utmp_group = s.st_gid;
325 else { 325 else {
326 fprintf(stderr, "Warning: cannot find /var/run/utmp\n"); 326 fprintf(stderr, "Warning: cannot find /var/run/utmp\n");
@@ -362,9 +362,7 @@ void fs_var_utmp(void) {
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(RUN_UTMP_FILE, "/var/run/utmp", NULL, MS_BIND|MS_REC, NULL) < 0) 365 if (mount(RUN_UTMP_FILE, UTMP_FILE, 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}
369
370