conf/99721: [patch] /etc/rc.initdiskless problem copy dotfile in
subdirectories to the MFS filesystem
Florian Zavatzki
f_zavatzki at blue-network.org
Sun Jul 2 20:00:36 UTC 2006
>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: freebsd-bugs
>State: open
>Quarter:
>Keywords:
>Date-Required:
>Class: sw-bug
>Submitter-Id: current-users
>Arrival-Date: Sun Jul 02 20:00:34 GMT 2006
>Closed-Date:
>Last-Modified:
>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 at 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:
>Unformatted:
More information about the freebsd-bugs
mailing list