Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

weird permissions thing

Status
Not open for further replies.

fortytwo

Technical User
Apr 18, 2000
206
0
0
GB
I am seeing permissions on a directory and file as follows:

rwxrwsr_x

for both the directory and file. Does anyone know what the s is for?
 
The 's' is the setguid bit. Like the infamous setuid, this runs the program with the processing effective group id set to the group of the file.

So, say the file is in the group "accounts", when it runs the group id of the program will be "accounts", regardless of what your current user group is.

Hope that helps.
 
and if it's set on a directory - means that only the owner of a file in that diretory may delete it.
 
Mike, sorry... you are wrong... thats the t bit when is over the last x. The SGID bit in a directory means "change the group of the new files in this directory to the group of the directory, not the group of the owner of the file". You can use this combined with the SVTX bit (the t in the perms) to create drop ony/put only directories.

If you are user [tt]john[/tt] in group [tt]staff[/tt] and you save/copy/move a file named [tt]MyLittleFile[tt] to a directory named [tt]Other'sDir[/tt] with owner [tt]admin1[/tt] and group [tt]admins[/tt] having the SGID bit set, then you'll end with the file [tt]Other'sDir/MyLittleFile[tt] owned by you ([tt]john[/tt] and with group [tt][red]admins[/tt][/red]

I hope it works...
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top