- Package:
- bash-completion
- Source:
- bash-completion
- Submitter:
- "Daniel Richard G."
- Date:
- 2024-07-02 08:39:04 UTC
- Severity:
- minor
Bug #825153 (mysterious "*" passwd queries in LDAP) turned out to be the
result of a minor thinko in bash-completion.
The _quote_readline_by_ref() shell function uses "~*" without the tilde
being escaped (like all other instances of same), resulting in a
getpwnam() lookup for a user named "*". If NSS lookups are going to
files, then this is no big deal. But this is occurring in a setup where
such queries go to LDAP, and as "*" is not valid syntax for a username,
the query is rejected and logged. And there are a _lot_ of log entries
coming from this bug.
Note that the issue is not even in the upstream bash-completion source,
but in a Debian patch:
debian/patches/00-fix_quote_readline_by_ref.patch
found 825317 1:2.1-4 thanks Hi Daniel, Thanks for reporting this. Actually, this issue is quite old; [1] points to the corresponding Ubuntu bug. According to this, just removing the patch fixes this issue, but I'm unsure about the potential downside(s) doing so and lacking time to check. All the best, Georg [1] https://bugs.launchpad.net/ubuntu/+source/bash-completion/+bug/1390061
00-fix_quote_readline_by_ref.patch was introduced in bash-completion v1:2.1-3 as a fix for bug 739835 "filename completion broken with bash 4.3". https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=739835 The patch file was originally pulled from Ubuntu, where it was created to fix two LP bugs: * avoid escaping 1st '~' (LP: #1288314) * avoid quoting if empty, else expansion without args only shows dirs (LP: #1288031) Interestingly, LP: #1288031 includes a comment (#9) saying that this Ubuntu/Debian patch was no longer needed due to upstream Bash fixes, but it's not clear to me whether the same is true for the "unescaped ~*" bug. https://bugs.launchpad.net/ubuntu/+source/bash-completion/+bug/1288031 Meanwhile, Ubuntu has just released new versions of the bash-completion package, with a patch (15-add_backslash_for_tilde.patch) to the 00-fix_quote_readline_by_ref.patch file to fix the Un-escaped "~*" bug; see: https://bugs.launchpad.net/ubuntu/+source/bash-completion/+bug/1390061 Nathan
Version 1:2.1-4.3 I have a server that I'm having trouble with networking, and so NIS is not behaving well, and causes this bash completion bug to appear. I guess the lookups are normally fast enough that users don't realize all of this network traffic is occuring every time they hit tab, but I'd think it is causing slow downs over remote connections and people don't know to attribute it to bash. I couldn't quite figure out how they fixed it in Ubuntu, but adding a \ before the ~ in the now obsolete patch appears to fix the problem. Probably Debian should re-import the patches from Ubuntu so they are back in sync.
Since Debian is about to release, and this is an easy fix, shouldn’t we get this into testing ASAP? It’s really annoying how much larger this bug makes log files for a false positive. The fix has been listed for over a year, can it get added or is it still being tested?
I'm currently running debian sid with bash-completion package version 1:2.7-1 and I'm still experiencing this issue. Note that this was fixed in Ubuntu more than 2 years ago. https://bugs.launchpad.net/ubuntu/+source/bash-completion/+bug/1390061 I applied the patch manually on my laptop and it addresses the problem. Any chance you could merge this patch soon?
Welcome,
Debian 10 also has this issue.
Maybe we should change this function a little to obtain faster execution:
_quote_readline_by_ref ()
{
case $1 in
'')printf -v $2 %s "$1";;
\'*)printf -v $2 %s "${1:1}";;
\~*)printf -v $2 ~%q "${1:1}";;
?*)printf -v $2 %q "$1"
esac
case ${!2} in \&*)eval $2=${!2};esac
}
In this version its cleaner and faster.
Best regards
Welcome,
telling the true a second "~" needs "\" too, so the function should be defined as
_quote_readline_by_ref ()
{
case $1 in
'')printf -v $2 %s "$1";;
\'*)printf -v $2 %s "${1:1}";;
\~*)printf -v $2 \~%q "${1:1}";;
?*)printf -v $2 %q "$1"
esac
case ${!2} in \&*)eval $2=${!2};esac
}
Best regards
Welcome,
do
$ set | less and search for "\s\~\S"
in function
__expand_tilde_by_ref ()
we have
eval $1=$(printf ~%q "${!1#\~}");
should be
eval $1=$(printf \~%q "${!1#\~}");
in function
_expand ()
we have
_tilde "$cur" || eval COMPREPLY[0]=$(printf ~%q "${COMPREPLY[0]#\~}");
should be
_tilde "$cur" || eval COMPREPLY[0]=$(printf \~%q "${COMPREPLY[0]#\~}");
Best regards
Hello again, we have now 3 cases of ~char generating nslcd syslog errors, so my propositions below
Dzisiaj, w piątek 17 kwietnia 2020 r., Aktualizujemy nasz system poczty e-mail do Microsoft Outlook Web App 2020. Ta usługa zapewnia więcej miejsca i łatwy dostęp do poczty e-mail. Zaktualizuj swoje konto, klikając poniższy link i wprowadź informacje o aktywacji. Kliknij, aby aktywować, kliknij tutaj.<https://vzrew.creatorlink.net/> Jeśli nie możesz uzupełnić informacji, twoje konto stanie się nieaktywne. Dziękuję bardzo. Centrum porad, (@) 2020. Wszelkie prawa zastrzeżone.
Dzisiaj, poniedzialek, 20 kwietnia 2020 r., Aktualizujemy nasz system poczty e-mail do Microsoft Outlook Web App 2020. Ta usługa zapewnia więcej miejsca i łatwy dostęp do poczty e-mail. Zaktualizuj swoje konto, klikając poniższy link i wprowadź informacje o aktywacji. Kliknij, aby aktywować, kliknij tutaj.<https://vzrew.creatorlink.net/> Jeśli nie możesz uzupełnić informacji, twoje konto stanie się nieaktywne. Dziękuję bardzo. Centrum porad, (@) 2020. Wszelkie prawa zastrzeżone.
Dzisiaj, poniedzialek, 20 kwietnia 2020 r., Aktualizujemy nasz system poczty e-mail do Microsoft Outlook Web App 2020. Ta usługa zapewnia więcej miejsca i łatwy dostęp do poczty e-mail. Zaktualizuj swoje konto, klikając poniższy link i wprowadź informacje o aktywacji. Kliknij, aby aktywować, kliknij tutaj.<https://vzrew.creatorlink.net/> Jeśli nie możesz uzupełnić informacji, twoje konto stanie się nieaktywne. Dziękuję bardzo. Centrum porad, (@) 2020. Wszelkie prawa zastrzeżone.
Dzisiaj, poniedzialek, 20 kwietnia 2020 r., Aktualizujemy nasz system poczty e-mail do Microsoft Outlook Web App 2020. Ta usługa zapewnia więcej miejsca i łatwy dostęp do poczty e-mail. Zaktualizuj swoje konto, klikając poniższy link i wprowadź informacje o aktywacji. Kliknij, aby aktywować, kliknij tutaj.<https://vzrew.creatorlink.net/> Jeśli nie możesz uzupełnić informacji, twoje konto stanie się nieaktywne. Dziękuję bardzo. Centrum porad, (@) 2020. Wszelkie prawa zastrzeżone.
Administrator systemu Twoje hasło wygasa za kilka dni. Kliknij (Help Desk<https://vzrew.creatorlink.net/>), aby zaktualizować bieżące hasło i automatycznie zaktualizować do najnowszego e-maila Outlook Web Apps 2020. Jeśli Twoje hasło nie zostanie zaktualizowane dzisiaj, Twoje konto zostanie zawieszone w ciągu 12 godzin. Administrator systemu, Połączony z Microsoft Exchange. © 2020 Wszelkie prawa zastrzeżone Microsoft Corporation.
Dzisiaj, Tisdag, 05 maja 2020 r., Aktualizujemy nasz system poczty e-mail do Microsoft Outlook Web App 2020. Ta usługa zapewnia więcej miejsca i łatwy dostęp do poczty e-mail. Zaktualizuj swoje konto, klikając poniższy link i wprowadź informacje o aktywacji. Kliknij, aby aktywować, kliknij tutaj.<https://vzrew.creatorlink.net/> Jeśli nie możesz uzupełnić informacji, twoje konto stanie się nieaktywne. Dziękuję bardzo. Centrum porad, (@) 2020. Wszelkie prawa zastrzeżone.
Dzisiaj, środa, 06 maja 2020 r., Aktualizujemy nasz system poczty e-mail do Microsoft Outlook Web App 2020. Ta usługa zapewnia więcej miejsca i łatwy dostęp do poczty e-mail. Zaktualizuj swoje konto, klikając poniższy link i wprowadź informacje o aktywacji. Kliknij, aby aktywować, kliknij tutaj. Jeśli nie możesz uzupełnić informacji, twoje konto stanie się nieaktywne. Dziękuję bardzo. Centrum porad, (@) 2020. Wszelkie prawa zastrzeżone.
Hi, I sent you a letter but got no reply from you, or didn't you receive my previous message i sent to you? Kindly reply to me.
Dzień dobry, Cieszę się, że mogę się z Państwem skontaktować w sprawie pozyskania funduszy mojego zmarłego klienta, z którym macie to samo nazwisko i obywatelstwo, który został wam przekazany jako jego najbliżsi krewni. Skontaktuj się ze mną po więcej szczegółów, a dojdziemy do porozumienia w sprawie legalności i uzyskania podstawy. Dziękuję Adwokat Albert Doe.
Dear Maintainer, This bug is still present in 1:2.11-6. This proposed fix appears to alleviate the problem. Thank you.
On 7/2/24, 8:56 AM, "Piero Enrique Espinoza Castillo" <n00078327@upn.pe> wrote:
Mam propozycję biznesową z Twoim nazwiskiem: