diff options
author | dougb <dougb@FreeBSD.org> | 2008-08-01 06:11:33 +0000 |
---|---|---|
committer | dougb <dougb@FreeBSD.org> | 2008-08-01 06:11:33 +0000 |
commit | 6f04a5d9f382971fbf97ac4c2c685ad6b4bbb0b9 (patch) | |
tree | d735d30622d36fd56072366ddc3da2d71e1abc91 | |
parent | 97559f39b46b9c5f75a34b9fdda54e6bf49a8886 (diff) | |
download | FreeBSD-src-6f04a5d9f382971fbf97ac4c2c685ad6b4bbb0b9.zip FreeBSD-src-6f04a5d9f382971fbf97ac4c2c685ad6b4bbb0b9.tar.gz |
When using SRV records the protocols and services files need to be in the
chroot /etc directory.
PR: conf/121101
Submitted by: Stefan `Sec` Zehl <sec@42.org>
-rwxr-xr-x | etc/rc.d/named | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/etc/rc.d/named b/etc/rc.d/named index 7466739..4aedb04 100755 --- a/etc/rc.d/named +++ b/etc/rc.d/named @@ -32,6 +32,8 @@ stop_postcmd="named_poststop" # chroot_autoupdate() { + local file + # Create (or update) the chroot directory structure # if [ -r /etc/mtree/BIND.chroot.dist ]; then @@ -64,12 +66,14 @@ chroot_autoupdate() devfs -m ${named_chrootdir}/dev rule apply path null unhide devfs -m ${named_chrootdir}/dev rule apply path random unhide - # Copy local timezone information if it is not up to date. + # Copy and/or update key files to the chroot /etc # - if [ -r /etc/localtime ]; then - cmp -s /etc/localtime "${named_chrootdir}/etc/localtime" || - cp -p /etc/localtime "${named_chrootdir}/etc/localtime" - fi + for file in localtime protocols services; do + if [ -r /etc/$file ]; then + cmp -s /etc/$file "${named_chrootdir}/etc/$file" || + cp -p /etc/$file "${named_chrootdir}/etc/$file" + fi + done } # Make symlinks to the correct pid file |