From nobody@FreeBSD.org  Sun Jul  2 19:57:29 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 988AF16A40F
	for <freebsd-gnats-submit@FreeBSD.org>; Sun,  2 Jul 2006 19:57:29 +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 4C120446E1
	for <freebsd-gnats-submit@FreeBSD.org>; Sun,  2 Jul 2006 19:57:29 +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 k62JvSeW093321
	for <freebsd-gnats-submit@FreeBSD.org>; Sun, 2 Jul 2006 19:57:28 GMT
	(envelope-from nobody@www.freebsd.org)
Received: (from nobody@localhost)
	by www.freebsd.org (8.13.1/8.13.1/Submit) id k62JvSHr093300;
	Sun, 2 Jul 2006 19:57:28 GMT
	(envelope-from nobody)
Message-Id: <200607021957.k62JvSHr093300@www.freebsd.org>
Date: Sun, 2 Jul 2006 19:57:28 GMT
From: Florian Zavatzki <f_zavatzki@blue-network.org>
To: freebsd-gnats-submit@FreeBSD.org
Subject: [patch] /etc/rc.initdiskless problem copy dotfile in subdirectories to the MFS filesystem
X-Send-Pr-Version: www-2.3

>Number:         99721
>Category:       conf
>Synopsis:       [patch] /etc/rc.initdiskless problem copy dotfile in subdirectories to the MFS filesystem
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    crees
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Sun Jul 02 20:00:34 GMT 2006
>Closed-Date:    Sat Dec 01 15:59:56 UTC 2012
>Last-Modified:  Sat Dec 01 15:59:56 UTC 2012
>Originator:     Florian Zavatzki
>Release:        FreeBSD 6.1-RC
>Organization:
>Environment:
FreeBSD sol.blue-network.local 6.1-RC FreeBSD 6.1-RC #0: Thu Apr 13 20:17:20 CEST 2006     bc@sol.blue-network.local:/usr/obj/usr/src/sys/SOL-6-20060413  i386
>Description:
There is a problem with dot files or directories when a subdirectory template is directly copied to the MFS filesystem.
A file /conf/$ip/root/.foobar will not be copied, because the expression in line 303 cp -Rp $j/* /$subdir will only copy non dot files.


>How-To-Repeat:
Create a dot file in /conf/$ip/root (for example .foobar) and start a diskless client. There would be a MFS filesystem mounted on /root, but without .foobar.
>Fix:
Adding a simple cp -Rp $j/.* will result in a copy of the whole parent directory. So the easiest way would be to replace the copy with a tar command.

--- /etc/rc.initdiskless        Sun Jul  2 21:17:03 2006
+++ rc.initdiskless     Sun Jul  2 21:43:32 2006
@@ -300,7 +300,7 @@
        subdir=${j##*/}
        if [ -d $j -a ! -f $j.cpio.gz  ]; then
            create_md $subdir
