[OmniOS-discuss] /usr/bin/chmod and the set-gid-bit

Tim Rice tim at multitalents.net
Wed Aug 7 17:14:03 UTC 2013


On Wed, 7 Aug 2013, Tobias Oetiker wrote:

> Hi,
> 
> /usr/bin/chmod seems to ignore the set-group-id bit when called
> with an octal permission string. try this on a zfs filesystem

That behavior seems to be intentional for directories and is documented
in the man page.
It has been that way a long time. Probably since the SVR4.0 days.

> 
>   export PATH=/usr/bin
>   umask 022
>   mkdir gd
>   ls -ld gd
>   chmod 2770 gd
>   ls -ld gd
>   chmod g+s gd
>   ls -ld gd
>   chmod 0770 gd
>   ls -ld gd
> 
> running this with truss reveals that I should call
> 
>   chmod 042770 gd
> 
> instead, and indeed it works I just don't know why ... the man page
> does not provide any insight into this behaviour ...
> 
> ah and btw, /usr/gnu/bin/chmod work the way legacy unix tools do :-)
> 
> can someone please enlighten me ?
> 
> cheers
> tobi
> 
> 

-- 
Tim Rice				Multitalents
tim at multitalents.net




More information about the OmniOS-discuss mailing list