]> git.sur5r.net Git - bacula/bacula/commitdiff
baculum: Change umask for new created files by Baculum
authorMarcin Haba <marcin.haba@bacula.pl>
Sat, 18 Jul 2015 18:12:41 +0000 (20:12 +0200)
committerEric Bollengier <eric@baculasystems.com>
Thu, 13 Aug 2015 06:51:50 +0000 (08:51 +0200)
gui/baculum/protected/Class/ConfigurationManager.php
gui/baculum/protected/Class/Miscellaneous.php

index 0986ba5d16618e1dd2334b3107abd0d3123dbd9e..d6aaba8a6beeecdf8aa6cae62c957b6123a4bd89 100644 (file)
@@ -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;
        }
 
index cf149e9b80f2a604554cc0cb15ba8bd086ce4531..cd8ee23669da33e0b6b30dd5da53aae71ee057c5 100644 (file)
@@ -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;
        }
 
        /**