> I kinda understand the 775, but, whats '02' on 02775 ? The extra digit refers to a special set of permissions: setuid, setgid and the "sticky bit."
What these do depends on whether you're dealing with a regular file or a
directory. In the case of a regular file, it affects what happens when
you execute it:
- setuid runs the programme with the uid that owns the file (i.e., not
necessarily yours). It has the numeric value 4.
- setgid runs the programme with the group privileges of whatever
group owns the file (again, not necessarily yours). It has the
numeric value 2.
Applied to a directory, to the best of my recall, it affects the
ownership of anything you write in there. It replaces the uid or gid of
the new file, with the uid or gid that owns the directory.
The sticky bit (confusingly marked with "t" and not "s") is something
I've only ever seen applied to directories. When that's set, files can
only be deleted by their owner, or by root. Very handy in a directory
like /tmp, as it allows a user to "rm /tmp/*" and know that only their
files will disappear.
Its numeric value is 1.
> [EMAIL PROTECTED] mailman]# bin/check_perms -f
> directory must be at least 02775: /var/mailman (fixing)
>
> after I 'fixed' it, it now says
>
> drwxrwsr-x 15 root mailman 4096 Aug 3 2002 mailman
>
> hmm, what does 's' signify ?
The "s" signifies "setgid". The fact that it appears where you'd
normally expect an "x" is a handy reminder hint that it affects
execution privileges.
If it were "setuid," you'd see:
drwsrwx--x 15 root mailman 4096 Aug 3 2002 mailman
If the sticky bit were set, you'd see:
drwxrwx--t 15 root mailman 4096 Aug 3 2002 mailman
And, of course, any permutation of those three is quite valid.
The terse version of all this is "man chmod" - which is much more likely
to be correct than me.
Cheers,
James
--
...so there I am at ten thousand feet with a power drill in one hand, a
takeaway menu in the other, no parachute and a _very_ suprised
expression...
pgp00000.pgp
Description: PGP signature
-- SLUG - Sydney Linux User's Group Mailing List - http://slug.org.au/ Subscription info and FAQs: http://slug.org.au/faq/mailinglists.html
