bin/121101: named_chroot_autoupdate forgets protocols & services

Stefan `Sec` Zehl sec at 42.org
Mon Feb 25 23:20:04 UTC 2008


>Number:         121101
>Category:       bin
>Synopsis:       named_chroot_autoupdate forgets protocols & services
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Mon Feb 25 23:20:03 UTC 2008
>Closed-Date:
>Last-Modified:
>Originator:     sec
>Release:        FreeBSD 7.0-PRERELEASE amd64
>Organization:
>Environment:
System: FreeBSD ice 7.0-PRERELEASE FreeBSD 7.0-PRERELEASE #11: Thu Feb 21 00:53:58 CET 2008 root at ice:/usr/obj/usr/src/sys/ICE amd64



>Description:

running named in chroot with named_chroot_autoupdate="YES" creates
the chroot environment for named but forgets to copy
/etc/protocols
/etc/services


>How-To-Repeat:

run a chroot named with a zone including a WKS record

test  IN WKS  127.0.0.1 TCP ssh telnet finger saft http

produces the following error

Feb 25 23:34:26 ice named[82930]: dns_rdata_fromtext: master/42.org:285: near 'TCP': unknown protocol

>Fix:

--- /etc/rc.d/named.orig        2008-02-25 23:54:03.000000000 +0100
+++ /etc/rc.d/named     2008-02-25 23:56:32.000000000 +0100
@@ -64,12 +64,14 @@
        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 local information if it is not up to date.
        #
-       if [ -r /etc/localtime ]; then
-               cmp -s /etc/localtime "${named_chrootdir}/etc/localtime" ||
-                   cp -p /etc/localtime "${named_chrootdir}/etc/localtime"
+       for _f in localtime protocols services ; do
+       if [ -r /etc/$_f ]; then
+               cmp -s /etc/$_f "${named_chrootdir}/etc/$_f" ||
+                   cp -p /etc/$_f "${named_chrootdir}/etc/$_f"
        fi
+       done
 }

 # Make symlinks to the correct pid file


P.S.: diff may be broken. Had to cut&paste this PR to another box
      because the broken FreeBSD.org-MX kept rejecting my mail.
>Release-Note:
>Audit-Trail:
>Unformatted:


More information about the freebsd-bugs mailing list