Use the pid of the process for the tmp file also prepend ovpn_ here to make it clear

This commit is contained in:
Ermal 2013-10-22 18:46:12 +00:00
parent 45758be466
commit 7b95ffdd72

View File

@ -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");
}
?>