Bug 583919 - tab-completion appends slash to non-directories
Summary: tab-completion appends slash to non-directories
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 5
Classification: Red Hat
Component: bash
Version: 5.4
Hardware: All
OS: Linux
medium
medium
Target Milestone: rc
: ---
Assignee: Roman Rakus
QA Contact: BaseOS QE - Apps
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2010-04-20 08:44 UTC by Tomas Smetana
Modified: 2018-11-14 19:40 UTC (History)
7 users (show)

Fixed In Version: bash-3.2-28.el5
Doc Type: Bug Fix
Doc Text:
In some situations, bash incorrectly appended "/" to files instead of just directories during tab-completion, causing incorrect auto-completions. This is fixed and auto-complete appends "/" only to directories.
Clone Of:
Environment:
Last Closed: 2011-07-21 10:37:56 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)
The patch posted by Loren Merritt to the upstream mailing list (404 bytes, patch)
2010-04-20 08:45 UTC, Tomas Smetana
no flags Details | Diff


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHSA-2011:1073 0 normal SHIPPED_LIVE Low: bash security, bug fix, and enhancement update 2011-07-21 10:37:04 UTC

Description Tomas Smetana 2010-04-20 08:44:28 UTC
Description of problem:
This bug is just a copy of a message in the upstream mailing list: see http://lists.gnu.org/archive/html/bug-bash/2008-07/msg00008.html

After triggering directory tab-completion as part of the command in
a command-substitution ( `` or "$()" but not $() ), bash enters a state
where tab-completion appends a / to all matched filenames, not just
directories.

Version-Release number of selected component (if applicable):
bash-3.2-24

How reproducible:
always

Steps to Reproduce:
1. complete -r
2. cd /tmp; touch example
3. ls examp<TAB>
4. `/tm<TAB>
5. ls examp<TAB>

Actual results:
example/

Expected results:
example

Additional info:
The referenced message contains a simple patch which fixes the problem.

Comment 1 Tomas Smetana 2010-04-20 08:45:42 UTC
Created attachment 407765 [details]
The patch posted by Loren Merritt to the upstream mailing list

Comment 2 David Tonhofer 2010-04-25 14:17:42 UTC
Yup, yup.

This auto-completion problem does not occur on RH4 (bash-3.0-21.el4_8.2) only in latest RH5 bash (bash-3.2-24.el5)

Comment 4 drewskiwooskie 2010-06-01 11:29:48 UTC
We are seeing the same thing here with RHEL 5.4 (bash-3.2-24.el5)
Is there any chance this will be put into an update for 5.4?

Comment 6 RHEL Program Management 2010-08-09 19:25:39 UTC
This request was evaluated by Red Hat Product Management for
inclusion in the current release of Red Hat Enterprise Linux.
Because the affected component is not scheduled to be updated in the
current release, Red Hat is unfortunately unable to address this
request at this time. Red Hat invites you to ask your support
representative to propose this request, if appropriate and relevant,
in the next release of Red Hat Enterprise Linux.

Comment 10 Roman Rakus 2011-03-03 17:08:47 UTC
Fixed in bash-3.2-28.el5

Comment 14 Branislav Náter 2011-04-14 07:28:14 UTC
Fix verified on bash-3.2-29.el5 on all architectures.

Comment 15 Misha H. Ali 2011-04-20 09:24:37 UTC
    Technical note added. If any revisions are required, please edit the "Technical Notes" field
    accordingly. All revisions will be proofread by the Engineering Content Services team.
    
    New Contents:
In certain circumstances bash incorrectly appended "/" to files that are  not directories when attempting tab-completion. This is fixed to remove the automatic appending of "/" after files that are not directories to allow the auto complete function to function as expected.

Comment 16 Misha H. Ali 2011-04-20 09:40:56 UTC
    Technical note updated. If any revisions are required, please edit the "Technical Notes" field
    accordingly. All revisions will be proofread by the Engineering Content Services team.
    
    Diffed Contents:
@@ -1 +1 @@
-In certain circumstances bash incorrectly appended "/" to files that are  not directories when attempting tab-completion. This is fixed to remove the automatic appending of "/" after files that are not directories to allow the auto complete function to function as expected.+In certain circumstances bash incorrectly appended "/" to files that are not directories when attempting tab-completion, resulting in incorrect auto-completion options. This is fixed to remove the automatic appending of "/" after files that are not directories to allow the auto complete function to function as expected.

Comment 17 Misha H. Ali 2011-05-04 01:37:52 UTC
    Technical note updated. If any revisions are required, please edit the "Technical Notes" field
    accordingly. All revisions will be proofread by the Engineering Content Services team.
    
    Diffed Contents:
@@ -1 +1 @@
-In certain circumstances bash incorrectly appended "/" to files that are not directories when attempting tab-completion, resulting in incorrect auto-completion options. This is fixed to remove the automatic appending of "/" after files that are not directories to allow the auto complete function to function as expected.+In some situations, bash incorrectly appended "/" to files instead of just directories during tab-completion, causing incorrect auto-completions. This is fixed and auto-complete appends "/" only to directories.

Comment 18 errata-xmlrpc 2011-07-21 10:37:56 UTC
An advisory has been issued which should help the problem
described in this bug report. This report is therefore being
closed with a resolution of ERRATA. For more information
on therefore solution and/or where to find the updated files,
please follow the link below. You may reopen this bug report
if the solution does not work for you.

http://rhn.redhat.com/errata/RHSA-2011-1073.html


Note You need to log in before you can comment on or make changes to this bug.