lmi
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[lmi] Should 'chmod g=u' remove the 's' in "drwxrws"?


From: Greg Chicares
Subject: [lmi] Should 'chmod g=u' remove the 's' in "drwxrws"?
Date: Tue, 17 Mar 2020 22:14:39 +0000
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.5.0

'chmod g+s' is not undone by a subsequent 'chmod g=u', at least
not with debian testing:

/tmp/eraseme[0]$mkdir --parents foo/bar              
/tmp/eraseme[0]$ls -l foo
total 4
drwxr-xr-x 2 greg greg 4096 Mar 17 22:04 bar
/tmp/eraseme[0]$chmod g+s foo/bar
/tmp/eraseme[0]$ls -l foo        
total 4
drwxr-sr-x 2 greg greg 4096 Mar 17 22:04 bar
/tmp/eraseme[0]$chmod g=u foo/bar      
/tmp/eraseme[0]$ls -l foo        
total 4
drwxrwsr-x 2 greg greg 4096 Mar 17 22:04 bar

But why not? I would have thought that group permissions would
have been identical to user permissions after the series of
commands above, and that therefore it would be a mistake to
execute 'chmod g=u' after 'chmod g+s'.

This is a nice behavior, but I can't find it documented on
the GNU/Linux manpage or in the gnu coreutils manual, so can
I safely rely upon it?


reply via email to

[Prev in Thread] Current Thread [Next in Thread]