Selaa lähdekoodia

tmon: set umask to a reasonable value

Currently, the tmon umask value is set to 0, which means whatever the permission
mask in the shell are when starting tmon in daemon mode are what the permissions
of any created files will be.  We should likely set something more explicit, so
lets go with the usual 022

Signed-off-by: Neil Horman <nhorman@tuxdriver.com>
Acked-by: Jacob Pan <jacob.jun.pan@linux.intel.com>
Signed-off-by: Zhang Rui <rui.zhang@intel.com>
Neil Horman 11 vuotta sitten
vanhempi
commit
4adccf9fc8
1 muutettua tiedostoa jossa 1 lisäystä ja 1 poistoa
  1. 1 1
      tools/thermal/tmon/tmon.c

+ 1 - 1
tools/thermal/tmon/tmon.c

@@ -355,7 +355,7 @@ static void start_daemon_mode()
 	disable_tui();
 	disable_tui();
 
 
 	/* change the file mode mask */
 	/* change the file mode mask */
-	umask(0);
+	umask(S_IWGRP | S_IWOTH);
 
 
 	/* new SID for the daemon process */
 	/* new SID for the daemon process */
 	sid = setsid();
 	sid = setsid();