summaryrefslogtreecommitdiff
path: root/utils
diff options
context:
space:
mode:
authorRoland McGrath <roland@gnu.org>2002-05-12 21:14:15 +0000
committerRoland McGrath <roland@gnu.org>2002-05-12 21:14:15 +0000
commit3215a11a5c4e299378d7a807b27c9e75e2140715 (patch)
tree9c11f088e38c7af7ba195fc4e1da2daf29be4434 /utils
parent56533495a292c28490caca06a370f6eaff2cd7db (diff)
2002-05-12 Roland McGrath <roland@frob.com>
* fakeroot.sh: Inside the chroot'd fakeauth environment, run a shell that chdir's to what was our original current directory (by name) before exec'ing the user's command.
Diffstat (limited to 'utils')
-rw-r--r--utils/fakeroot.sh8
1 files changed, 7 insertions, 1 deletions
diff --git a/utils/fakeroot.sh b/utils/fakeroot.sh
index 48251704..cd0df7b0 100644
--- a/utils/fakeroot.sh
+++ b/utils/fakeroot.sh
@@ -54,4 +54,10 @@ if [ $# -eq 0 ]; then
set -- ${SHELL:-/bin/sh}
fi
-exec /bin/settrans --chroot /bin/fakeauth "$@" -- / /hurd/fakeroot
+# We exec settrans, which execs the "fakeauth" command in the chroot context.
+# The `pwd` is evaluated here and now, and that result interpreted inside
+# the shell running under fakeauth to chdir there inside the chroot world.
+# That shell then execs our arguments as a command line.
+exec /bin/settrans --chroot \
+ /bin/fakeauth /bin/sh -c "cd `pwd`; exec $*" \
+ -- / /hurd/fakeroot