[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

RE: Limiting User Commands



On Tue, 09 Nov 2004 20:58:33 +0100, Dan Roozemond wrote:
> Suppose the root-owned file (readable for non-root user) is a. Then one does
> 'cp a b; rm a; mv b a' and we have the same file a owned by the regular
> user. Key observation here is that the non-root user ownes the directory,
> hence can remove files.

Thanks for the info.

When I was playing around with this I discovered something quite strange:

/tmp/test$ ll
total 0
-rw-r--r--  1 root root 0 2004-11-15 00:36 test

/tmp/test$ ll -d ../test/
drwxr-xr-t  2 mick mick 4.0K 2004-11-15 00:36 ../test/

/tmp/test$ rm test
rm: remove write-protected regular empty file `test'? y
/tmp/test$ ll
total 0

But according to the man page of chmod I shouldn't be able to do this:

When the sticky bit is set on a directory, files in that directory may be
unlinked or renamed only by root or their owner. Without the sticky bit,
anyone able to write to the directory can delete or rename files. The
sticky bit is commonly found on directories, such as /tmp, that are
world-writable. 

Does anyone understand this?

-- 
OoberMick




Reply to: