Bug 76954 - rm fails to remove symbolic links
rm fails to remove symbolic links
Status: CLOSED NOTABUG
Product: Red Hat Linux
Classification: Retired
Component: fileutils (Show other bugs)
8.0
i386 Linux
high Severity high
: ---
: ---
Assigned To: Tim Waugh
Mike McLean
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2002-10-29 21:20 EST by Steve Bonneville
Modified: 2005-10-31 17:00 EST (History)
0 users

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2002-10-30 07:58:59 EST
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 Steve Bonneville 2002-10-29 21:20:03 EST
Description of Problem:

  The rm command will not remove symlinks properly.  Behavior is different
  on ext2 and ext3 filesystems, but broken both places.
    On ext2, symlinks may not be removed at all.
    On ext3, symlinks to directories may not be removed.
  Worked fine in 7.3 with fileutils-4.1-10.

Version-Release number of selected component (if applicable):

  fileutils-4.1.9-11

Steps to Reproduce:

1. touch testfile; ln -s testfile linkfile
2. touch testdir; ln -s testdir linkdir
3. rm linkfile linkdir

Actual Results:
  rm: cannot remove `linkfile/': Not a directory.
  rm: cannot remove `linkdir/': Not a directory.

Expected Results:
  The symlinks "linkfile" and "linkdir" should be deleted.
  The file "testfile" and directory "testdir" should still exist.
Comment 1 Leonid Mamtchenkov 2002-10-30 07:58:53 EST
First of all, you probably mistyped mkdir with touch in the second step, since
touch does not create directories, afaik.  Secondly, you try to remove the file
like a directory, i.e. with a slash at the end.  This gives the first error. 
Thirdly, since your linkdir is actually a file and not a directory, you get the
same error as above.

I have tried to reproduce the problem you are describing, and could not.  rm
works fine for me. :)

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