Bug 1036694

Summary: path completion does not handle symlinks well
Product: [Fedora] Fedora Reporter: Michal Hlavinka <mhlavink>
Component: bashAssignee: Ondrej Oprala <ooprala>
Status: CLOSED NOTABUG QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 19CC: admiller, ooprala, ovasik, rrakus
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2014-01-10 09:20:47 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:

Description Michal Hlavinka 2013-12-02 13:41:02 UTC
Description of problem:
file path completion gives incorrect results when path contains symlink

Version-Release number of selected component (if applicable):
bash-4.2.45-1.fc19.x86_64

How reproducible:
always

Steps to Reproduce:
1.prepare environment

$ mkdir foo bar
$ ln -s ../foo bar/foo
$ touch abcd foo/abfoo bar/abbar

2.try it
$ cd bar/foo 

I) $ file ../ab<TAB> 
-> $ file ../abbar 
-> ../abbar: ERROR: cannot open `../abbar' (No such file or directory)
Error is correct, such file does not exist

II) $ file ../abc<TAB>
-> $ file ../abc - no completion, but ../abcd exists
$ file ../abcd
../abcd: empty

Actual results:
tab completion does not see some files and completes name to nonexistent files

Expected results:
tab completion working with symlinks

Additional info:
It works in both ksh and mksh

Comment 1 Ondrej Oprala 2014-01-10 09:20:47 UTC
Thanks for the report. This is an expected behaviour of bash. The behaviour you specified can be achieved by using 'set -o physical'.