From sec@42.org  Mon Feb 25 23:15:53 2008
Return-Path: <sec@42.org>
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 860CD16A400
	for <FreeBSD-gnats-submit@freebsd.org>; 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 <FreeBSD-gnats-submit@freebsd.org>; 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 <sec@42.org>
Reply-To: Stefan `Sec` Zehl <sec@42.org>
To: FreeBSD-gnats-submit@freebsd.org
Cc:
Subject: named_chroot_autoupdate forgets protocols & services
X-Send-Pr-Version: 3.113
X-GNATS-Notify:

>Number:         121101
>Category:       conf
>Synopsis:       [patch] named(8): named_chroot_autoupdate forgets protocols & services
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    dougb
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Mon Feb 25 23:20:03 UTC 2008
>Closed-Date:    Fri Aug 01 06:13:29 UTC 2008
>Last-Modified:  Fri Aug  1 06:20:00 UTC 2008
>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:
Responsible-Changed-From-To: freebsd-bugs->freebsd-rc 
Responsible-Changed-By: gavin 
Responsible-Changed-When: Fri Feb 29 15:04:35 UTC 2008 
Responsible-Changed-Why:  
Over to -rc mailing list, although this may be more dougb's realm 

http://www.freebsd.org/cgi/query-pr.cgi?pr=121101 
State-Changed-From-To: open->analyzed 
State-Changed-By: dougb 
State-Changed-When: Thu Jul 31 19:27:33 UTC 2008 
State-Changed-Why:  

This looks reasonable, I'll have a go at an update soon. 


Responsible-Changed-From-To: freebsd-rc->dougb 
Responsible-Changed-By: dougb 
Responsible-Changed-When: Thu Jul 31 19:27:33 UTC 2008 
Responsible-Changed-Why:  

I generally handle named-related stuff. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=121101 
State-Changed-From-To: analyzed->closed 
State-Changed-By: dougb 
State-Changed-When: Fri Aug 1 06:12:13 UTC 2008 
State-Changed-Why:  

I committed this in r181114 with some small modifications. 

FYI, while WKS records are considered to be "historical," 
this issue is valid for SRV records, which is why I made 
the change. 

Thanks, 

Doug 

http://www.freebsd.org/cgi/query-pr.cgi?pr=121101 

From: dfilter@FreeBSD.ORG (dfilter service)
To: bug-followup@FreeBSD.org
Cc:  
Subject: Re: conf/121101: commit references a PR
Date: Fri,  1 Aug 2008 06:12:01 +0000 (UTC)

 dougb       2008-08-01 06:11:33 UTC
 
   FreeBSD src repository
 
   Modified files:
     etc/rc.d             named 
   Log:
   SVN rev 181114 on 2008-08-01 06:11:33Z by dougb
   
   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>
   
   Revision  Changes    Path
   1.28      +9 -5      src/etc/rc.d/named
 _______________________________________________
 cvs-all@freebsd.org mailing list
 http://lists.freebsd.org/mailman/listinfo/cvs-all
 To unsubscribe, send any mail to "cvs-all-unsubscribe@freebsd.org"
 
>Unformatted:
