From owner-freebsd-bugs@FreeBSD.ORG Mon Feb 25 23:20:04 2008 Return-Path: Delivered-To: freebsd-bugs@hub.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3247A16A407 for ; Mon, 25 Feb 2008 23:20:04 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:4f8:fff6::28]) by mx1.freebsd.org (Postfix) with ESMTP id 1A23313C45D for ; Mon, 25 Feb 2008 23:20:04 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (gnats@localhost [127.0.0.1]) by freefall.freebsd.org (8.14.2/8.14.2) with ESMTP id m1PNK4Ce090251 for ; Mon, 25 Feb 2008 23:20:04 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.14.2/8.14.1/Submit) id m1PNK3vn090245; Mon, 25 Feb 2008 23:20:03 GMT (envelope-from gnats) Resent-Date: Mon, 25 Feb 2008 23:20:03 GMT Resent-Message-Id: <200802252320.m1PNK3vn090245@freefall.freebsd.org> Resent-From: FreeBSD-gnats-submit@FreeBSD.org (GNATS Filer) Resent-To: freebsd-bugs@FreeBSD.org Resent-Reply-To: FreeBSD-gnats-submit@FreeBSD.org, Stefan `Sec` Zehl Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 860CD16A400 for ; Mon, 25 Feb 2008 23:15:53 +0000 (UTC) (envelope-from sec@42.org) Received: from ice.42.org (v6.42.org [IPv6:2001:608:9::1]) by mx1.freebsd.org (Postfix) with ESMTP id 2AD6D13C4D9 for ; Mon, 25 Feb 2008 23:15:53 +0000 (UTC) (envelope-from sec@42.org) Received: by ice.42.org (Postfix, from userid 1000) id 812E5B853; Tue, 26 Feb 2008 00:15:51 +0100 (CET) Message-Id: <20080225231551.812E5B853@ice.42.org> Date: Tue, 26 Feb 2008 00:15:51 +0100 (CET) From: Stefan `Sec` Zehl To: FreeBSD-gnats-submit@FreeBSD.org X-Send-Pr-Version: 3.113 Cc: Subject: bin/121101: named_chroot_autoupdate forgets protocols & services X-BeenThere: freebsd-bugs@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: Stefan `Sec` Zehl List-Id: Bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 25 Feb 2008 23:20:04 -0000 >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@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: