Permalink
Browse files

Escape arguments when relinquishing a DHCP lease. Fixes #8843

  • Loading branch information...
jim-p committed Aug 27, 2018
1 parent b4e2567 commit c45cac34db914f175dc3cbfed8119d08d08aa519
Showing with 5 additions and 1 deletion.
  1. +5 −1 src/usr/local/www/status_interfaces.php
@@ -85,9 +85,13 @@ function dhcp_relinquish_lease($if, $ifdescr, $ipv) {
$leases_db = '/var/db/dhclient.leases.' . $if;
$conf_file = '/var/etc/dhclient_'.$ifdescr.'.conf';
$script_file = '/usr/local/sbin/pfSense-dhclient-script';
$ipv = ((int) $ipv == 6) ? '-6' : '-4';
if (file_exists($leases_db) && file_exists($script_file)) {
mwexec('/usr/local/sbin/dhclient -'.$ipv.' -d -r -lf '.$leases_db.' -cf '.$conf_file.' -sf '.$script_file);
mwexec('/usr/local/sbin/dhclient {$ipv} -d -r' .
' -lf ' . escapeshellarg($leases_db) .
' -cf ' . escapeshellarg($conf_file) .
' -sf ' . escapeshellarg($script_file));
}
}

0 comments on commit c45cac3

Please sign in to comment.