]> git.ipfire.org Git - thirdparty/util-linux.git/commitdiff
bash-completion: (unshare) remove embedded tabs from option strings
authorKarel Zak <kzak@redhat.com>
Thu, 19 Mar 2026 10:06:20 +0000 (11:06 +0100)
committerKarel Zak <kzak@redhat.com>
Thu, 19 Mar 2026 10:06:20 +0000 (11:06 +0100)
Line continuations in the option string assignments preserved the
leading tab (code indentation) from continuation lines, embedding
literal tab characters into the variable values. This broke regex
matching in the offset-detection loop for --mount-proc (OPTARGOPTS),
--map-groups (REQARGOPTS), and --map-subids (NOARGOPTS).

Addresses: https://github.com/util-linux/util-linux/pull/4084
Signed-off-by: Karel Zak <kzak@redhat.com>
bash-completion/unshare

index 75fe07eda175f812478fb7174a32630f98a35160..be026a9a5677ba41bb35050ebfeba5801688b2c6 100644 (file)
@@ -4,21 +4,17 @@ _unshare_module()
        local OPTS NOARGOPTS OPTARGOPTS REQARGOPTS REQARGOPTS_SHORT NOARGOPTS_SHORT
        _init_completion -n = -- "$@" || return
 
-       OPTARGOPTS="--mount=|--uts=|--ipc=|--net=|--pid=|--user=|--cgroup=|--time=|--kill-child=|\
-       --mount-proc=|--mount-binfmt="
+       OPTARGOPTS="--mount=|--uts=|--ipc=|--net=|--pid=|--user=|--cgroup=|--time=|--kill-child=|--mount-proc=|--mount-binfmt="
 
-       REQARGOPTS="--owner|--propagation|--setgroups|--root|--wd|--load-interp|--map-group|\
-       --map-groups|--map-user|--map-users|--monotonic|--boottime|--setuid|--setgid"
+       REQARGOPTS="--owner|--propagation|--setgroups|--root|--wd|--load-interp|--map-group|--map-groups|--map-user|--map-users|--monotonic|--boottime|--setuid|--setgid"
 
        REQARGOPTS_SHORT="-l|-R|-w|-S|-G"
 
-       NOARGOPTS="--fork|--forward-signals|--map-root-user|--map-current-user|--map-auto|\
-       --map-subids|--keep-caps|--help|--version|${OPTARGOPTS//=/}"
+       NOARGOPTS="--fork|--forward-signals|--map-root-user|--map-current-user|--map-auto|--map-subids|--keep-caps|--help|--version|${OPTARGOPTS//=/}"
 
        NOARGOPTS_SHORT="-r|-f|-c|-h|-V|-m|-u|-i|-n|-p|-U|-C|-T"
 
-       OPTS="${NOARGOPTS//[|]/ } ${NOARGOPTS_SHORT//[|]/ } ${OPTARGOPTS//[|]/ }\
-               ${REQARGOPTS//[|]/ } ${REQARGOPTS_SHORT//[|]/ }"
+       OPTS="${NOARGOPTS//[|]/ } ${NOARGOPTS_SHORT//[|]/ } ${OPTARGOPTS//[|]/ } ${REQARGOPTS//[|]/ } ${REQARGOPTS_SHORT//[|]/ }"
 
        # Check if we are still completing unshare(1) and set 
        # the offset so that it points to the command that is