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

Re: "S" file permissions



> (Sorry for the non-Debian-specific question.)
> 
> Can someone explain what this execute bit means?
> 
> IOW, what is the difference between "s" (suid) and "S" (?)?
> 
> I've tried irc and one guy said it was something to do with an old SysV
> standard.  Someone else said it's "super-suid" or suid without eXecute (but
> how can you have suid without executing?).



It's "suid/sgid without execute".

The permissions on a file are controlled by 12 bits, grouped roughly 
into four groups of three:

  suid, sgid, sticky
  read, write, execute for user
  read, write, execute for group
  read, write, execute for other

suid means that when the file is executed, it inherits the user ID 
associated with the file.  sgid means that when the file is executed, 
it inherits the group associated with the file.  The sticky bit on 
files doesn't mean much anymore, but on directories, it affects how 
file permissions are interpreted in the directory.

When you do an "ls -l", it modifies the display for the execute bits 
for the user/group/other to show the suid/sgid/sticky bit.  For 
instance, the listing

-rwSr-sr-x   1 bob    student           1024  Feb 22 1998  oddfile

would mean that bob could not run oddfile (no user execute bit set), 
but all other students (group execute bit set) and all other users 
(other execute bit set) could run oddfile.  When "tom", of group 
"staff" ran oddfile, it would run as if it were "bob" of group 
"student" (because suid and sgid bits are set).

Similarly,

-rwxr-Sr-x   1 bob    student           1024  Feb 22 1998  oddfile2

would allow bob and non-students to run oddfile2, and if tom were 
running it, it would run as "tom" in group "student".

> Can anyone enlighten me?
> 
> (It's not in the info or man pages.)

Check the info listing for "ls".  It says there what s, S, t, and T all 
mean.

> 
> TIA.
> 
> 
> 
> 
> -- 
> Unsubscribe?  mail -s unsubscribe debian-user-request@lists.debian.org < /dev/null
> 
> 

-- 
     Buddha Buck                      bmbuck@zaphid.dhis.edu
"Just as the strength of the Internet is chaos, so the strength of our
liberty depends upon the chaos and cacaphony of the unfettered speech
the First Amendment protects."  -- A.L.A. v. U.S. Dept. of Justice



Reply to: