[Bash-completion-devel] [bash-completion-Bugs][314709] -? triggers failglob if left unquoted

bash-completion-bugs at alioth.debian.org bash-completion-bugs at alioth.debian.org
Tue Jun 10 13:22:36 UTC 2014


bash-completion-Bugs item #314709 was changed at 10/06/2014 15:22 by Dams Nadé
You can respond by visiting: 
https://alioth.debian.org/tracker/?func=detail&atid=413095&aid=314709&group_id=100114

Status: Closed
Priority: 3
Submitted By: Dams Nadé (anvil-guest)
Assigned to: Nobody (None)
Summary: -? triggers failglob if left unquoted 
Distribution: None
Originally reported in: None
Milestone: 2.0
Status: Fix Committed
Original bug number: 


Initial Comment:
Since '?' is a glob char, it needs to be quoted or an error will be triggered when using failglob.

The ssh-add/ssh-keygen completions are broken due to this issue.
See attached trivial patch.


----------------------------------------------------------------------

Comment By: Dams Nadé (anvil-guest)
Date: 10/06/2014 15:22

Message:
(this would of course require calling functions to honor this new signature. It should only concern asciidoc cvs koji ssh-add ssh-keygen sysbench valgrind )

----------------------------------------------------------------------

Comment By: Dams Nadé (anvil-guest)
Date: 10/06/2014 15:17

Message:
Hm, let's change the _parse_help signature, then ?

What about in _parse_help something like :
_parse_help()
{
    eval local cmd=$( quote "$1" )
    local line
    shift
    local -a help_params
    if [[ $# -ge 1 ]]
    then
        help_params=("$@")
    else
        help_params=(--help)
    fi
    { case $cmd in
            -) cat ;;
            *) LC_ALL=C "$( dequote "$cmd" )" "${help_params[@]}" 2>&1 ;;
      esac }....................

I really think relying on word-spliting is a bad bad thing


----------------------------------------------------------------------

Comment By: Igor Murzov (garik-guest)
Date: 10/06/2014 15:09

Message:
I have tried to fix the issue this way. But some completions pass multiple words as a help parameter. See completions/valgrind for example.

----------------------------------------------------------------------

Comment By: Dams Nadé (anvil-guest)
Date: 10/06/2014 08:29

Message:
Please consider reverting your change and applying this patch instead.

----------------------------------------------------------------------

Comment By: Dams Nadé (anvil-guest)
Date: 10/06/2014 08:24

Message:
If, this is not the way it should be fixed, IMHO. If it still fails, then the problem is in _parse_help.

----------------------------------------------------------------------

Comment By: Igor Murzov (garik-guest)
Date: 10/06/2014 00:52

Message:
I fixed the issue for me with https://alioth.debian.org/plugins/scmgit/cgi-bin/gitweb.cgi?p=bash-completion/bash-completion.git;a=commit;h=60b8fabec499dbd56636548369ff3796e0d0d0fd

----------------------------------------------------------------------

Comment By: Igor Murzov (garik-guest)
Date: 09/06/2014 23:33

Message:
The issue doesn't seem fixed for me.

----------------------------------------------------------------------

Comment By: Ville Skyttä  (scop-guest)
Date: 03/06/2014 22:15

Message:
Applied, thanks

----------------------------------------------------------------------

You can respond by visiting: 
https://alioth.debian.org/tracker/?func=detail&atid=413095&aid=314709&group_id=100114



More information about the Bash-completion-devel mailing list