aboutgitcode
path: root/mbuto
diff options
context:
space:
mode:
authorSevinj Aghayeva <sevinj.aghayeva@gmail.com>2022-04-17 13:27:19 -0400
committerStefano Brivio <sbrivio@redhat.com>2022-04-21 16:40:29 +0200
commit2458f4064b63e251892bdad5a9c5d2e539def0c0 (patch)
tree72bb644ab303017cc286aa96d9b8b14adee46cdf /mbuto
parentab0a2ac9c36854d3e9ebdbace5ccddc45029f839 (diff)
downloadmbuto-2458f4064b63e251892bdad5a9c5d2e539def0c0.tar
mbuto-2458f4064b63e251892bdad5a9c5d2e539def0c0.tar.gz
mbuto-2458f4064b63e251892bdad5a9c5d2e539def0c0.tar.bz2
mbuto-2458f4064b63e251892bdad5a9c5d2e539def0c0.tar.lz
mbuto-2458f4064b63e251892bdad5a9c5d2e539def0c0.tar.xz
mbuto-2458f4064b63e251892bdad5a9c5d2e539def0c0.tar.zst
mbuto-2458f4064b63e251892bdad5a9c5d2e539def0c0.zip
mbuto: undo commit 6199e368
Commit 6199e368 moves argument parsing before checking fakeroot and saves the arguments in ARGS variable. Unfortunately, passing ARGS to the recursive call flattens and removes quotes, which disables passing multiple arguments to suboptions, as in -C "net proc". For now we undo this commit to enable multiple argument passing to suboptions. Signed-off-by: Sevinj Aghayeva <sevinj.aghayeva@gmail.com>
Diffstat (limited to 'mbuto')
-rwxr-xr-xmbuto18
1 files changed, 8 insertions, 10 deletions
diff --git a/mbuto b/mbuto
index 4565a19..44b9a56 100755
--- a/mbuto
+++ b/mbuto
@@ -1159,7 +1159,14 @@ usage() {
################################################################################
-ARGS=${@}
+# If we're not running as root, re-run with fakeroot
+if [ "${LD_PRELOAD}" != "libfakeroot-sysv.so" ] && [ "$(id -u)" -ne 0 ]; then
+ if ! FAKEROOT="$(command -v fakeroot)"; then
+ err "Not root and no fakeroot available, exiting"
+ fi
+ PATH="${PATH}:/sbin:/usr/sbin" "${FAKEROOT}" "${0}" "${@}"
+ exit ${?}
+fi
# Parse options
while getopts :c:df:k:m:p:s:vh __opt; do
@@ -1182,15 +1189,6 @@ done
shift $((OPTIND - 1))
[ -z "${PROFILE}" ] && PROFILE="base"
-# If we're not running as root, re-run with fakeroot
-if [ "${LD_PRELOAD}" != "libfakeroot-sysv.so" ] && [ "$(id -u)" -ne 0 ]; then
- if ! FAKEROOT="$(command -v fakeroot)"; then
- err "Not root and no fakeroot available, exiting"
- fi
- PATH="${PATH}:/sbin:/usr/sbin" "${FAKEROOT}" "${0}" ${ARGS}
- exit ${?}
-fi
-
# Check needed tools, exit if any is missing
for __l in ${TOOLS}; do
cmd_check "${__l}"