bash-completion tilde expansion every time
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
bash-completion (Debian) |
New
|
Unknown
|
|||
bash-completion (Ubuntu) |
Fix Released
|
Medium
|
Seyeong Kim | ||
Trusty |
Fix Released
|
Medium
|
Seyeong Kim | ||
Wily |
Won't Fix
|
Medium
|
Seyeong Kim | ||
Xenial |
Fix Released
|
Medium
|
Seyeong Kim |
Bug Description
[Impact]
when authenticate AD, with bask-completion, it's very slow.
[Testcase]
Below command should output nothing.
root@ubuntu1404:~# strace bash -c ". /etc/bash_
root@ubuntu1404:~# strace bash -c ". /etc/bash_
but we have something
root@ubuntu1404:~# strace bash -c ". /etc/bash_
open("/etc/passwd", O_RDONLY|O_CLOEXEC) = 3
root@ubuntu1404:~# strace bash -c ". /etc/bash_
open("/
open("/
connect(4, {sa_family=
[Regeression Potential]
Regression possible about https:/
but there is no problem with ~ completion in my test
I thested ~/<Tab>/ ~/<Tab>/<Tab> with no problem
[Other Info]
This is not from upstream, no need to fix for upstream.
But fix code seems harmless. just specify special character ~
// The original description
1) The release of Ubuntu you are using, via 'lsb_release -rd' or System -> About Ubuntu
root@ubuntu1404:~# lsb_release -rd
Description: Ubuntu 14.04.1 LTS
Release: 14.04
2) The version of the package you are using, via 'apt-cache policy pkgname' or by checking in Software Center
root@ubuntu1404:~# apt-cache policy bash-completion
bash-completion:
Installed: 1:2.1-4
Candidate: 1:2.1-4
Version table:
*** 1:2.1-4 0
500 http://
100 /var/lib/
3) What you expected to happen
When I use bash-completion it should not read the /etc/passwd file or contact the Active directory.
It is very hard to see this problem unless you run this on a machine with slow authentication... but the commands below will show if the /etc/passwd or sssd are used by bash_completion or not:
root@ubuntu1404:~# strace bash -c ". /etc/bash_
root@ubuntu1404:~# strace bash -c ". /etc/bash_
When the ~ are escaped on line 545 and 547 in /usr/share/
4) What happened instead
Every time you use tab-completion in bash on ubuntu 14.04 it will read the /etc/passwd file and if sssd are installed and configured for Active Directory authentication it will talk to sssd... and this can be slow in some environments.
root@ubuntu1404:~# strace bash -c ". /etc/bash_
open("/etc/passwd", O_RDONLY|O_CLOEXEC) = 3
root@ubuntu1404:~# strace bash -c ". /etc/bash_
open("/
open("/
connect(4, {sa_family=
I have made a small patch for this problem and I have not found any side effects:
--- /usr/share/
+++ /usr/share/
@@ -542,9 +542,9 @@
elif [[ $1 == \'* ]]; then
# Leave out first character
printf -v $2 %s "${1:1}"
- elif [[ $1 == ~* ]]; then
+ elif [[ $1 == \~* ]]; then
# avoid escaping first ~
- printf -v $2 ~%q "${1:1}"
+ printf -v $2 \~%q "${1:1}"
else
printf -v $2 %q "$1"
fi
tags: | added: trusty utopic |
Changed in bash-completion (Ubuntu): | |
importance: | Undecided → Medium |
Changed in bash-completion (Ubuntu): | |
assignee: | nobody → Seyeong Kim (xtrusia) |
tags: | added: sts |
description: | updated |
Changed in bash-completion (Ubuntu): | |
status: | Confirmed → In Progress |
description: | updated |
Changed in bash-completion (Ubuntu Trusty): | |
status: | New → In Progress |
Changed in bash-completion (Ubuntu Xenial): | |
status: | New → In Progress |
assignee: | nobody → Seyeong Kim (xtrusia) |
Changed in bash-completion (Ubuntu Trusty): | |
assignee: | nobody → Seyeong Kim (xtrusia) |
Changed in bash-completion (Ubuntu Trusty): | |
importance: | Undecided → Medium |
Changed in bash-completion (Ubuntu Xenial): | |
importance: | Undecided → Medium |
Changed in bash-completion (Ubuntu Wily): | |
importance: | Undecided → Medium |
tags: |
added: verification-done-trusty verification-needed-xenial removed: verification-needed |
Changed in bash-completion (Debian): | |
status: | Unknown → New |
Changed in bash-completion (Ubuntu Wily): | |
status: | In Progress → Won't Fix |
tags: | removed: sts |
Status changed to 'Confirmed' because the bug affects multiple users.