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)
Thanks again. I've just fixed that upstream in gnulib: http://thread.gmane.org/gmane.comp.lib.gnulib.bugs/9033
The fix works, thanks.
*** Bug 243120 has been marked as a duplicate of this bug. ***