Todd Young writes:
> OK, I've been playing with Linux for a year, I was baptized on
> Irix(for 4 years).....why the extra digit in the permissions below,
> specifically the 2? I thought it was "user-group-everyone", what's
> the fourth place for? Thanks.

The other explanation was unclear or incorrect, so I'll explain.

The three bits in the fourth digit (as read from right to left) are S_ISUID
(4), S_ISGID (2) and S_ISVTX (1), as defined by sys/stat.h.

If the file is a regular file and ISUID or ISGID is set, then the file will
run as the uid or gid, respectively, of the file owner when it is executed.
Such executables are sometimes called suid or set-uid (or suid / set-gid).
An example use would be the ping program.  Only root may use raw sockets, so
the ping program must be run as root.  Thus the ping executable is owned by
root and has the ISUID bit set.

If the file is a directory and the ISVTX (sticky bit) is set, then users
other than root may not delete or rename files (i.e. modify their directory
entry) that are owned by a different user.  This is useful for temporary
directories such as /tmp.  Without it, any user could rename or delete
another user's temporary files, since everyone has write permissions on the
directory.

To my knowledge, the behavior of ISUID and ISGID on directories is not
specified by POSIX.  Certain operating systems use these bits to force new
directory entries to have the same uid or gid as the parent directory.

Setting ISVTX on regular files is implementation dependant.  Some operating
systems or file systems do not allow it.  Others may use it for a special
purpose.

-- 
David Phillips <david at acz.org>
http://david.acz.org/


_______________________________________________
TCLUG Mailing List - Minneapolis/St. Paul, Minnesota
http://www.mn-linux.org tclug-list at mn-linux.org
https://mailman.real-time.com/mailman/listinfo/tclug-list