From owner-freebsd-bugs Fri Jun 12 22:07:58 1998 Return-Path: Received: (from majordom@localhost) by hub.freebsd.org (8.8.8/8.8.8) id WAA00270 for freebsd-bugs-outgoing; Fri, 12 Jun 1998 22:07:58 -0700 (PDT) (envelope-from owner-freebsd-bugs@FreeBSD.ORG) Received: from godzilla.zeta.org.au (godzilla.zeta.org.au [203.15.68.22]) by hub.freebsd.org (8.8.8/8.8.8) with ESMTP id WAA00264; Fri, 12 Jun 1998 22:07:55 -0700 (PDT) (envelope-from bde@godzilla.zeta.org.au) Received: (from bde@localhost) by godzilla.zeta.org.au (8.8.7/8.8.7) id PAA12399; Sat, 13 Jun 1998 15:07:51 +1000 Date: Sat, 13 Jun 1998 15:07:51 +1000 From: Bruce Evans Message-Id: <199806130507.PAA12399@godzilla.zeta.org.au> To: phk@critter.freebsd.dk, rivers@dignus.com, zach@gaffaneys.com Subject: Re: bin/6653 Cc: asami@FreeBSD.ORG, danny@panda.hilink.com.au, freebsd-bugs@FreeBSD.ORG Sender: owner-freebsd-bugs@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.org >I wonder why the nifty trick of: > >rm -rf /var/run/. > >which used to clear a directory, quit working. Script started on Sat Jun 13 14:57:14 1998 ttyp0:bde@gamplex:/tmp> mkdir /tmp/foo /tmp/foo/foo ttyp0:bde@gamplex:/tmp> truss rm -rf /tmp/foo/. rm: syscall write(2,0xefbfd308,4) returns 4 (0x4) "." and ".." may not be removedsyscall write(2,0xefbfd31c,31) returns 31 (0x1f) syscall write(2,0xefbfd30c,1) returns 1 (0x1) syscall geteuid() returns 15 (0xf) syscall exit(0x1) process exit, rval = 256 ttyp0:bde@gamplex:/tmp> Script done on Sat Jun 13 14:57:39 1998 rm(1) is "smart" and doesn't trust rmdir(2). It is also stupid. It does a simple lexical check for "." and ".." at the end of the path, `rm -rf /tmp/foo/./' works like you want. Bruce To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-bugs" in the body of the message