Bug 149079 - cd to directory .. after working directory has been deleted makes pwd displaying wrong value
Summary: cd to directory .. after working directory has been deleted makes pwd display...
Status: CLOSED WONTFIX
Alias: None
Product: Red Hat Enterprise Linux 4
Classification: Red Hat
Component: kernel (Show other bugs)
(Show other bugs)
Version: 4.0
Hardware: All Linux
medium
medium
Target Milestone: ---
: ---
Assignee: Alexander Viro
QA Contact: Brian Brock
URL:
Whiteboard:
Keywords:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2005-02-18 15:35 UTC by Syl DES
Modified: 2012-06-20 13:22 UTC (History)
3 users (show)

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


Attachments (Terms of Use)

Description Syl DES 2005-02-18 15:35:35 UTC
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 11:02:41 UTC
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 09:06:06 UTC
The root cause seems to be that chdir("..") succeeds unexpectedly.

Comment 3 Jiri Pallich 2012-06-20 13:22:06 UTC
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.