[Bash-completion-devel] bash autocomplete triggers an ldap request

Peter Cordes peter at cordes.ca
Wed Dec 3 11:14:45 UTC 2014


On Tue, Dec 02, 2014 at 04:16:45PM -0800, Dean Sniegowski wrote:
> I've noticed my bash autocomplete will frequently hang.
> 
> System info:
> I'm running Ubuntu 14.04.1
> Bash Autocomplete 2.1-4
> Authentication using sssd configured for kerberos and ldap
> 
> Suspected Cause:
>  in _quote_readline_by_ref() has a line  elif [[ $1 == ~* ]]; then
> It appears this line causes sssd to make an ldap request for all the
> accounts which take a couple of seconds.
> 
> I'm fairly certain this is the cause because if I delete that elif, the
> delay goes away and there are no ldap requests.
> 
> Is this a bug or is it intended to retrieve all home directories?

 It's
https://bugs.launchpad.net/ubuntu/+source/bash-completion/+bug/1390061

 And it's been fixed in git for a while now.  The pattern was supposed
to match a literal ~ at the front of $1, to see if that's what the
completion word started with.

 BTW, the correct fix is to replace it with \~*, if you don't want to
just grab the upstream bash_completion and plonk it down over Ubuntu
Trusty's /usr/share/bash-completion/bash_completion.
https://alioth.debian.org/plugins/scmgit/cgi-bin/gitweb.cgi?p=bash-completion/bash-completion.git;a=blob;f=bash_completion;h=55c9e48661028cee71301fd244c12d516303d437;hb=HEAD
(I'd go with upstream, there are a couple other bugfixes, and it works
fine on my trusty system.)

-- 
#define X(x,y) x##y
Peter Cordes ;  e-mail: X(peter at cor , des.ca)

"The gods confound the man who first found out how to distinguish the hours!
 Confound him, too, who in this place set up a sundial, to cut and hack
 my day so wretchedly into small pieces!" -- Plautus, 200 BC



More information about the Bash-completion-devel mailing list