-           cp -Rp $j/* /$subdir
+           (cd $j; tar -cf - . | (cd /$subdir; tar -xpBf -))
        fi
     done
     for j in /conf/$i/*.cpio.gz ; do

>Release-Note:
>Audit-Trail:
Responsible-Changed-From-To: freebsd-bugs->freebsd-rc 
Responsible-Changed-By: linimon 
Responsible-Changed-When: Sun Jul 2 20:03:38 UTC 2006 
Responsible-Changed-Why:  
Over to maintainer(s). 

http://www.freebsd.org/cgi/query-pr.cgi?pr=99721 
State-Changed-From-To: open->feedback 
State-Changed-By: crees 
State-Changed-When: Wed Oct 31 10:32:10 UTC 2012 
State-Changed-Why:  
Thank you-- my suggested fix is to use pax which doesn't execute two 
programs where one would do. 
http://www.bayofrum.net/~crees/patches/99721.diff  Thoughts? 

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

From: Chris Rees <crees@FreeBSD.org>
To: bug-followup@freebsd.org
Cc:  
Subject: Re: conf/99721: [patch] /etc/rc.initdiskless problem copy dotfile in
 subdirectories to the MFS filesystem
Date: Wed, 31 Oct 2012 17:57:33 +0000

 On 31 October 2012 12:25, Florian Zavatzki <florian@zavatzki.name> wrote:
 > On 10/31/2012 11:32 AM, crees@FreeBSD.org wrote:
 >> Thank you-- my suggested fix is to use pax which doesn't execute two
 >> programs where one would do.
 >> http://www.bayofrum.net/~crees/patches/99721.diff  Thoughts?
 >
 > Looks good. But I'm not using any diskless clients at the moment, so I
 > can't test it.
 
 If you tested the tar version and it worked, this version is
 identical, as I have tested that :)
 
 Chris

From: Chris Rees <crees@FreeBSD.org>
To: bug-followup@freebsd.org
Cc:  
Subject: Re: conf/99721: [patch] /etc/rc.initdiskless problem copy dotfile in
 subdirectories to the MFS filesystem
Date: Wed, 31 Oct 2012 17:56:46 +0000

 ---------- Forwarded message ----------
 From: Florian Zavatzki <florian@zavatzki.name>
 Date: 31 October 2012 12:25
 
 Looks good. But I'm not using any diskless clients at the moment, so I
 can't test it.
 
 Bye,
 Florian

From: Hiroki Sato <hrs@FreeBSD.org>
To: crees@FreeBSD.org
Cc: f_zavatzki@blue-network.org, freebsd-rc@FreeBSD.org,
        bug-followup@FreeBSD.org
Subject: Re: conf/99721: [patch] /etc/rc.initdiskless problem copy dotfile
 in subdirectories to the MFS filesystem
Date: Sun, 18 Nov 2012 08:05:23 +0900 (JST)

 ----Security_Multipart(Sun_Nov_18_08_05_23_2012_954)--
 Content-Type: Text/Plain; charset=us-ascii
 Content-Transfer-Encoding: 7bit
 
 crees@freebsd.org wrote
   in <201210311032.q9VAWALi013151@freefall.freebsd.org>:
 
 cr> Synopsis: [patch] /etc/rc.initdiskless problem copy dotfile in subdirectories to the MFS filesystem
 cr>
 cr> State-Changed-From-To: open->feedback
 cr> State-Changed-By: crees
 cr> State-Changed-When: Wed Oct 31 10:32:10 UTC 2012
 cr> State-Changed-Why:
 cr> Thank you-- my suggested fix is to use pax which doesn't execute two
 cr> programs where one would do.
 cr> http://www.bayofrum.net/~crees/patches/99721.diff  Thoughts?
 
  I have tested the patch and worked fine.  Please commit it.
 
 -- Hiroki
 
 ----Security_Multipart(Sun_Nov_18_08_05_23_2012_954)--
 Content-Type: application/pgp-signature
 Content-Transfer-Encoding: 7bit
 
 -----BEGIN PGP SIGNATURE-----
 Version: GnuPG v1.4.11 (FreeBSD)
 
 iEYEABECAAYFAlCoGDQACgkQTyzT2CeTzy0tEACgkr/8uyUxN0c+rtHY/HH8ly44
 oqEAnjIHRk+dwf+VzE3ecygIb1KHUjUu
 =udiq
 -----END PGP SIGNATURE-----
 
 ----Security_Multipart(Sun_Nov_18_08_05_23_2012_954)----
State-Changed-From-To: feedback->patched 
State-Changed-By: crees 
State-Changed-When: Sun Nov 18 14:21:26 UTC 2012 
State-Changed-Why:  
Committed to head, thanks! 


Responsible-Changed-From-To: freebsd-rc->crees 
Responsible-Changed-By: crees 
Responsible-Changed-When: Sun Nov 18 14:21:26 UTC 2012 
Responsible-Changed-Why:  
Committed by me 

http://www.freebsd.org/cgi/query-pr.cgi?pr=99721 
State-Changed-From-To: patched->closed 
State-Changed-By: crees 
State-Changed-When: Sat Dec 1 15:59:54 UTC 2012 
State-Changed-Why:  
The patch caused several problems and was reverted, but the code no 
longer actually had this problem. 

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