|
@@ -16,21 +16,21 @@ function parseZoneFile($zone_content, $types, $filter_domain = false) {
|
|
|
}
|
|
|
|
|
|
function knotcConfExec($cmds) {
|
|
|
- exec(CONF['dns']['knotc_path'] . ' conf-begin', $output['begin'], $code['begin']);
|
|
|
+ exec(CONF['dns']['knotc_path'] . ' --blocking --timeout 3 conf-begin', $output['begin'], $code['begin']);
|
|
|
if ($code['begin'] !== 0)
|
|
|
output(500, 'knotcConfExec: <code>knotc</code> failed with exit code <samp>' . $code['begin'] . '</samp>: <samp>' . $output['begin'][0] . '</samp>.');
|
|
|
|
|
|
foreach ($cmds as $cmd) {
|
|
|
- exec(CONF['dns']['knotc_path'] . ' conf-' . $cmd, $output['op'], $code['op']);
|
|
|
+ exec(CONF['dns']['knotc_path'] . ' --blocking --timeout 3 conf-' . $cmd, $output['op'], $code['op']);
|
|
|
if ($code['op'] !== 0) {
|
|
|
- exec(CONF['dns']['knotc_path'] . ' conf-abort');
|
|
|
+ exec(CONF['dns']['knotc_path'] . ' --blocking conf-abort');
|
|
|
output(500, 'knotcConfExec: <code>knotc</code> failed with exit code <samp>' . $code['op'] . '</samp>: <samp>' . $output['op'][0] . '</samp>.');
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- exec(CONF['dns']['knotc_path'] . ' conf-commit', $output['commit'], $code['commit']);
|
|
|
+ exec(CONF['dns']['knotc_path'] . ' --blocking --timeout 3 conf-commit', $output['commit'], $code['commit']);
|
|
|
if ($code['commit'] !== 0) {
|
|
|
- exec(CONF['dns']['knotc_path'] . ' conf-abort');
|
|
|
+ exec(CONF['dns']['knotc_path'] . ' --blocking conf-abort');
|
|
|
output(500, 'knotcConfExec: <code>knotc</code> failed with exit code <samp>' . $code['commit'] . '</samp>: <samp>' . $output['commit'][0] . '</samp>.');
|
|
|
}
|
|
|
}
|
|
@@ -38,19 +38,19 @@ function knotcConfExec($cmds) {
|
|
|
function knotcZoneExec($zone, $cmd, $action = NULL) {
|
|
|
$action = checkAction($action ?? $_POST['action']);
|
|
|
|
|
|
- exec(CONF['dns']['knotc_path'] . ' zone-begin ' . $zone, $output['begin'], $code['begin']);
|
|
|
+ exec(CONF['dns']['knotc_path'] . ' --blocking --timeout 3 zone-begin ' . $zone, $output['begin'], $code['begin']);
|
|
|
if ($code['begin'] !== 0)
|
|
|
output(500, 'knotcZoneExec: <code>knotc</code> failed with exit code <samp>' . $code['begin'] . '</samp>: <samp>' . $output['begin'][0] . '</samp>.');
|
|
|
|
|
|
- exec(CONF['dns']['knotc_path'] . ' zone-' . $action . 'set ' . $zone . ' ' . implode(' ', $cmd), $output['op'], $code['op']);
|
|
|
+ exec(CONF['dns']['knotc_path'] . ' --blocking --timeout 3 zone-' . $action . 'set ' . $zone . ' ' . implode(' ', $cmd), $output['op'], $code['op']);
|
|
|
if ($code['op'] !== 0) {
|
|
|
- exec(CONF['dns']['knotc_path'] . ' zone-abort ' . $zone);
|
|
|
+ exec(CONF['dns']['knotc_path'] . ' --blocking --timeout 3 zone-abort ' . $zone);
|
|
|
output(500, 'knotcZoneExec: <code>knotc</code> failed with exit code <samp>' . $code['op'] . '</samp>: <samp>' . $output['op'][0] . '</samp>.');
|
|
|
}
|
|
|
|
|
|
- exec(CONF['dns']['knotc_path'] . ' zone-commit ' . $zone, $output['commit'], $code['commit']);
|
|
|
+ exec(CONF['dns']['knotc_path'] . ' --blocking --timeout 3 zone-commit ' . $zone, $output['commit'], $code['commit']);
|
|
|
if ($code['commit'] !== 0) {
|
|
|
- exec(CONF['dns']['knotc_path'] . ' zone-abort ' . $zone);
|
|
|
+ exec(CONF['dns']['knotc_path'] . ' --blocking --timeout 3 zone-abort ' . $zone);
|
|
|
output(500, 'knotcZoneExec: <code>knotc</code> failed with exit code <samp>' . $code['commit'] . '</samp>: <samp>' . $output['commit'][0] . '</samp>.');
|
|
|
}
|
|
|
}
|