From: Marcin Haba Date: Sat, 18 Jul 2015 18:12:41 +0000 (+0200) Subject: baculum: Change umask for new created files by Baculum X-Git-Tag: Release-7.2.0~23 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=f47d6740b1984d02363627b26dff5981016210e5;p=bacula%2Fbacula baculum: Change umask for new created files by Baculum --- diff --git a/gui/baculum/protected/Class/ConfigurationManager.php b/gui/baculum/protected/Class/ConfigurationManager.php index 0986ba5d16..d6aaba8a6b 100644 --- a/gui/baculum/protected/Class/ConfigurationManager.php +++ b/gui/baculum/protected/Class/ConfigurationManager.php @@ -192,7 +192,10 @@ class ConfigurationManager extends TModule } $usersToFile = implode("\n", $users); + $old_umask = umask(0); + umask(0077); $result = file_put_contents($usersFile, $usersToFile) !== false; + umask($old_umask); return $result; } diff --git a/gui/baculum/protected/Class/Miscellaneous.php b/gui/baculum/protected/Class/Miscellaneous.php index cf149e9b80..cd8ee23669 100644 --- a/gui/baculum/protected/Class/Miscellaneous.php +++ b/gui/baculum/protected/Class/Miscellaneous.php @@ -143,7 +143,11 @@ class Miscellaneous extends TModule { } $tmp .= "\n"; } - return file_put_contents($file, $tmp); + $old_umask = umask(0); + umask(0077); + $result = file_put_contents($file, $tmp); + umask($old_umask); + return $result; } /**