[Bash-completion-devel] Bug#586695: Please stop the network completion insanity

Barak A. Pearlmutter barak at cs.nuim.ie
Tue Nov 16 12:48:48 UTC 2010


I'd like to put in my two cents on this issue: I find the current
behaviour slow and also somewhat annoying, and would urge this bug be
addressed.  In fact, I think it is serious enough for a fix to get
through the freeze and into squeeze.

My logic follows.

The remote-machine completion (a) is excruciating slow most of the
time, and (b) interferes with completion of local filenames which is
what I pushed <TAB> for about 99% of the time.

Unless there is some way to set a 500ms timeout on the network part of
the rsync completion, I would urge a change to the package to have
rsync complete local filenames only: no local hostname completion, no
remote filename completion.  Maybe there could be an easy-to-set flag
to turn on remote completion, for those who so desire.  (Remote
filename completion after the colon has been typed would be sort-of
okay, but even that is a bit slow and really should have a stringent
timeout mechanism.  And is also not always what I want: typically I
construct a remote target filename out of bits and pieces of local
filenames, and would in fact find local completion more useful even
when typing a string that will be used as a remote filename.)

It is also interesting to note that the current remote completion
policy is a potential security problem, as it can cause ssh to make
credential-passing connections to remote hosts without the user
knowing about it.  This leaks information about what the user has
typed, complete with typos, via both DNS and, when hostnames resolve,
unsuccessful SSH connection attempts.  It also allows denial of
service attacks, by disrupting the above mechanisms.

The current completion also often gets things plain wrong, as in:

    $ rsync --rsh=s<TAB>
    scriptng.local:      sonja-laptop.local:  source5ng.local:     

Here my shell freezes for an excruciatingly long time

    $ rsync --rsh= <TAB>
    [[[ SEVEN SECOND DELAY GOES HERE ]]]
    $ rsync --rsh= <TAB><TAB>
    [[[ FIFTEEN SECOND DELAY GOES HERE ]]]
    ::1:                          hmm.ps                        online-freq.tex 
    arrakis.local:                hmm.tex                       pandora.local:
    buket-laptop.local:           ip6-allnodes:                 piggy.local:
    civilian-implications.local:  ip6-allrouters:               port-kdr:
    corti.local:                  ip6-localhost:                port-kdr.hamilton.local:
    CVS/                          ip6-localnet:                 port-kdr.local:
    fe00::0:                      ip6-loopback:                 PRIZE-WINNING-TEXT 
    ff00::0:                      ip6-mcastprefix:              robocup-laptop.local:
    ff02::1:                      karumbu-2.local:              rosemary.local:
    ff02::2:                      localhost:                    scriptng.local:
    hmm.aux                       Makefile                      sonja-laptop.local:
    hmm.dvi                       mars.local:                   source5ng.local:
    hmm.log                       matrix-calculus.tex           vahid-laptop.local:
    hmm.pdf                       naorobocup-laptop.local:      

This is another example of what I do not think anyone wants:

    $ ls m*
    matrix-calculus.tex

    $ rsync --verbose m<TAB>
    $ rsync --verbose ma<TAB>
    mars.local:           matrix-calculus.tex   

Do people care about a visitor's laptop connected to the local network
that happens to be named "mars"?  Should its presence corrupt and
delay local filename completion?  I'd say: no.

					--Barak.
--
Barak A. Pearlmutter
 Hamilton Institute & Dept Comp Sci, NUI Maynooth, Co. Kildare, Ireland
 http://www.bcl.hamilton.ie/~barak/





More information about the Bash-completion-devel mailing list