OpenVPN, don't remove CSO on disconnect, since there might already be a new one from a duplicate connect. closes https://github.com/opnsense/core/issues/2600

This commit is contained in:
Ad Schellevis 2018-08-05 11:33:11 +02:00
parent 8df4ab1ae1
commit cdb4b818c8
2 changed files with 0 additions and 42 deletions

View File

@ -3,7 +3,6 @@
if [ "$script_type" = "client-disconnect" ]; then
/sbin/pfctl -k $ifconfig_pool_remote_ip
/sbin/pfctl -K $ifconfig_pool_remote_ip
/usr/local/etc/inc/plugins.inc.d/openvpn/ovpn_cleanup_cso.php $1
fi
exit 0

View File

@ -1,41 +0,0 @@
#!/usr/local/bin/php
<?php
/*
* Copyright (C) 2018 Deciso B.V.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES,
* INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
* AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
* AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY,
* OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*/
$vpnid = filter_var($argv[1], FILTER_SANITIZE_NUMBER_INT);
$common_name = getenv("common_name");
$target_filename = "/var/etc/openvpn-csc/".$vpnid."/".$common_name;
openlog("openvpn", LOG_ODELAY, LOG_AUTH);
if (is_file($target_filename)) {
syslog(LOG_NOTICE, "client config removed @ {$target_filename}");
unlink($target_filename);
}
closelog();
exit(0);