Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 05 Oct 1996 00:25:06 +0800
From:      Peter Wemm <peter@spinner.DIALix.COM>
To:        =?KOI8-R?Q?=E1=CE=C4=D2=C5=CA_=FE=C5=D2=CE=CF=D7?= (Andrey A. Chernov) <ache@nagual.ru>
Cc:        CVS-committers@freefall.freebsd.org, cvs-all@freefall.freebsd.org, cvs-usrbin@freefall.freebsd.org
Subject:   Re: cvs commit: src/usr.bin/find extern.h find.1 find.h  function.c option.c 
Message-ID:  <199610041625.AAA16884@spinner.DIALix.COM>
In-Reply-To: Your message of "Fri, 04 Oct 1996 20:03:25 %2B0400." <199610041603.UAA00513@nagual.ru> 

next in thread | previous in thread | raw e-mail | index | archive | help
=?KOI8-R?Q?=E1=CE=C4=D2=C5=CA_=FE=C5=D2=CE=CF=D7?= wrote:
> >   It removes both files and directories.  It does not attempt to remove
> >   immutable files (an earlier version I showed to a few people did a chflag
    s
> >   and tried to blow away even immutable files.  Too risky..)
> 
> It should do the same thing for immutable files as 'rm -f' does.
> 
> >   Reviewed by: pst (some time ago, but I've removed the immutable file
> >   deletion code that he complained about since he last saw it)
> 
> Is it the same code as in 'rm -f'? This two things must be
> equivalent, i.e. either 'rm -f' must be -delete compatible
> or vice versa.

It works exactly the same as rm -f for the system immutable bit.. ie: both 
fail.

peter@spinner[12:19am]/tmp-117# id
uid=0(root) gid=0(wheel) groups=0(wheel)
peter@spinner[12:19am]/tmp-118# ls -lo bar
-rw-r--r--  1 peter  bin  schg 0 Oct  5 00:18 bar
peter@spinner[12:19am]/tmp-119# rm -f bar
rm: bar: Operation not permitted
peter@spinner[12:19am]/tmp-120# find bar -delete
find: -delete: unlink(bar): Operation not permitted
peter@spinner[12:19am]/tmp-121# ls -l bar
-rw-r--r--  1 peter  bin  0 Oct  5 00:18 bar

However, rm -f will turn off the user immutable bit if run by root.  
Perhaps I should recover the code, but only let it turn off the *USER* 
immutable bit, just like rm -f does?

At least that'll stop users creating user-immutable files in /tmp to annoy 
the sysadmin...

> -- 
> Andrey A. Chernov
> <ache@nagual.ru>
> http://www.nagual.ru/~ache/

Cheers,
-Peter





Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199610041625.AAA16884>