Dave Witbrodt wrote:
> *** Please type your report below this line ***

You are expected to remove that line and replace it with your report.  :-)

> I have a (bad) habit of removing directories using 'rm -rdf' instead 

Yes, that is a bad habit.  Stop using the -d option.  Using it
routinely is quite bad.  If it is needed then it pretty much
guarantees that you will need to fsck your filesystem afterward.  The
-d option uses unlink(2) kernel call and like the traditional
unlink(1) command does have special purpose uses but is not for
general use removal of random directories.  Don't use it.

> of 'rmdir'.

There is nothing wrong with 'rm -rf' or 'rm -Rf'.

> Recently, I modified my bad habit to include verbose 
> output.  So, I was removing an old kernel today for which GRUB refused 
> to remove the /lib/modules directory because of an NVidia module I had 
> installed, and I had to remove it myself:

If the nvidia module was installed using a package then it would be
better to remove the nvidia module package.  The message from dpkg
that it couldn't remove /lib/modules is information.  It is a head's
up that there might still need to be cleanup done.  But it is not
usually an error in and of itself.  Often simply removing the other
packages with files there will allow the proper cleanup to occur.

>   AMD64X2-5600:/lib/modules# rm -vrdf 2.6.24.080306.amd64x2.vesa/

I wouldn't have a usage complaint with 'rm -vrf 2.6.24.080306.amd64x2.vesa/'.

>   removed `2.6.24.080306.amd64x2.vesa//kernel/drivers/video/nvidia.ko'
>   removed directory: `2.6.24.080306.amd64x2.vesa//kernel/drivers/ video'
>   removed directory: `2.6.24.080306.amd64x2.vesa//kernel/drivers'
>   removed directory: `2.6.24.080306.amd64x2.vesa//kernel'
>   removed directory: `2.6.24.080306.amd64x2.vesa/'
> 
> The directory structure was removed just fine, but the verbose output 
> is clearly wrong with those double slashes.  (Of course, I did not 
> intend to add the slash, but 'bash' completion put it there when I hit 
> tab.)

Multiple slashes in the middle of a path is not going to cause
problems.  Because of the old Apollo Domain system and then OSF/1 the
POSIX standard says that exactly TWO slashes at the front are special.
On the old Apollo that indicated a networked path.  Recently Cygwin
has started using this too.  But three or more at the front are okay
and any number of slashes as directory separators are okay.

You will be happy to hear that there has been quite a bit of
development with rm's directory traversal since 5.97 that you reported
against.  The current rm doesn't print multiple slashes.  When next
you upgrade to either the upcoming released version of Debian or to
the Unstable/Sid version you will get the new behavior.

  $ mkdir -p one/two/three/four
  $ rm -vrf one/
  removed directory: `one/two/three/four'
  removed directory: `one/two/three'
  removed directory: `one/two'
  removed directory: `one'

Look good?

> (This is my first report to the Debian BTS, so be gentle.  ;)  I would
> have set the severity to "wishlist", but I had a second thought 
> because someone might try to use the verbose output in a script.)

I tried to be gentle!  :-)

Oh, yes, stop using '-d' option to rm!  :-)

Bob



-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]

Reply via email to