Red Hat Bugzilla – Bug 123071
RM FAILS WITH PERMISSION DENIED WHEN LSTAT OF . FAILS
Last modified: 2007-11-30 17:06:54 EST
If the current directory does not exist, rm fails
immediately. This is a result of a bad security
fix for fileutils 4.1 and is fixed in 4.5 and later.
The problem is only on AS2.1
A trivial testcase to reproduce this problem is:
 gmarsden@ca-build1:/tmp$ mkdir rmtest
 gmarsden@ca-build1:/tmp$ cd rmtest/
 gmarsden@ca-build1:/tmp/rmtest$ touch /tmp/file1
 gmarsden@ca-build1:/tmp/rmtest$ chmod 0 .
 gmarsden@ca-build1:/tmp/rmtest$ rm -f /tmp/file1
rm: cannot lstat `.': Permission denied
 gmarsden@ca-build1:/tmp/rmtest$ ls -l /tmp/file1
-rw-rw-r-- 1 gmarsden gmarsden 0 May 7 18:52 /tmp/file1
The offending code is actually flagged with a FIXME in the
AS2.1 fileutils package and results from attempting to do an lstat on
the current directory to prevent a security exploit. However, this
check should not happen when not removing recursive directories.
Please fix or upgrade AS2.1 fileutils to 4.5.
*** This bug has been marked as a duplicate of 84552 ***
Changed to 'CLOSED' state since 'RESOLVED' has been deprecated.