misc/173483: NanoBSD initialises /cfg incorrectly (wrong permissions)

Nick Hibma nick at anywi.com
Thu Nov 8 20:30:01 UTC 2012

>Number:         173483
>Category:       misc
>Synopsis:       NanoBSD initialises /cfg incorrectly (wrong permissions)
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-bugs
>State:          open
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Thu Nov 08 20:30:01 UTC 2012
>Originator:     Nick Hibma
>Release:        8.3-RELEASE
AnyWi Technologies
System: FreeBSD bitske2.localdomain 8.3-RELEASE FreeBSD 8.3-RELEASE #0 r242660: Tue Nov 6 16:23:23 CET 2012 root at bitske2.localdomain:/usr/obj/usr/src/sys/GENERIC i386
/cfg is initialised from /var/empty in NANO_CFGDIR is unset. This also copies
the 0555 permissions from this dir to /cfg.
Build an image using NanoBSD with NANO_CFGDIR="" .
Index: nanobsd.sh
--- nanobsd.sh	(revision 12226)
+++ nanobsd.sh	(working copy)
@@ -413,12 +413,13 @@
-	test -z $2 && dir=${NANO_WORLDDIR}/var/empty
-	test -d $dir || dir=${NANO_WORLDDIR}/var/empty
-	echo "Creating ${dev} with ${dir} (mounting on ${mnt})"
-	newfs_part $dev $mnt $lbl
-	cd ${dir}
-	find . -print | grep -Ev '/(CVS|\.svn)' | cpio -dumpv ${mnt}
+	echo "Creating ${dev} (mounting on ${mnt})"
+	newfs_part ${dev} ${mnt} ${lbl}
+	if [ -n "${dir}" -a -d "${dir}" ]; then
+		echo "Populating ${lbl} from ${dir}"
+		cd ${dir}
+		find . -print | grep -Ev '/(CVS|\.svn)' | cpio -dumpv ${mnt}
+	fi
 	df -i ${mnt}
 	umount ${mnt}


More information about the freebsd-bugs mailing list