Skip to content

Commit

Permalink
Escape arguments when relinquishing a DHCP lease. Fixes #8843
Browse files Browse the repository at this point in the history
  • Loading branch information
jim-p committed Aug 27, 2018
1 parent b4e2567 commit c45cac3
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/usr/local/www/status_interfaces.php
Expand Up @@ -85,9 +85,13 @@ function dhcp_relinquish_lease($if, $ifdescr, $ipv) {
$leases_db = '/var/db/dhclient.leases.' . $if; $leases_db = '/var/db/dhclient.leases.' . $if;
$conf_file = '/var/etc/dhclient_'.$ifdescr.'.conf'; $conf_file = '/var/etc/dhclient_'.$ifdescr.'.conf';
$script_file = '/usr/local/sbin/pfSense-dhclient-script'; $script_file = '/usr/local/sbin/pfSense-dhclient-script';
$ipv = ((int) $ipv == 6) ? '-6' : '-4';


if (file_exists($leases_db) && file_exists($script_file)) { 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));
} }
} }


Expand Down

0 comments on commit c45cac3

Please sign in to comment.