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

Re: Weird File Permissions



Aniartia <Linux@genasis.freeserve.co.uk> writes:

> On Wednesday 07 November 2001 22:33, Sunny Dubey wrote:
> > hey,
> >
> > what does it mean to have an S or an s when doing ls -l ??
> >
> > (sunny@lily)(/)$ ls -l | grep home
> > drwxrwsr-x    8 root     staff        1024 Oct 15 12:02 home
> 
> I thought s = execute with SUID 
> And this is the point where I get told I'm totaly wrong! ;)

Straight from the info page for "chmod->File Permissions":

------------------------------------------------------------------------
[snip]
   In addition to the three sets of three permissions listed above, a
file's permissions have three special components, which affect only
executable files (programs) and, on some systems, directories:
[snip]
  2. set the process's effective group ID to that of the file upon
     execution (called the "setgid bit").  For directories on some
     systems, put files created in the directory into the same group as
     the directory, no matter what group the user who creates them is
     in.
[snip]
------------------------------------------------------------------------

Therefore, the setgid bit on a directory will try to force any files
created in that directory to be owned by the same group that owns the
directory, if the OS/C library supports it.

So, yeah, you're totally wrong, at least in the case of the setgid bit
on directories. :)

Gary



Reply to: