[Bug 1443] New: ipset -bash: syntax error near unexpected token `;;'

bugzilla-daemon at netfilter.org bugzilla-daemon at netfilter.org
Fri Jul 17 01:00:06 CEST 2020


https://bugzilla.netfilter.org/show_bug.cgi?id=1443

            Bug ID: 1443
           Summary: ipset -bash: syntax error near unexpected token `;;'
           Product: ipset
           Version: unspecified
          Hardware: x86_64
                OS: other
            Status: NEW
          Severity: minor
          Priority: P5
         Component: default
          Assignee: netfilter-buglog at lists.netfilter.org
          Reporter: vrein at tuta.io

- ipset version: ipset v7.6, protocol version: 7
- system: arch linux
- latest git repo has the same code too

There is an additional ; in bash completion script:
grep '_ipset_known_hosts()' -n ./ -R
./utils/ipset_bash_completion/ipset:975:eval '_ipset_known_hosts() { '$(declare
-f _known_hosts_real | grep -v __ltrim_colon_completions | grep -Ev
"^_known_hosts_real.*$" | grep -Ev "^(\{|\})")'; }'
                                                                               
                                                                               
                                                                               
                                                                               
                         ^ - here
Fist semicolon gets into from 
declare -f _known_hosts_real | grep -v __ltrim_colon_completions | grep -Ev
"^_known_hosts_real.*$" |  grep -Ev "^(\{|\})"
pipeline, and on 975 line there is second.

Arch Linux latest:
declare -f _known_hosts_real | grep -v __ltrim_colon_completions | grep -Ev
"^_known_hosts_real.*$" |  grep -Ev "^(\{|\})" | tail -n 5
        for i in "${!COMPREPLY[@]}";
        do
            [[ -n ${COMPREPLY[i]} ]] || unset -v COMPREPLY[i];
        done;
    fi;

Also can reproduce this on Ubuntu 18.04:
declare -f _known_hosts_real | grep -v __ltrim_colon_completions | grep -Ev
"^_known_hosts_real.*$" |  grep -Ev "^(\{|\})" | tail -n 5
        for i in ${!COMPREPLY[@]};
        do
            [[ -n ${COMPREPLY[i]} ]] || unset -v COMPREPLY[i];
        done;
    fi;

And on Ubuntu 20.04 additional semicolon (975 line) are already removed.


Ubuntu 16.04 return a little bit different result, so completion works without
errors.
declare -f _known_hosts_real | grep -v __ltrim_colon_completions | grep -Ev
"^_known_hosts_real.*$" | grep -Ev "^(\{|\})" | tail -n 5
    COMPREPLY+=($( compgen -W         "$( ruptime 2>/dev/null | awk
'!/^ruptime:/ { print $1 }' )"         -- "$cur" ));
    if [[ -n ${COMP_KNOWN_HOSTS_WITH_HOSTFILE-1} ]]; then
        COMPREPLY+=($( compgen -A hostname -P "$prefix$user" -S "$suffix" --
"$cur" ));
    fi;
    return 0

I understand that this is may not be scope of ipset developers, so should I
direct this issue to distro maintainers?

-- 
You are receiving this mail because:
You are watching all bug changes.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.netfilter.org/pipermail/netfilter-buglog/attachments/20200716/9fda6d7d/attachment.html>


More information about the netfilter-buglog mailing list