[mdlug] SUID for a directory?

Paul set at pobox.com
Sat Feb 3 02:01:08 EST 2007


Michael ORourke <mrorourke at earthlink.net>, on Thu Feb 01, 2007 [12:15:31 PM] said:
> I was reading a text the other day and it suggested setting the following 
> permissions on a directory as such:
> chmod -R ug+rwxs,o-w,o+rx /path/to/some/dir

	Hi;

	Ewww. Maybe its just me but thats wrong on two levels. First,
it recursively sets SUID and SGID and executable on all files in that dir
structure, and it just looks a lot uglier than 'chmod -R 6775 foo/' :)

> Which basically gives "drwsrwsr-x" to the directory.  Now I understand 
> wanting to set the SGID bit for the directory, but I don't see what the SUID 
> bit does for the directory.  I googled it and the answers I am getting say 
> that the SUID bit is undefined for a directory.  Anyone have any better 
> answers?  My other thought is the author just made a simple mistake when he 
> wrote that command.
> 
> -Mike 

	Ingles made a good point in his reply, but I will just note, that some
of the extra 3 permission bits (suid, sgid, sticky) can mean different things
in different unixes in different contexts....

Paul
set at pobox.com



More information about the mdlug mailing list