Re: Weird File Permissions
Hi, "s" is the setuid and/or setgid permission: setuid in the user field, setgid in the group field. On files, setuid/setgid allow the group/user ID of the process started when invoking an executable file to be set to the group/user ID owning the file, respectively. Setting the setgid bit on a directory influences the group ownership of files and directories created under it. On Linux, the default behaviour is for new directories to be created with the default group of the creating user (System V convention). Setting the setgid bit on the directory forces new directories created under it to have the same group as the parent directory; this is the BSD convention. In your case, all new files and directories created under /home will be owned by group "staff". I'm not sure what setting the setuid bit on a directory does; it seems to have much the same effect as setting the setgid bit, but there must be some subtle difference I'm not aware of. Best regards, George Karaolides 8, Costakis Pantelides St., tel: +35 79 68 08 86 Strovolos, email: [EMAIL PROTECTED] Nicosia CY 2057, web: www.karaolides.com Republic of Cyprus On Wed, 7 Nov 2001, Sunny Dubey wrote: > hey, > > what does it mean to have an S or an s when doing ls -l ?? > > ([EMAIL PROTECTED])(/)$ ls -l | grep home > drwxrwsr-x8 root staff1024 Oct 15 12:02 home > > thanks for any info > > =) > Sunny Dubey > > > -- > To UNSUBSCRIBE, email to [EMAIL PROTECTED] > with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED] >
Re: Weird File Permissions
On Wed, Nov 07, 2001 at 10:42:37PM +, Aniartia wrote: > 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 ?? > > > > ([EMAIL PROTECTED])(/)$ ls -l | grep home > > drwxrwsr-x8 root staff1024 Oct 15 12:02 home > > I thought s = execute with SUID > And this is the point where I get told I'm totaly wrong! ;) First part: S means the SUID/SGID bit is set but the execute bit is not. S means the SUID/SGID bit is set and the execute bit is also set. Second part: SGID on a directory means files and subdirectories created in that directory should inherit group ownership, even if the user's default group is not the group owning this dir (hope that makes sense). Sometimes it's easier to think of permissions in octal rather than the symbolic representation. 00400 -r 00660 -rw-rw 00777 -rwxrwxrwx 01777 drwxrwxrwt (I cheated and made this a dir since it only makes sense there; see /tmp. This is the "sticky bit") 02755 -rwxr-sr-x (Typical SGID binary; see /usr/bin/write) 02775 drwxrwsr-x (Typical SGID directory; see /usr/src) 02700 drwx--S--- (SGID directory which has no group permissions) 04755 -rwsr-xr-x (Typical SUID binary; see /usr/bin/chsh) HTH, -- Nathan Norman - Staff Engineer | A good plan today is better Micromuse Ltd. | than a perfect plan tomorrow. mailto:[EMAIL PROTECTED] | -- Patton pgp6aa13oGdVO.pgp Description: PGP signature
Re: Weird File Permissions
Aniartia <[EMAIL PROTECTED]> 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 ?? > > > > ([EMAIL PROTECTED])(/)$ ls -l | grep home > > drwxrwsr-x8 root staff1024 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
Re: Weird File Permissions
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 ?? > > ([EMAIL PROTECTED])(/)$ ls -l | grep home > drwxrwsr-x8 root staff1024 Oct 15 12:02 home I thought s = execute with SUID And this is the point where I get told I'm totaly wrong! ;) Ani
Weird File Permissions
hey, what does it mean to have an S or an s when doing ls -l ?? ([EMAIL PROTECTED])(/)$ ls -l | grep home drwxrwsr-x8 root staff1024 Oct 15 12:02 home thanks for any info =) Sunny Dubey