diff options
author | seb <seb> | 2003-07-30 09:25:13 +0000 |
---|---|---|
committer | seb <seb> | 2003-07-30 09:25:13 +0000 |
commit | 421d0440d114b47254162a5034e6f56bb2bbdf64 (patch) | |
tree | 2c34b01a17eb07ea3dc32f85f88337698a6774dc /mk/bulk | |
parent | d5730aa80b76477fe8af946a8fb7eb3e05fddb8a (diff) | |
download | pkgsrc-421d0440d114b47254162a5034e6f56bb2bbdf64.tar.gz |
Rename sandboxDirs to sandboxMountDirs.
Introduce sandboxEmptyFiles a list of files to create empty in the
sandbox if they exist on the hosting system. Hence put /var/run in
sandboxEmptyDirs list.
Use $cppprog instead of cp.
Diffstat (limited to 'mk/bulk')
-rwxr-xr-x | mk/bulk/mksandbox | 26 |
1 files changed, 12 insertions, 14 deletions
diff --git a/mk/bulk/mksandbox b/mk/bulk/mksandbox index a368ee62cd9..0a0c1528b35 100755 --- a/mk/bulk/mksandbox +++ b/mk/bulk/mksandbox @@ -1,6 +1,6 @@ #! /bin/sh -# $NetBSD: mksandbox,v 1.22 2003/07/30 09:14:04 seb Exp $ +# $NetBSD: mksandbox,v 1.23 2003/07/30 09:25:13 seb Exp $ # # # Copyright (c) 2002 Alistair G. Crooks. All rights reserved. @@ -43,8 +43,9 @@ pkgsrc=/usr/pkgsrc src=/usr/src kernel="" -sandboxDirs="/bin /sbin /lib /libexec /usr/X11R6 /usr/bin /usr/games /usr/include /usr/lib /usr/libdata /usr/libexec /usr/lkm /usr/share /usr/sbin /var/mail" -sandboxEmptyDirs="/var/log /var/spool/mqueue" +sandboxMountDirs="/bin /sbin /lib /libexec /usr/X11R6 /usr/bin /usr/games /usr/include /usr/lib /usr/libdata /usr/libexec /usr/lkm /usr/share /usr/sbin /var/mail" +sandboxEmptyDirs="/var/run /var/log /var/spool/mqueue" +sandboxEmptyFiles="/var/run/utmp /var/run/utmpx /var/log/wtmp /var/log/wtmpx" opsys=`uname -s` case "$opsys" in @@ -100,7 +101,7 @@ SunOS) mountprog=/sbin/mount paxprog=/bin/pax sedprog=/usr/xpg4/bin/sed - sandboxDirs="/bin /sbin /kernel /lib /proc /usr/X11R6 /usr/bin /usr/ccs /usr/games /usr/include /usr/lib /usr/openwin /usr/share /usr/sbin /usr/ucb /usr/xpg4 /var/mail" + sandboxMountDirs="/bin /sbin /kernel /lib /proc /usr/X11R6 /usr/bin /usr/ccs /usr/games /usr/include /usr/lib /usr/openwin /usr/share /usr/sbin /usr/ucb /usr/xpg4 /var/mail" ;; *) echo "Unknown Operating System ($opsys) - good luck" @@ -198,7 +199,7 @@ rm -f $sandbox/etc/localtime $cpprog /usr/share/zoneinfo/GMT $sandbox/etc/localtime echo "Make empty dirs upon which to mount the null mounts" -for d in $sandboxDirs; do +for d in $sandboxMountDirs; do test -d $d || continue; $mkdirprog $sandbox$d; $mountprog $mountflags -r $d $sandbox$d; @@ -214,21 +215,18 @@ $mkdirprog $sandbox/var/games $chownprog games:games $sandbox/var/games $chmodprog 2775 $sandbox/var/games -echo "Making /var/run and /var/run/utmp(x) in $sandbox" -$mkdirprog $sandbox/var/run -if test -f /var/run/utmp; then - cp /dev/null $sandbox/var/run/utmp -fi -if test -f /var/run/utmpx; then - cp /dev/null $sandbox/var/run/utmpx -fi - for d in $sandboxEmptyDirs; do test -d $d || continue echo "Making $d in $sandbox" $mkdirprog $sandbox$d done +for f in $sandboxEmptyFiles; do + test -f $f || continue + echo "Making $f in $sandbox" + $cpprog /dev/null $sandbox$f +done + echo "Mount $src from $sandbox" $mkdirprog $sandbox/usr/src $mountprog $mountflags -r $src $sandbox/usr/src |