Aleksey Tsalolikhin <[email protected]> wrote:

> A new user I knew was trying to clean out some old accounts on a system
> he was given.  As root, he changed directories to one of the old user
> directories, and then did 'rm -r *' but noticed it left a directory
> called .X11 behind.  To get rid of it, and to be sure it wouldn't fail,
> he did 'rm -rf .*'.  Sad to say he didn't realize that '.*' could and
> would expand into '..', and it would continue to do so recursively.

Did early versions of (any) Unix really behave this way?  I don't see
how:

'.*' is expanded by the shell at command invocation time.  That does in
fact get expanded to include '.' and '..', but it does not recursively
expand to '../.' and '../..' etc.

Today's unix versions tend to agree that a user cannot remove '.' and
'..', and NetBSD's earliest import from March 1993 also includes this
explicit check
(http://cvsweb.netbsd.org/bsdweb.cgi/src/bin/rm/rm.c?rev=1.1).

-Jan

Attachment: pgpaBj0dMHwkd.pgp
Description: PGP signature

_______________________________________________
Discuss mailing list
[email protected]
https://lists.lopsa.org/cgi-bin/mailman/listinfo/discuss
This list provided by the League of Professional System Administrators
 http://lopsa.org/

Reply via email to