Permissions - was Re: Mounting external network attached storage

Tim Frost timfrost at xtra.co.nz
Mon Jun 5 09:38:33 UTC 2006


On Sun, 2006-06-04 at 21:10 +0100, Tim Penhey wrote:

> Perhaps someone could explain the following:
> 
> -rwxrwSrwt  1 tim  tim        0 2006-06-03 16:35 test2
> 
> What is the S in the group execute or the t in the all execute bits?

'S' = setgid (= 'set group id'), without the exec bit being set.  If
this is set for  a program, it means that the program will run using the
group that it belongs to, rather than getting the group information for
the user that is running it.  This position for user and group
permissions can have the following values displayed:
'-' = nothing set
'x' = executable (or searchable for a directory)
'S' = setuid (user) or setgid (group)
      - this means that the program runs as the user or group that owns
         the file, rather than the user who is invoking it.
's' = setuid + executable.



't' is the sticky bit. Like the setuid bit, this comes in two flavours:
'T' = sticky bit and NO exec ('x')
't' = 'T' + 'x'
 On older Unix systems, the sticky bit caused executable files to be
hoarded in swap space (to get a faster load time than from the
filesystem).
On Linux, it is mostly meaningful on a directory which is
world-writeable, where it means that only the owner of a file can delete
it.  This is used on /tmp /and /var/tmp, to prevent me from deleting
your files.


The sticky and setuid bits are stored in the octal digit ABOVE the
normal permission bits. This means that the octal rendition of these
permission bits is 03767 (3=SGID+Sticky, 7=RWX, 6=RW-).


> 
> Thanks
> Tim
> 

Note that this is an interpretation of the file modes that the network
storage is returning.  Windows, MAC and Netware each have a different
set of permission bits, which don't precisely map to the unix mode bits,
so the filesystem driver (eg smbfs) has to convert between the two, and
may not do a perfect rendition.


Hope this helps


Tim Frost






More information about the ubuntu-users mailing list