From 2458f4064b63e251892bdad5a9c5d2e539def0c0 Mon Sep 17 00:00:00 2001 From: Sevinj Aghayeva Date: Sun, 17 Apr 2022 13:27:19 -0400 Subject: 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 --- mbuto | 18 ++++++++---------- 1 file 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}" -- cgit v1.2.3