diff options
author | Ermal <eri@pfsense.org> | 2012-11-20 16:34:03 +0000 |
---|---|---|
committer | Ermal <eri@pfsense.org> | 2012-11-20 16:34:03 +0000 |
commit | 938fc5b018a758c8dbbe2ce6680b92f3cb1c2185 (patch) | |
tree | 2011568ded4f65e3ad36d536611884326e4fe13a /etc | |
parent | 4b1497d02c1ade054cc12f5b7f79a3d03121f476 (diff) | |
download | pfsense-938fc5b018a758c8dbbe2ce6680b92f3cb1c2185.zip pfsense-938fc5b018a758c8dbbe2ce6680b92f3cb1c2185.tar.gz |
Create necessary dir and unset conf string after writing to file
Diffstat (limited to 'etc')
-rw-r--r-- | etc/inc/openvpn.inc | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/etc/inc/openvpn.inc b/etc/inc/openvpn.inc index 8ec37ef..38fb269 100644 --- a/etc/inc/openvpn.inc +++ b/etc/inc/openvpn.inc @@ -654,8 +654,13 @@ function openvpn_reconfigure($mode, $settings) { openvpn_add_custom($settings, $conf); - $fpath = $g['varetc_path']."/openvpn/{$mode_id}.conf"; + if (!is_dir("{$g['varetc_path']}/openvpn")) + safe_mkdir("{$g['varetc_path']}/openvpn", 0600); + if (!is_dir("{$g['varetc_path']}/openvpn-csc")) + safe_mkdir("{$g['varetc_path']}/openvpn-csc", 0600); + $fpath = "{$g['varetc_path']}/openvpn/{$mode_id}.conf"; file_put_contents($fpath, $conf); + unset($conf); //chown($fpath, 'nobody'); //chgrp($fpath, 'nobody'); @chmod("{$g['varetc_path']}/openvpn/{$mode_id}.conf", 0600); |