Operating System - HP-UX
1754259 Members
3481 Online
108813 Solutions
New Discussion юеВ

What's the "S" in -rw-rwSr--

 
SOLVED
Go to solution
Masaki Birchmier
Frequent Advisor

What's the "S" in -rw-rwSr--

Files created/modified with asu put an "S" in the file properies such as -rw-rwSr--
What is the "S" ?

I exported a 10.20/asu file system to a 11.00/CIFS system.

The web server on the 11.00 system can't open files (permission denied) that were on the 10.20 system "IF" they were touched by ASU (have "S" in the file properties) whats up with that?

If I copy the file over, the webserver reads the file just fine.

Masaki
8 REPLIES 8
harry d brown jr
Honored Contributor
Solution

Re: What's the "S" in -rw-rwSr--

do a man on chmod:


# touch /tmp/stupidfile
# ls -l /tmp/stupidfile
-rw-rw-rw- 1 root sys 0 Apr 5 11:13 /tmp/stupidfile
# chmod g+s /tmp/stupidfile
# ls -l /tmp/stupidfile
-rw-rwSrw- 1 root sys 0 Apr 5 11:13 /tmp/stupidfile
#



live free or die
harry
Live Free or Die
Joseph C. Denman
Honored Contributor

Re: What's the "S" in -rw-rwSr--

"S" is the set group execution bit.

man chmod

...jcd...
If I had only read the instructions first??
Helen French
Honored Contributor

Re: What's the "S" in -rw-rwSr--

Hi Masaki:

"S" is an additional file permission paramter like 'rwx'. It is used to set-owner-ID-on-file-execution or set-group-ID-on-file-execution permission for who. Useful only if 'u' or 'g' is expressed or implied in who. In your case. the group-ID is set.

# man chmod - for more details

HTH,
Shiju
Life is a promise, fulfill it!
John Carr_2
Honored Contributor

Re: What's the "S" in -rw-rwSr--

Hi

s is for add or delete set-group-ID-on-file execution . check out man page for chmod.

john.
Mark Greene_1
Honored Contributor

Re: What's the "S" in -rw-rwSr--

that sets the "sticky bit" with no execute permissions:

chmod 2666 [filename]

will produce that permissions mask. man 2 chmod for more information on what the sticky bit does.

HTH
mark
the future will be a lot like now, only later
S.K. Chan
Honored Contributor

Re: What's the "S" in -rw-rwSr--

If you're root and you chmod on a file, say ..

# chmod 2444 fileA
==> fileA will be r--r-Sr--

If you're regular user chmod on a file the user owned will show ..

$ chmod 2444 fileB
==> fileB will be r--r-sr--

Basically SGID is turned on, it means whoever runs that script will "effectively" run it as the group ownership of that script.
Jeff Schussele
Honored Contributor

Re: What's the "S" in -rw-rwSr--

Hi Masaki,

That's a "set-ID" - group set-ID in this case.
Means that whenever the file is executed the process will be owned by the group ID
Can only be cleared with a chmod g-s filename.
But it's been set for a reason - I wouldn't clear unless you know why you should.

Rgds,
Jeff
PERSEVERANCE -- Remember, whatever does not kill you only makes you stronger!
Tom Danzig
Honored Contributor

Re: What's the "S" in -rw-rwSr--

From the "ls" man page:

------s--- Execute/search by group; set group ID on execution

------S--- No execute/search by group; set group ID on

Intresting to note that OmniBack uses the group S to lock files during a backup to prevent there use. A member of the group that owns the file cannot the execute/search it. We had a backup fail which had the "lock files" option set and could not start an Oracle DB because this bit was set on one of the control files. Took a bit of digging to find that one!