Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 571588 - bash-completion improperly implements black and white lists
Summary: bash-completion improperly implements black and white lists
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal
Assignee: Michał Górny
URL:
Whiteboard:
Keywords:
: 574570 (view as bug list)
Depends on:
Blocks:
 
Reported: 2016-01-11 19:47 UTC by Alexander Soloviëv
Modified: 2016-02-19 13:42 UTC (History)
1 user (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
0001-Use-fixed-string-full-line-matches-for-white-blackli.patch (0001-Use-fixed-string-full-line-matches-for-white-blackli.patch,1.22 KB, patch)
2016-01-14 17:41 UTC, Michał Górny
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Alexander Soloviëv 2016-01-11 19:47:31 UTC
Lists are filtered in the following way (/usr/share/bash-completion/bash_completion)

grep -q -s "${1##*/}" /etc/bash/completion.blacklist

which macthes any substrings in list instead of exact match. As effect of this bug eselect bashcomp doesn't work.

Reproducible: Always

Steps to Reproduce:
1. Disable all completions with eselect bashcomp disable *
2. Enable one with substr collisions, eselect bashcomp enable git
3. Completion for git doesn't work, shadowed with blacklisted gitk.
Comment 1 Michał Górny archtester Gentoo Infrastructure gentoo-dev Security 2016-01-14 17:41:34 UTC
Created attachment 422932 [details, diff]
0001-Use-fixed-string-full-line-matches-for-white-blackli.patch

Could you please apply this patch to /usr/share/bash-completion/bash_completion and test it?
Comment 2 Michał Górny archtester Gentoo Infrastructure gentoo-dev Security 2016-02-18 22:55:35 UTC
*** Bug 574570 has been marked as a duplicate of this bug. ***
Comment 3 eNca 2016-02-18 23:28:50 UTC
I can confirm that provided patch fixes the scenario described in Bug 574570
Comment 4 Michał Górny archtester Gentoo Infrastructure gentoo-dev Security 2016-02-19 13:42:07 UTC
commit 79f27cc2135d1dc52bf8e0214c6b864ca4cf4657
Author: Michał Górny <mgorny@gentoo.org>
Date:   Fri Feb 19 14:26:56 2016

    app-shells/bash-completion: Fix blacklist/whitelist matching, #574570