git.cweiske.de
/
shpub.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
d573cd4
)
config perms
author
Christian Weiske
<
[email protected]
>
Tue, 6 Sep 2016 14:22:38 +0000
(16:22 +0200)
committer
Christian Weiske
<
[email protected]
>
Tue, 6 Sep 2016 14:22:38 +0000
(16:22 +0200)
src/shpub/Config.php
patch
|
blob
|
history
diff --git
a/src/shpub/Config.php
b/src/shpub/Config.php
index 9a2370507b0ca9fb11e53e620e59792f818c6d80..044b1504ab4ff87c7b21621d079e4187176bb155 100644
(file)
--- a/
src/shpub/Config.php
+++ b/
src/shpub/Config.php
@@
-67,7
+67,14
@@
class Config
$str .= $hostProp . '=' . $hostVal . "\n";
}
}
- file_put_contents($this->getConfigFilePath(), $str);
+ $cfgFilePath = $this->getConfigFilePath();
+ $cfgDir = dirname($cfgFilePath);
+ if (!is_dir($cfgDir)) {
+ mkdir($cfgDir);
+ }
+ file_put_contents($cfgFilePath, $str);
+ //contains sensitive data; nobody else may read that
+ chmod($cfgFilePath, 0600);
}
public function getDefaultHost()