diff options
author | Ermal <eri@pfsense.org> | 2013-10-22 18:42:32 +0000 |
---|---|---|
committer | jim-p <jimp@pfsense.org> | 2013-10-23 11:19:16 -0400 |
commit | 56fbff2e551a1afd7566b4c8b7eb8362798b735b (patch) | |
tree | 030901243a957f4e178430cfac5b85b50c3fae56 | |
parent | 9d879385019c6640fddf16b639d910e17e67f5d4 (diff) | |
download | pfsense-56fbff2e551a1afd7566b4c8b7eb8362798b735b.zip pfsense-56fbff2e551a1afd7566b4c8b7eb8362798b735b.tar.gz |
Use the pid of the process for the tmp file
-rw-r--r-- | etc/inc/ipsec.attributes.php | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/etc/inc/ipsec.attributes.php b/etc/inc/ipsec.attributes.php index bad0170..fd248d4 100644 --- a/etc/inc/ipsec.attributes.php +++ b/etc/inc/ipsec.attributes.php @@ -175,9 +175,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 \"ipsec/{$common_name}\" -f {$g['tmp_path']}/{$common_name}.rules"); - @unlink("{$g['tmp_path']}/{$common_name}.rules"); + $pid = posix_getpid(); + @file_put_contents("/tmp/{$pid}{$common_name}.rules", $rules); + mwexec("/sbin/pfctl -a \"ipsec/{$common_name}\" -f {$g['tmp_path']}/{$pid}{$common_name}.rules"); + @unlink("{$g['tmp_path']}/{$pid}{$common_name}.rules"); } ?> |