[Top][All Lists]

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

Re: chmod man page "t" attribute.

From: Bob Proulx
Subject: Re: chmod man page "t" attribute.
Date: Sun, 8 Jul 2001 20:00:49 -0600

> The chmod man page does not indicate the affect of the "t"/leading
> 1/stick bit attribute on directories.  I'm told that this prevents
> unprivileged users from deleting files that they /do/ have write
> access to.  I haven't tested this, but I imagine that it is common
> knowledge.  (But not to me, since it isn't in the man page
> . . . hence the bug report :-)

Just to clear up the confusion here.  The 't' bit has an original
meaning for executable programs.  [Keep a copy of the text (which
means code in unix speak) on the swap disk so that it loads faster on
subsequent runs because it can stream the preloaded image from the
swap disk instead of loading from the filesystem disk.  For various
reasons I think this is better to be avoided with modern operating
systems.  It was implemented while UNIX was still extremely primitive.
Much time has passed since then.]  But this did not have a meaning
when applied to directories.  Therefore when a need to create
functionality regarding directories arose they overloaded the 't'ext
bit and gave it a unique meaning when applied to a directory.

On a directory the 't' bit means that if you do not own the file you
cannot delete it.  This is needed on shared, writable directories like
/tmp to prevent one user from deleting another user's files.  Many
programs, like vi as one example, use /tmp for temporary files.
Without the 't' bit anyone could wipe out the entire /tmp directory
and break random programs.  Some of those programs would include
system processes as well.  Therefore shared writable directories
usually require the 't' bit for protection.  It allows you to create
files but prevents you from deleting files created by other users.

Hope this helps


reply via email to

[Prev in Thread] Current Thread [Next in Thread]