Use chmod() instead of umask()

This commit is contained in:
Jakub Vrana 2014-06-27 08:15:15 -07:00
parent 7e3f2d9b1d
commit 52eee61247

View file

@ -1083,9 +1083,9 @@ function password_file($create) {
if ($return || !$create) { if ($return || !$create) {
return $return; return $return;
} }
umask(066);
$fp = @fopen($filename, "w"); // @ - can have insufficient rights //! is not atomic $fp = @fopen($filename, "w"); // @ - can have insufficient rights //! is not atomic
if ($fp) { if ($fp) {
chmod($filename, 0600);
$return = rand_string(); $return = rand_string();
fwrite($fp, $return); fwrite($fp, $return);
fclose($fp); fclose($fp);