Bug 227168 - pwd fails to traverse unreadable directory
pwd fails to traverse unreadable directory
Status: CLOSED RAWHIDE
Product: Fedora
Classification: Fedora
Component: coreutils (Show other bugs)
6
All Linux
medium Severity medium
: ---
: ---
Assigned To: Tim Waugh
:
: 243120 (view as bug list)
Depends On:
Blocks: FC7Target
  Show dependency treegraph
 
Reported: 2007-02-02 16:35 EST by Dmitry V. Levin
Modified: 2008-12-11 13:13 EST (History)
3 users (show)

See Also:
Fixed In Version: 6.9-2.fc7
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2007-05-09 12:08:51 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 Dmitry V. Levin 2007-02-02 16:35:19 EST
Description of problem:
pwd and readlink (and probably others) fail to traverse unreadable directory.

Version-Release number of selected component (if applicable):
glibc-2.5-10.fc6
coreutils-5.97-12.3.fc6

Steps to Reproduce:
cd $TMPDIR && mkdir dir1 && cd dir1 && mkdir dir2 && cd dir2 && chmod a=x .. && { /bin/pwd; readlink -ev .; }

Actual results:
/bin/pwd: cannot open directory `..': Permission denied
readlink: .: Permission denied

Expected results:
$TMPDIR/dir1/dir2
$TMPDIR/dir1/dir2

Additional info:

$ strace -qe lstat,openat pwd  
lstat(".", {st_mode=S_IFDIR|0755, st_size=40, ...}) = 0
lstat("/", {st_mode=S_IFDIR|S_ISVTX|0755, st_size=460, ...}) = 0
openat(AT_FDCWD, "..", O_RDONLY)        = -1 EACCES (Permission denied)
lstat("/", {st_mode=S_IFDIR|S_ISVTX|0755, st_size=460, ...}) = 0
pwd: cannot open directory `..': Permission denied

$ strace -qe lstat,openat readlink -e .
lstat(".", {st_mode=S_IFDIR|0755, st_size=40, ...}) = 0
lstat("/", {st_mode=S_IFDIR|S_ISVTX|0755, st_size=460, ...}) = 0
openat(AT_FDCWD, "..", O_RDONLY)        = -1 EACCES (Permission denied)
Comment 1 Jim Meyering 2007-02-02 19:38:05 EST
Thanks again.
I've just fixed that upstream in gnulib:
  http://thread.gmane.org/gmane.comp.lib.gnulib.bugs/9033
Comment 2 Dmitry V. Levin 2007-02-03 06:36:17 EST
The fix works, thanks.
Comment 3 Tim Waugh 2007-06-07 09:02:48 EDT
*** Bug 243120 has been marked as a duplicate of this bug. ***

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