diff options
author | Ermal <eri@pfsense.org> | 2013-10-22 18:46:12 +0000 |
---|---|---|
committer | jim-p <jimp@pfsense.org> | 2013-10-23 11:19:24 -0400 |
commit | 37a4fc943a3b05a07043f63cf471b2c5223bc3fa (patch) | |
tree | f0b439cf9bc9c1ef76e34a7d03ddffafdf5daa87 | |
parent | c4844c2c99b553d28910769f45ef3d3de2551c4e (diff) | |
download | pfsense-37a4fc943a3b05a07043f63cf471b2c5223bc3fa.zip pfsense-37a4fc943a3b05a07043f63cf471b2c5223bc3fa.tar.gz |
Use the pid of the process for the tmp file also prepend ovpn_ here to make it clear
-rw-r--r-- | etc/inc/openvpn.attributes.php | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/etc/inc/openvpn.attributes.php b/etc/inc/openvpn.attributes.php index 0c8a96f..209af70 100644 --- a/etc/inc/openvpn.attributes.php +++ b/etc/inc/openvpn.attributes.php @@ -177,9 +177,10 @@ function parse_cisco_acl($attribs) { $rules = parse_cisco_acl($attributes); if (!empty($rules)) { - @file_put_contents("/tmp/{$common_name}.rules", $rules); - mwexec("/sbin/pfctl -a \"openvpn/{$common_name}\" -f {$g['tmp_path']}/{$common_name}.rules"); - @unlink("{$g['tmp_path']}/{$common_name}.rules"); + $pid = posix_getpid(); + @file_put_contents("/tmp/ovpn_{$pid}{$common_name}.rules", $rules); + mwexec("/sbin/pfctl -a \"openvpn/{$common_name}\" -f {$g['tmp_path']}/ovpn_{$pid}{$common_name}.rules"); + @unlink("{$g['tmp_path']}/ovpn_{$pid}{$common_name}.rules"); } ?> |