Bug 149079 - cd to directory .. after working directory has been deleted makes pwd displaying wrong value
cd to directory .. after working directory has been deleted makes pwd display...
Status: CLOSED WONTFIX
Product: Red Hat Enterprise Linux 4
Classification: Red Hat
Component: kernel (Show other bugs)
4.0
All Linux
medium Severity medium
: ---
: ---
Assigned To: Alexander Viro
Brian Brock
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2005-02-18 10:35 EST by Syl DES
Modified: 2012-06-20 09:22 EDT (History)
3 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2012-06-20 09:22:06 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Syl DES 2005-02-18 10:35:35 EST
Description of problem:
I found that pwd displays wrong value when deleting current directory
and changing directory to ".."

pwd command gives as a result:
/root/foo/bar/..

Steps to reproduce are self explanatory:

Version-Release number of selected component (if applicable):
3.0

How reproducible:
Always

Steps to Reproduce:
1. cd /tmp
2. mkdir -p foo/bar
3. cd foo/bar
4. rm -rf /tmp/foo
5. cd .. gives "error retrieving current directory" but after that:
6. pwd gives /tmp/foo/bar/..
    

Actual Results:  pwd should not diplay ".." in the path, and exit code
should not be 0

Expected Results:  pwd should give "could not get current directory:
getwd: cannot access parent directories" and exits with error code 1,
like in RHEL3 (I tried on RHEL4 and RHEL3-U3)

Additional info:

It's worse with these steps:
1. cd /tmp
2. mkdir -p foo/bar/foo
3. cd foo/bar/foo
4. rm -rf /tmp/foo
5. cd ../.. gives "error retrieving current directory" but after that:
6. pwd gives /tmp/foo/bar/../..
Comment 1 Tim Waugh 2005-02-22 06:02:41 EST
Clarifying some bugzilla fields:

Version-Release number of selected component:
3.0-19.2

Affects all architectures, not just ia64.

I see the same behaviour here.
Comment 2 Tim Waugh 2005-02-23 04:06:06 EST
The root cause seems to be that chdir("..") succeeds unexpectedly.
Comment 3 Jiri Pallich 2012-06-20 09:22:06 EDT
Thank you for submitting this issue for consideration in Red Hat Enterprise Linux. The release for which you requested us to review is now End of Life. 
Please See https://access.redhat.com/support/policy/updates/errata/

If you would like Red Hat to re-consider your feature request for an active release, please re-open the request via appropriate support channels and provide additional supporting details about the importance of this issue.

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