Unix Set Group ID feature question

General software, Operating Systems, and Programming discussion.
Everything from software questions, OSes, simple HTML to scripting languages, Perl, PHP, Python, MySQL, VB, C++ etc.
Post Reply
TinyTim
Advanced Member
Posts: 900
Joined: Sun Apr 15, 2001 12:00 pm
Location: Delaware

Unix Set Group ID feature question

Post by TinyTim »

Unix question - can someone clarify the SETGID or SGID feature - I am trying to determine if I set the SETGID on a directory, and group has read / execute---permissions will display as "r - s" ---- will this allow a user to inherit the group privileges if set group ID is turned on?

Or does the feature only apply to files (sets permissions newly created files to that of the group that owns the directory)?

For instance, if I have a directory "test" with SETGID enabled with effective permissions being "drxwr-s---" and most files under the directory having the following set permissions "rxwr-x---" what does this allow a member of the "Anyone" group to do to the directory or its contents? Anything? Will they inherit the "r-x" that the group has (setting the users group ID to that of the group that owns the directory)?

I have been googling for a while and seem to have confused myself, yet again

:irate:
Fee was a buddhist prodigy...
Long past the age of maturity...
Someday he knew it would set him free...
Like it did for Floyd...
The Chimpanzee...
TinyTim
Advanced Member
Posts: 900
Joined: Sun Apr 15, 2001 12:00 pm
Location: Delaware

Post by TinyTim »

Anyone?
Fee was a buddhist prodigy...
Long past the age of maturity...
Someday he knew it would set him free...
Like it did for Floyd...
The Chimpanzee...
User avatar
TonyT
SG VIP
Posts: 10356
Joined: Fri Jan 28, 2000 12:00 am
Location: Fairfax, VA

Post by TonyT »

No one has any right to force data on you
and command you to believe it or else.
If it is not true for you, it isn't true.

LRH
TinyTim
Advanced Member
Posts: 900
Joined: Sun Apr 15, 2001 12:00 pm
Location: Delaware

Post by TinyTim »

if the world has read and execute (r-x) and executes a process in a directory with SETGID enabled and group on directory has rwx then process will execute with group permissions and not users?

or, if world has r-- on a file, and setgid is enabled on the directory can they execute the program (world inherits group perm's with SETGID enabled?)? , or only members of the group can execute as the file would have rwx (mirrors group permissions set on the directory) -
Fee was a buddhist prodigy...
Long past the age of maturity...
Someday he knew it would set him free...
Like it did for Floyd...
The Chimpanzee...
Post Reply