From nobody@FreeBSD.org  Thu Aug 31 11:33:02 2006
Return-Path: <nobody@FreeBSD.org>
Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125])
	by hub.freebsd.org (Postfix) with ESMTP id 3F7FE16A4E5
	for <freebsd-gnats-submit@FreeBSD.org>; Thu, 31 Aug 2006 11:33:02 +0000 (UTC)
	(envelope-from nobody@FreeBSD.org)
Received: from www.freebsd.org (www.freebsd.org [216.136.204.117])
	by mx1.FreeBSD.org (Postfix) with ESMTP id 4B84A43D5F
	for <freebsd-gnats-submit@FreeBSD.org>; Thu, 31 Aug 2006 11:32:57 +0000 (GMT)
	(envelope-from nobody@FreeBSD.org)
Received: from www.freebsd.org (localhost [127.0.0.1])
	by www.freebsd.org (8.13.1/8.13.1) with ESMTP id k7VBWqsQ041007
	for <freebsd-gnats-submit@FreeBSD.org>; Thu, 31 Aug 2006 11:32:52 GMT
	(envelope-from nobody@www.freebsd.org)
Received: (from nobody@localhost)
	by www.freebsd.org (8.13.1/8.13.1/Submit) id k7VBWpb7041006;
	Thu, 31 Aug 2006 11:32:51 GMT
	(envelope-from nobody)
Message-Id: <200608311132.k7VBWpb7041006@www.freebsd.org>
Date: Thu, 31 Aug 2006 11:32:51 GMT
From: Attila Nagy <bra@fsn.hu>
To: freebsd-gnats-submit@FreeBSD.org
Subject: rc.initdiskless does not copy hidden files
X-Send-Pr-Version: www-2.3

>Number:         102724
>Category:       conf
>Synopsis:       rc.initdiskless does not copy hidden files
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    brooks
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          change-request
>Submitter-Id:   current-users
>Arrival-Date:   Thu Aug 31 11:40:27 GMT 2006
>Closed-Date:    Tue Jan 09 03:25:04 GMT 2007
>Last-Modified:  Tue Jan 09 03:25:04 GMT 2007
>Originator:     Attila Nagy
>Release:        FreeBSD 6-STABLE
>Organization:
FSN
>Environment:
6.1-STABLE #5: Tue Aug 29 16:06:59 CEST 2006
>Description:
In rc.initdiskless there is a loop, which iterates through the template directories and copies its content to the destination.

The command is
cp -Rp $j/* /$subdir
which obviously have problems with file names starting with a dot and maybe with other cases as well.
>How-To-Repeat:

>Fix:
Leaving the * from the end, cp will copy all files, and due to -R, a source with an ending / means the contents of the directory will be copied, instead of the directory itself.

--- /etc/rc.initdiskless        Tue Aug 29 15:14:44 2006
+++ rc.initdiskless     Thu Aug 31 13:06:53 2006
@@ -300,7 +300,7 @@
        subdir=${j##*/}
        if [ -d $j -a ! -f $j.cpio.gz  ]; then
            create_md $subdir
-           cp -Rp $j/* /$subdir
+           cp -Rp $j/ /$subdir
        fi
     done
     for j in /conf/$i/*.cpio.gz ; do

>Release-Note:
>Audit-Trail:
State-Changed-From-To: open->patched 
State-Changed-By: brooks 
State-Changed-When: Fri Sep 1 16:33:47 UTC 2006 
State-Changed-Why:  
Committed to HEAD.  Thanks! 


Responsible-Changed-From-To: freebsd-bugs->brooks 
Responsible-Changed-By: brooks 
Responsible-Changed-When: Fri Sep 1 16:33:47 UTC 2006 
Responsible-Changed-Why:  
Committed to HEAD.  Thanks! 

http://www.freebsd.org/cgi/query-pr.cgi?pr=102724 
State-Changed-From-To: patched->closed 
State-Changed-By: brooks 
State-Changed-When: Tue Jan 9 03:24:05 UTC 2007 
State-Changed-Why:  
Merged to RELENG_6 in rev 1.42.2.6 by luigi. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=102724 
>Unformatted:
