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

Re: Deleting owned files...



>Michael Smith <miff@apanix.apana.org.au> writes:
>
>|> Greetings :
>|> I'm currently being bitten by the "can't delete lockfile" bug, and it's 
>|> being a bit of a pain - programs that create lockfiles but can't 
>|> delete them.
>
>|> I suspect this is also the reason why tar 1.11.2 (I rebuilt this with the
>|> pl44 mintlibs if anyone is interested) can't set ownership/permissions
>|> on files it extracts sometimes (that's annoying!).
>
>No, this has nothing to do with it.  Only the superuser can change the
>ownership of a file, and you can only change the mode if you own the
>file (or you are effectively root).  I never had problems extracting a
>tarfile if tar is running as root.  Unter SysV, everyone can give away
>files, but that is too risky, and GNU tar will never do that as a
>non-privileged process.

Under BSD the symatics are:-

	drwxrwxrwx	Anyone can delete, create or rename files.
	drwxr-xr-x	Only owner of directory can do the above.
	drwxrwtrwx	Anyone can create or delete their own files, no-one
			else (other than root) can do so.
	(I think the t is in the right place.. it's the sticky bit anyway.)

The important thing is the directory's protection, not the file's, which
determines who can do what to files in the directory, other than for
chown'ing. To chown a file you need to be the owner or root.

>Andreas.

Steve

-- 
---------------------------------------------------------------------------
Computer Systems Administrator, Dept. of Earth Sciences, Oxford University.
E-Mail: steve@uk.ac.ox.earth (JANET) steve@earth.ox.ac.uk (Internet).
Tel:- Oxford (0865) 282110 (UK) or +44 865 282110 (International).