From 136bf48b87cdfd7b9b41212bd2e5d116157f32ee Mon Sep 17 00:00:00 2001 From: Franco Fichtner Date: Mon, 27 Jul 2015 09:16:05 +0200 Subject: [PATCH] unbound: fix write on var /MFS --- src/etc/inc/unbound.inc | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/src/etc/inc/unbound.inc b/src/etc/inc/unbound.inc index 0e83055212..d8eb35b48b 100644 --- a/src/etc/inc/unbound.inc +++ b/src/etc/inc/unbound.inc @@ -88,9 +88,13 @@ function unbound_optimization() { } -function unbound_generate_config() { +function unbound_generate_config() +{ global $config, $g; + /* bootstrap unbound root (needed for /var MFS */ + @mkdir($g['unbound_chroot_path']); + // Setup optimization $optimization = unbound_optimization(); @@ -642,9 +646,10 @@ function unbound_acls_config() { } } } - // Write out Access list - file_put_contents("{$g['unbound_chroot_path']}/access_lists.conf", $aclcfg); + // Write out Access list + @mkdir($g['unbound_chroot_path']); + file_put_contents("{$g['unbound_chroot_path']}/access_lists.conf", $aclcfg); } // Generate hosts and reload services @@ -656,4 +661,3 @@ function unbound_hosts_generate() { unbound_control("reload"); } -?>