Re: buglet in ext2 sticky bit?

Eilert Brinkmann (eilert@informatik.uni-bremen.de)
24 Oct 1999 23:34:27 +0200


Matthew Kirkwood <weejock@ferret.lmh.ox.ac.uk> wrote:
> > As far as I know this is correct behaviour... Rights on deleted file
> > have no impact on its unlinking (OK, with the exception to the
> > IMMUTABLE and APPEND bits...) - what matters is *only* a directory.
> > When it has sticky bit set than file can be deleted only by its owner
> > or owner of the directory.
>
> Intestingly, this works on Solaris 2.6 (both tmpfs and ufs).
>
> I seem to be able to delete any file in /tmp which I own _or_ can write
> to.
>
> Stevens' APUE doesn't mention this feature, so I'd be tempted to call
> it a bug in Solaris (can't test other OSes, unfortunately).

This is a difference, but not a bug in Solaris. It is documented in
the Solaris man page for chmod(2):

If a directory is writable and has S_ISVTX (the sticky bit)
set, files within that directory can be removed or renamed
only if one or more of the following is true (see unlink(2)
and rename(2)):
o the user owns the file
o the user owns the directory
o the file is writable by the user
o the user is a privileged user

Eilert

-- 
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
       Eilert Brinkmann -- Universitaet Bremen -- FB 3, Informatik
eilert@informatik.uni-bremen.de - eilert@tzi.org - eilert@linuxfreak.com
              http://www.informatik.uni-bremen.de/~eilert/

- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.rutgers.edu Please read the FAQ at http://www.tux.org/lkml/