Bug 70837 - Bad rm behavior with broken symlinks
Summary: Bad rm behavior with broken symlinks
Keywords:
Status: CLOSED RAWHIDE
Alias: None
Product: Red Hat Public Beta
Classification: Retired
Component: fileutils
Version: limbo
Hardware: All
OS: Linux
medium
medium
Target Milestone: ---
Assignee: wdovlrrw
QA Contact: Mike McLean
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2002-08-06 00:01 UTC by Nathan G. Grennan
Modified: 2007-04-18 16:45 UTC (History)
0 users

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2002-08-29 22:20:29 UTC
Embargoed:


Attachments (Terms of Use)

Description Nathan G. Grennan 2002-08-06 00:01:59 UTC
From Bugzilla Helper:
User-Agent: Mozilla/5.0 Galeon/1.2.5 (X11; Linux i686; U;) Gecko/20020712

Description of problem:
Fileutils 4.1.9 contains a rewrite of rm that interactively queries you if you
want to remove a dangling symlink. If it is not a dangling symlink it simply
deletes it. I find this new behavior with dangling symlinks very annoying and
would like it reverted to old behavior. Fileutils 4.1 from 7.3 has the expected
behavior.

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


How reproducible:
Always

Steps to Reproduce:
1. ln -s foo foo
2. rm foo

	

Actual Results:  rm: remove symbolic link `foo'?

Expected Results:  Return to prompt

Additional info:

Limbo beta2

Comment 1 Mike McLean 2002-08-06 15:10:08 UTC
CLOSED->NOTABUG

You have rm aliased as 'rm -i', probably because you are logged in as root. The
superuser's .bashrc makes this alias to protect the unwary admin from
accidentally nuking their filesystem. This alias has been in place for a *long*
time, at least since RH6.2.  

This only thing new with rm is that it is now a little more descriptive about
the file in question.  Before it would simply prompt "rm: remove `foo`?",
whereas now it describes the type of file. For example,
# touch foo2
# rm foo2
rm: remove regular empty file `foo2'? n
# echo foo >foo3
# rm foo3
rm: remove regular file `foo3'? n

If you want to override the alias for a single command, you can quote it
# 'rm' foo3
or you can use the -f option
# rm -f foo
You can remove the alias for a session with the unalias command.
# unalias rm
# rm foo

I would not recommend removing the alias from root's .bashrc.  It is a good
think to have in place, and it will probably save your data one day.



Comment 2 Mike McLean 2002-08-06 15:14:11 UTC
Nevermind.  I see your problem now.  Sorry for the lecture.  I guess I just see
too many no-bugs.



Comment 3 Mike McLean 2002-08-06 15:19:36 UTC
Also, should rm describe the file as a broken symlink, rather than just a
symlink.  I mean as long is it's telling you when files are empty.....

Comment 4 Mike A. Harris 2002-08-06 20:35:00 UTC
In non-interactive mode, ie in an executing script, rm should NEVER
query the user for wether or not to delete something.

bug #69713 was probably caused by this change.  Scripts should not
IMHO have to force -f in order to delete things.

Comment 5 Bernhard Rosenkraenzer 2002-08-29 22:20:22 UTC
Fixed in 4.1.9-10


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