diff options
author | jim-p <jimp@netgate.com> | 2019-04-11 08:56:49 -0400 |
---|---|---|
committer | jim-p <jimp@netgate.com> | 2019-05-10 16:20:31 -0400 |
commit | 6cb5a9376280a8fe7a5de82de83d09cebfd98bd9 (patch) | |
tree | aebcc4280d39ba6c39127745875180f441d2d0c3 | |
parent | 44fb8aca0db0e8c7fe03cb2e37a3cfe71872b1b3 (diff) | |
download | pfsense-6cb5a9376280a8fe7a5de82de83d09cebfd98bd9.zip pfsense-6cb5a9376280a8fe7a5de82de83d09cebfd98bd9.tar.gz |
Rewrite unbound remotecontrol.conf when it is empty. Fixes #9470
(cherry picked from commit 4b70a2006e6afb7813344eec8cafb8570e67256b)
-rw-r--r-- | src/etc/inc/unbound.inc | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/etc/inc/unbound.inc b/src/etc/inc/unbound.inc index 66a7c89..e02742d 100644 --- a/src/etc/inc/unbound.inc +++ b/src/etc/inc/unbound.inc @@ -484,7 +484,9 @@ EOD; function unbound_remote_control_setup($cfgsubdir = "") { global $g; - if (!file_exists("{$g['unbound_chroot_path']}{$cfgsubdir}/remotecontrol.conf") || !file_exists("{$g['unbound_chroot_path']}{$cfgsubdir}/unbound_control.key")) { + if (!file_exists("{$g['unbound_chroot_path']}{$cfgsubdir}/remotecontrol.conf") || + (filesize("{$g['unbound_chroot_path']}{$cfgsubdir}/remotecontrol.conf") == 0) || + !file_exists("{$g['unbound_chroot_path']}{$cfgsubdir}/unbound_control.key")) { $remotcfg = <<<EOF remote-control: control-enable: yes |