ipset bash auto complete error on ubuntu 18.04
This bug report will be marked for expiration in 45 days if no further activity occurs. (find out why)
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
| ipset (Ubuntu) |
Low
|
Unassigned |
Bug Description
I have tested it on a brand new Ubuntu 18.04 amd64 system, then install the ipset package
when I type "ipset " and press tab to trigger bash auto completion,
it returns "-bash: syntax error near unexpected token `;;'".
ipset version: ipset v6.34, protocol version: 6
here is the full log, and I can see it fail when excuting eval _ipset_
+ local cur prev cword words ips_version
+ local str_action str_setname str_type str_filename
+ local str_glob str_regex str_prefix str_suffix
+ local str_tmp= str_var=
+ local str_timeout=timeout 'str_order=before after' str_forceadd=
+ local str_counters= str_bp_counters= str_comment= str_markmask=
+ local str_skbinfo= str_skbflags=
+ local -i i=x=y=0
+ local -i got_bashcompl=
+ local -i got_bp_proto=0
+ local -i ignore_
+ arr_sets=()
+ arr_types=()
+ arr_members=()
+ arr_unknown_opts=()
+ local arr_sets arr_types arr_members arr_unknown_opts
+ arr_dupe_
+ arr_used_opts=()
+ arr_tmp=()
+ local arr_dupe_cmd_opts arr_used_opts arr_tmp
+ arr_opts=("-! -exist" "-o -output" "-q -quiet" "-r -resolve" "-s -sorted" "-n -name" "-t -terse" "-f -file")
+ local arr_opts
+ arr_icmp_
+ local arr_icmp_types
+ arr_icmp6_
+ local arr_icmp6_types
+ (( 4 < 4 ))
+ COMPREPLY=()
++ ipset version
+ ips_version='ipset v6.34, protocol version: 6'
+ ips_version='6.34, protocol version: 6'
+ ips_version=6.34
+ read -a ips_version
+ [[ 6 = +([[:digit:]]) ]]
+ (( ips_version[0] < 6 ))
+ (( ips_version[0] > 6 ))
+ (( ips_version[0] == 6 ))
+ (( ips_version[1] >= 22 ))
+ str_comment=comment
+ str_markmask=
+ str_forceadd=
+ str_skbinfo=skbinfo
+ str_skbflags=
+ got_bp_proto=1
+ declare -f _get_comp_
+ got_bashcompl=1
+ _get_comp_
+ local exclude flag i OPTIND=1
+ words=()
+ local cur cword words
+ upargs=()
+ upvars=()
+ local upargs upvars vcur vcword vprev vwords
+ getopts c:i:n:p:w: flag -n : cur prev cword words
+ case $flag in
+ exclude=:
+ getopts c:i:n:p:w: flag -n : cur prev cword words
+ [[ 6 -ge 3 ]]
+ case ${!OPTIND} in
+ vcur=cur
+ let 'OPTIND += 1'
+ [[ 6 -ge 4 ]]
+ case ${!OPTIND} in
+ vprev=prev
+ let 'OPTIND += 1'
+ [[ 6 -ge 5 ]]
+ case ${!OPTIND} in
+ vcword=cword
+ let 'OPTIND += 1'
+ [[ 6 -ge 6 ]]
+ case ${!OPTIND} in
+ vwords=words
+ let 'OPTIND += 1'
+ [[ 6 -ge 7 ]]
+ __get_cword_
+ words=()
+ local cword words
+ __reassemble_
+ local exclude i j line ref
+ [[ -n : ]]
+ exclude=:
+ printf -v cword %s 1
+ [[ -n : ]]
+ line='ipset '
+ (( i=0, j=0 ))
+ (( i < 2 ))
+ [[ 0 -gt 0 ]]
+ ref='words[0]'
+ printf -v 'words[0]' %s ipset
+ line=' '
+ [[ 0 == 1 ]]
+ (( i++, j++ ))
+ (( i < 2 ))
+ [[ 1 -gt 0 ]]
+ [[ '' == +([:]) ]]
+ ref='words[1]'
+ printf -v 'words[1]' %s ''
+ line=' '
+ [[ 1 == 1 ]]
+ printf -v cword %s 1
+ (( i++, j++ ))
+ (( i < 2 ))
+ [[ 2 == 1 ]]
+ local i cur index=6 'lead=ipset '
+ [[ 6 -gt 0 ]]
+ [[ -n ipset ]]
+ [[ -n ipset ]]
+ cur='ipset '
+ (( i = 0 ))
+ (( i <= cword ))
+ [[ 6 -ge 5 ]]
+ [[ ipset != \i\p\s\e\t ]]
+ [[ 0 -lt 1 ]]
+ local old_size=6
+ cur=' '
+ local new_size=1
+ index=1
+ (( ++i ))
+ (( i <= cword ))
+ [[ 1 -ge 0 ]]
+ [[ '' != '' ]]
+ [[ 1 -lt 1 ]]
+ (( ++i ))
+ (( i <= cword ))
+ [[ -n ]]
+ [[ ! -n '' ]]
+ cur=
+ [[ 1 -lt 0 ]]
+ local words cword cur
+ _upvars -a2 words ipset '' -v cword 1 -v cur ''
+ (( 10 ))
+ (( 10 ))
+ case $1 in
+ [[ -n 2 ]]
+ printf %d 2
+ [[ -n words ]]
+ unset -v words
+ eval 'words=
++ words=("${@:3:2}")
+ shift 4
+ (( 6 ))
+ case $1 in
+ [[ -n cword ]]
+ unset -v cword
+ eval 'cword="$3"'
++ cword=1
+ shift 3
+ (( 3 ))
+ case $1 in
+ [[ -n cur ]]
+ unset -v cur
+ eval 'cur="$3"'
++ cur=
+ shift 3
+ (( 0 ))
+ [[ -n cur ]]
+ upvars+=("$vcur")
+ upargs+=(-v $vcur "$cur")
+ [[ -n cword ]]
+ upvars+=("$vcword")
+ upargs+=(-v $vcword "$cword")
+ [[ -n prev ]]
+ [[ 1 -ge 1 ]]
+ upvars+=("$vprev")
+ upargs+=(-v $vprev "${words[cword - 1]}")
+ [[ -n words ]]
+ upvars+=("$vwords")
+ upargs+
+ (( 4 ))
+ local cur cword prev words
+ _upvars -v cur '' -v cword 1 -v prev ipset -a2 words ipset ''
+ (( 13 ))
+ (( 13 ))
+ case $1 in
+ [[ -n cur ]]
+ unset -v cur
+ eval 'cur="$3"'
++ cur=
+ shift 3
+ (( 10 ))
+ case $1 in
+ [[ -n cword ]]
+ unset -v cword
+ eval 'cword="$3"'
++ cword=1
+ shift 3
+ (( 7 ))
+ case $1 in
+ [[ -n prev ]]
+ unset -v prev
+ eval 'prev="$3"'
++ prev=ipset
+ shift 3
+ (( 4 ))
+ case $1 in
+ [[ -n 2 ]]
+ printf %d 2
+ [[ -n words ]]
+ unset -v words
+ eval 'words=
++ words=("${@:3:2}")
+ shift 4
+ (( 0 ))
+ (( got_bashcompl ))
+ declare -F _ipset_known_hosts
++ grep --color=auto -Ev '^(\{|\})'
++ grep --color=auto -Ev '^_known_
++ grep --color=auto -v __ltrim_
++ declare -f _known_hosts_real
+ eval '_ipset_
-bash: syntax error near unexpected token `;;'
+ [[ -n '' ]]
+ (( i=1 ))
+ (( i < 2-1 ))
+ [[ -n '' ]]
+ (( names_only && headers_only ))
+ (( names_only || headers_only ))
+ (( ignore_errors ))
+ [[ '' == \$\(* ]]
+ [[ '' == \$\{* ]]
+ [[ '' == \$* ]]
+ case "$prev" in
+ (( got_action ))
+ [[ ipset = - ]]
+ [[ '' = -* ]]
+ (( save_format || names_only || headers_only ))
+ (( res_sort ))
+ (( ignore_errors && use_file ))
+ (( ignore_errors ))
+ (( use_file ))
+ COMPREPLY=($( compgen -W 'create n add del test destroy x list save \
restore flush rename e swap w help version' -- "$cur" ))
++ compgen -W 'create n add del test destroy x list save \
restore flush rename e swap w help version' -- ''
+ [[ -n '' ]]
information type: | Public → Public Security |
information type: | Public Security → Public |
Sebastien Bacher (seb128) wrote : | #1 |
Changed in ipset (Ubuntu): | |
importance: | Undecided → Low |
status: | New → Incomplete |
ChengChung (chengchung) wrote : | #2 |
there is no such ~/.ssh/known_hosts file exist.
I also try to create an empty one or copy a file with the same name from a 16.04 system, both turn to the same error message as above.
BTW, I find the log from 16.04 doesn't excute the code eval _ipset_known_hosts when trigger the auto completion
the log is like this https:/
Changed in ipset (Ubuntu): | |
status: | Incomplete → New |
ChengChung (chengchung) wrote : | #3 |
I have compared the auto-complete file in ubuntu 18.04 package with the one in debian package
and find the difference is only a semicolon
:~/ipset/
975c975
< eval '_ipset_
---
> eval '_ipset_
replace the file of debian version works wekk for me.
Launchpad Janitor (janitor) wrote : | #4 |
Status changed to 'Confirmed' because the bug affects multiple users.
Changed in ipset (Ubuntu): | |
status: | New → Confirmed |
Sebastien Bacher (seb128) wrote : | #5 |
It doesn't make much sense, that ";" is in the bionic .deb (https:/
Could you give the output of those commands
- dpkg -l | grep ipset
- debsums ipset (you might need to install the debsums deb first)
ChengChung (chengchung) wrote : | #6 |
dpkg -l | grep ipset
ii ipset 6.34-1 amd64 administration tool for kernel IP sets
ii libipset3:amd64 6.34-1 amd64 library for IP sets
debsums ipset
/sbin/ipset OK
/usr/share/
/usr/share/
/usr/share/
/usr/share/
/usr/share/
Sebastien Bacher (seb128) wrote : | #7 |
Is that with the Debian version of the file in place? Can you attach /usr/share/
It looks like maybe you had a local edit/corruption and it's resolved now?
ChengChung (chengchung) wrote : | #8 |
the result I post before is the version from ubuntu package
if replaced with debian version, the result of debsums ipset is
...
/usr/share/
...
the debian version can fix my problem.
ChengChung (chengchung) wrote : | #9 |
I only replace the file for completion, and didn't change any other files on disk.
Oibaf (oibaf) wrote : | #10 |
It works for me on a recent Ubuntu version, if you are still experiencing it with Ubuntu 20.04 or later please let us know.
Thanks
Changed in ipset (Ubuntu): | |
status: | Confirmed → Incomplete |
Thank you for you bug report, it seems likely to have to do with the content of ~/.ssh/known_hosts , does it stop if you move that file away? If so could you try to figure what line is creating the issue and share it (or at least describe what it looks like even if you replace names/keys)