aboutsummaryrefslogtreecommitdiffstats
path: root/config/unbound/unbound.inc
diff options
context:
space:
mode:
authorScott Ullrich <sullrich@pfsense.org>2010-11-21 17:55:30 -0500
committerScott Ullrich <sullrich@pfsense.org>2010-11-21 17:55:30 -0500
commit38ac447b0cd9362f60cc73652defa88f9871bc24 (patch)
tree1a967c6d799563d02fcefd8e1bf7c0b0ce6a8f13 /config/unbound/unbound.inc
parent540e2e26c1527d5cb8af2e5389207d9f202a8ff7 (diff)
downloadpfsense-packages-38ac447b0cd9362f60cc73652defa88f9871bc24.tar.gz
pfsense-packages-38ac447b0cd9362f60cc73652defa88f9871bc24.tar.bz2
pfsense-packages-38ac447b0cd9362f60cc73652defa88f9871bc24.zip
Ensue unbound user exists
Diffstat (limited to 'config/unbound/unbound.inc')
-rw-r--r--config/unbound/unbound.inc11
1 files changed, 10 insertions, 1 deletions
diff --git a/config/unbound/unbound.inc b/config/unbound/unbound.inc
index 2b3b30b0..6b7080f4 100644
--- a/config/unbound/unbound.inc
+++ b/config/unbound/unbound.inc
@@ -37,9 +37,13 @@ function unbound_initial_setup() {
$config['installedpackages']['unbound']['config'] = array();
$unbound_config = &$config['installedpackages']['unbound']['config'][0];
-
+
+ // Ensure Unbound user exists
+ exec("/usr/sbin/pw useradd unbound");
+
// Setup unbound
mwexec("/bin/mkdir -p /usr/local/etc/unbound /usr/local/etc/unbound/dev");
+ @chown("/usr/local/etc/unbound/.", "unbound");
@touch("/usr/local/etc/unbound/root.hints");
@touch("/usr/local/etc/unbound/root-trust-anchor");
@chown("/usr/local/etc/unbound/root-trust-anchor", "unbound");
@@ -64,6 +68,8 @@ function unbound_initial_setup() {
unbound_resync_config();
unbound_keys_setup();
+ exec("/usr/sbin/chown unbound:wheel /usr/local/etc/unbound/*");
+
// Write out the XML config
write_config();
@@ -399,6 +405,9 @@ function unbound_uninstall() {
mwexec("rm -rf /usr/local/etc/unbound");
mwexec("rm -f /usr/local/etc/rc.d/unbound.sh");
+ // Remove unbound user
+ exec("/usr/sbin/pw userdel unbound");
+
conf_mount_ro();
}