summaryrefslogtreecommitdiff
path: root/utils
diff options
context:
space:
mode:
Diffstat (limited to 'utils')
-rw-r--r--utils/remap.sh8
1 files changed, 7 insertions, 1 deletions
diff --git a/utils/remap.sh b/utils/remap.sh
index d7997591..064f0f5f 100644
--- a/utils/remap.sh
+++ b/utils/remap.sh
@@ -57,10 +57,16 @@ if [ $# -eq 0 ]; then
set -- ${SHELL:-/bin/sh}
fi
+TARGET=
+until [ $# -eq 0 ]; do
+ TARGET="${TARGET} '$(echo "$1" | sed -e "s/'/'\\\\''/g")'"
+ shift
+done
+
# 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/sh -c "cd `pwd`; $*" \
+ /bin/sh -c "cd `pwd`; exec ${TARGET}" \
-- / /hurd/remap $MAPPED