Date: Thu, 31 Aug 2006 11:32:51 GMT From: Attila Nagy <bra@fsn.hu> To: freebsd-gnats-submit@FreeBSD.org Subject: misc/102724: rc.initdiskless does not copy hidden files Message-ID: <200608311132.k7VBWpb7041006@www.freebsd.org> Resent-Message-ID: <200608311140.k7VBeSvl032284@freefall.freebsd.org>
next in thread | raw e-mail | index | archive | help
>Number: 102724
>Category: misc
>Synopsis: rc.initdiskless does not copy hidden files
>Confidential: no
>Severity: non-critical
>Priority: low
>Responsible: freebsd-bugs
>State: open
>Quarter:
>Keywords:
>Date-Required:
>Class: change-request
>Submitter-Id: current-users
>Arrival-Date: Thu Aug 31 11:40:27 GMT 2006
>Closed-Date:
>Last-Modified:
>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:
>Unformatted:
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200608311132.k7VBWpb7041006>
