dns/rfc2136: mwexecf_bg, exec_safe and file_safe

PR: https://github.com/opnsense/core/issues/9325
This commit is contained in:
Franco Fichtner 2025-10-28 16:07:25 +01:00
parent ad06910687
commit d2940eb8af

View file

@ -198,16 +198,15 @@ function rfc2136_configure_do($verbose = false, $int = null, $updatehost = '', $
$upinst .= "\n"; /* mind that trailing newline! */
if ($need_update) {
@file_put_contents("/var/etc/nsupdatecmds{$i}", $upinst);
unset($upinst);
/* invoke nsupdate */
$cmd = "/usr/local/bin/nsupdate -k {$keyfile}";
$cmds = "/var/etc/nsupdatecmds{$i}";
file_safe($cmds, $upinst);
$args = [];
$args[] = exec_safe('-k %s', $keyfile);
if (isset($dnsupdate['usetcp'])) {
$cmd .= " -v";
$args[] = '-v';
}
$cmd .= " /var/etc/nsupdatecmds{$i}";
mwexec_bg($cmd);
unset($cmd);
$args[] = exec_safe('%s', $cmds);
mwexecf_bg('/usr/local/bin/nsupdate ' . join(' ', $args));
}
}