Bug 123071 - RM FAILS WITH PERMISSION DENIED WHEN LSTAT OF . FAILS
Summary: RM FAILS WITH PERMISSION DENIED WHEN LSTAT OF . FAILS
Keywords:
Status: CLOSED DUPLICATE of bug 84552
Alias: None
Product: Red Hat Enterprise Linux 2.1
Classification: Red Hat
Component: fileutils
Version: 2.1
Hardware: All
OS: Linux
medium
high
Target Milestone: ---
Assignee: Tim Waugh
QA Contact: Mike McLean
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2004-05-12 00:13 UTC by Greg Marsden
Modified: 2007-11-30 22:06 UTC (History)
1 user (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2006-02-21 19:03:11 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)

Description Greg Marsden 2004-05-12 00:13:17 UTC
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:
[0] gmarsden@ca-build1:/tmp$ mkdir rmtest
[0] gmarsden@ca-build1:/tmp$ cd rmtest/
[0] gmarsden@ca-build1:/tmp/rmtest$ touch /tmp/file1
[0] gmarsden@ca-build1:/tmp/rmtest$ chmod 0 .
[0] gmarsden@ca-build1:/tmp/rmtest$ rm -f /tmp/file1
rm: cannot lstat `.': Permission denied
[1] 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.

Comment 1 Tim Waugh 2004-05-12 08:28:21 UTC

*** This bug has been marked as a duplicate of 84552 ***

Comment 2 Red Hat Bugzilla 2006-02-21 19:03:11 UTC
Changed to 'CLOSED' state since 'RESOLVED' has been deprecated.


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