[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[hurd] 18/53: Fix fakeroot and remap parsing corner cases
From: |
Samuel Thibault |
Subject: |
[hurd] 18/53: Fix fakeroot and remap parsing corner cases |
Date: |
Thu, 20 Mar 2014 02:23:50 +0000 |
This is an automated email from the git hooks/post-receive script.
sthibault pushed a commit to branch upstream
in repository hurd.
commit 139cc36c4f24dbc8c759f6bc3fba536698db6e03
Author: Samuel Thibault <address@hidden>
Date: Tue Feb 25 01:48:14 2014 -0500
Fix fakeroot and remap parsing corner cases
Fix case when $PWD contains spaces.
Pass directly arguments to command, to directly avoid escaping issues.
Based on suggestion by Ivan Shmakov <address@hidden>
* utils/fakeroot.sh (TARGET): Do not define.
(sh): Rather pass PWD and commandline as parameters.
* utils/remap.sh: Likewise.
---
utils/fakeroot.sh | 10 +++-------
utils/remap.sh | 9 ++-------
2 files changed, 5 insertions(+), 14 deletions(-)
diff --git a/utils/fakeroot.sh b/utils/fakeroot.sh
index a64e963..6993365 100644
--- a/utils/fakeroot.sh
+++ b/utils/fakeroot.sh
@@ -54,16 +54,12 @@ 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/fakeauth /bin/sh -c "cd `pwd`; exec ${TARGET}" \
+ /bin/fakeauth \
+ /bin/sh -c 'cd "$1" || exit ; shift ; exec "$@"' \
+ "$1" "$PWD" "$@" \
-- / /hurd/fakeroot
diff --git a/utils/remap.sh b/utils/remap.sh
index 064f0f5..f24ed0e 100644
--- a/utils/remap.sh
+++ b/utils/remap.sh
@@ -57,16 +57,11 @@ 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`; exec ${TARGET}" \
+ /bin/sh -c 'cd "$1" || exit ; shift ; exec "$@"' \
+ "$1" "$PWD" "$@" \
-- / /hurd/remap $MAPPED
--
Alioth's /usr/local/bin/git-commit-notice on
/srv/git.debian.org/git/pkg-hurd/hurd.git
- [hurd] 10/53: Add missing copyright notice, (continued)
- [hurd] 10/53: Add missing copyright notice, Samuel Thibault, 2014/03/19
- [hurd] 06/53: Fix typos, Samuel Thibault, 2014/03/19
- [hurd] 19/53: utils/umount: do not remove passive translator records, Samuel Thibault, 2014/03/19
- [hurd] 16/53: pfinet: set a non-zero ports management timeout, Samuel Thibault, 2014/03/19
- [hurd] 14/53: libstore: fixed some pointer-sign related warnings, Samuel Thibault, 2014/03/19
- [hurd] 22/53: mach-defpager: add function mig_reply_setup, Samuel Thibault, 2014/03/19
- [hurd] 17/53: exec: provide a meaningful name for new tasks, Samuel Thibault, 2014/03/19
- [hurd] 20/53: libpager: improve the pager_demuxer function, Samuel Thibault, 2014/03/19
- [hurd] 21/53: mach-defpager: fix definition of seqnos_memory_object_data_unlock, Samuel Thibault, 2014/03/19
- [hurd] 23/53: mach-defpager: improve the default_pager_demux_object function, Samuel Thibault, 2014/03/19
- [hurd] 18/53: Fix fakeroot and remap parsing corner cases,
Samuel Thibault <=
- [hurd] 15/53: libports: work around bugs in server termination, Samuel Thibault, 2014/03/19
- [hurd] 27/53: tmpfs: set diskfs_disk_name to "none", Samuel Thibault, 2014/03/19
- [hurd] 25/53: nfs: implement netfs_get_source, Samuel Thibault, 2014/03/19
- [hurd] 26/53: trans/mtab: ignore translators that do not implement file_get_source, Samuel Thibault, 2014/03/19
- [hurd] 08/53: Add --font-width option to force 8/9 pixel font width, Samuel Thibault, 2014/03/19
- [hurd] 36/53: term: fix receiver lookups in the tioctl server functions, Samuel Thibault, 2014/03/19
- [hurd] 29/53: New RPCs, fix build, Samuel Thibault, 2014/03/19
- [hurd] 24/53: hurd: fix the get-children and get-source procedures, Samuel Thibault, 2014/03/19
- [hurd] 12/53: libstore: replaced gz decompression code with libz, Samuel Thibault, 2014/03/19
- [hurd] 02/53: Replaced bz2 decompression code with libbz2, Samuel Thibault, 2014/03/19