summaryrefslogtreecommitdiffstats
path: root/etc
diff options
context:
space:
mode:
authorErmal <eri@pfsense.org>2012-11-20 16:34:03 +0000
committerErmal <eri@pfsense.org>2012-11-20 16:34:03 +0000
commit938fc5b018a758c8dbbe2ce6680b92f3cb1c2185 (patch)
tree2011568ded4f65e3ad36d536611884326e4fe13a /etc
parent4b1497d02c1ade054cc12f5b7f79a3d03121f476 (diff)
downloadpfsense-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.inc7
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);
OpenPOWER on IntegriCloud