Re: rm(1) bug, possibly serious



* Oliver Fromme <olli@xxxxxxxxxxxxxxxxx> [2007-09-25 19:43 +0200]:
By the way, an additional confusion is that ".." and "../"
are handled differently. Specifying ".." always leads to
this message:

rm: "." and ".." may not be removed

and nothing is actually removed. It is confusing that
adding a slash leads to a different error message _and_
removal of the contents of the parent directory. Clearly
a POLA violation.

Adding a slash often leads to different behaviour.

nicolas@pc5 ~/rd> mkdir foo; ln -s foo bar
nicolas@pc5 ~/rd> rm -r bar
nicolas@pc5 ~/rd> ls -l
total 2
drwxr-xr-x 2 nicolas wheel 512 Sep 25 20:55 foo/
nicolas@pc5 ~/rd>

nicolas@pc5 ~/rd> mkdir foo; ln -s foo bar
nicolas@pc5 ~/rd> rm -r bar/
nicolas@pc5 ~/rd> ls -l
total 0
lrwxr-xr-x 1 nicolas wheel 3 Sep 25 20:56 bar@ -> foo
nicolas@pc5 ~/rd>

And cp -R behaves differently for dir and dir/, too, but it is
explicitly documented there.

Nicolas

--
http://www.rachinsky.de/nicolas
_______________________________________________
freebsd-stable@xxxxxxxxxxx mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-stable
To unsubscribe, send any mail to "freebsd-stable-unsubscribe@xxxxxxxxxxx"



Relevant Pages

  • Re: rm(1) bug, possibly serious
    ... adding a slash leads to a different error message _and_ ... Handelsregister: Registergericht Muenchen, HRA 74606, Geschäftsfuehrung: ... Python is executable pseudocode. ...
    (freebsd-stable)
  • Re: Grub-question when performing Kernel-upgrade
    ... > Thank you for your nice and understanding advice, Peter! ... > say God? ... your car with jump leads, do you go and put the leads in the petrol ... You caused the error message by your action, ...
    (comp.os.linux.setup)
  • Re: E-Mail Enabled Doc Library Error
    ... then I did a search from the Technet page on just the first part of the ... The error message there is not quite the same and the UrlScan tool is to ... then there are lots of other leads to chase down ...
    (microsoft.public.sharepoint.portalserver)
  • Re: How to handle null numeric values in ADO recordset
    ... It almost always leads to ... In my opinion, the error message must be fairly vauge or over used, ... numeric values as string data. ...
    (microsoft.public.excel.programming)
  • Re: printer stopped working
    ... I've been searching for about two hours to get a clue why it won't print. ... Can't find a single thing what leads me to a problem. ... One just clicks "print" and nothing happens, even no error message or clear ...
    (Fedora)