summaryrefslogtreecommitdiff
path: root/mk
diff options
context:
space:
mode:
authorseb <seb@pkgsrc.org>2003-07-29 20:31:05 +0000
committerseb <seb@pkgsrc.org>2003-07-29 20:31:05 +0000
commitac47c58a83a405e6250649a0046afacd312a052f (patch)
tree35f922888de5473d6c289c1e2ff470d184e5f1cc /mk
parent3f203cfe95d8acf5c7cee3d16bee1a8889f0886b (diff)
downloadpkgsrc-ac47c58a83a405e6250649a0046afacd312a052f.tar.gz
Introduce sandboxEmptyDirs a list of directories to create empty
in the sandbox if they exist on the hosting system: put /var/spool/mqueue as it was already created before and add /var/log for now (needed for various packages, like security/ssh2). Only create /var/run/utmp(x) if they exist on the hosting system. XXX this may better be an opsys dependent action.
Diffstat (limited to 'mk')
-rwxr-xr-xmk/bulk/mksandbox19
1 files changed, 14 insertions, 5 deletions
diff --git a/mk/bulk/mksandbox b/mk/bulk/mksandbox
index c77cd78a815..33e955dce97 100755
--- a/mk/bulk/mksandbox
+++ b/mk/bulk/mksandbox
@@ -1,6 +1,6 @@
#! /bin/sh
-# $NetBSD: mksandbox,v 1.20 2003/05/06 17:42:03 jmmv Exp $
+# $NetBSD: mksandbox,v 1.21 2003/07/29 20:31:05 seb Exp $
#
#
# Copyright (c) 2002 Alistair G. Crooks. All rights reserved.
@@ -45,6 +45,8 @@ 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"
+
opsys=`uname -s`
case "$opsys" in
Darwin)
@@ -215,11 +217,18 @@ $chmodprog 2775 $sandbox/var/games
echo "Making /var/run and /var/run/utmp(x) in $sandbox"
$mkdirprog $sandbox/var/run
-cp /dev/null $sandbox/var/run/utmp
-cp /dev/null $sandbox/var/run/utmpx
+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
-echo "Making /var/spool/mqueue in $sandbox"
-$mkdirprog $sandbox/var/spool/mqueue
+for d in $sandboxEmptyDirs; do
+ test -d $d || continue
+ echo "Making $d in $sandbox"
+ $mkdirprog $sandbox$d
+done
echo "Mount $src from $sandbox"
$mkdirprog $sandbox/usr/src