misc/102724: rc.initdiskless does not copy hidden files

Attila Nagy bra at fsn.hu
Thu Aug 31 11:40:30 UTC 2006


>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:


More information about the freebsd-bugs mailing list