GNU bug report logs -
#5826
[feature] chmod +S to setgid directories alike +X
Previous Next
Reported by: Michał Górny <gentoo <at> mgorny.alt.pl>
Date: Sat, 3 Apr 2010 11:28:01 UTC
Severity: wishlist
Tags: wontfix
Done: Bob Proulx <bob <at> proulx.com>
Bug is archived. No further changes may be made.
Full log
Message #17 received at 5826-done <at> debbugs.gnu.org (full text, mbox):
Michał Górny wrote:
> I would really appreciate if chmod supported setting setgid permissions
> on directories (and files already having such) recursively, much like
> '+X' does set executable permission. To match the '+X' one, I suggest
> using '+S' for that.
I suggest using 'find' for this. And there is an advantage to using a
standard command. It works anywhere.
$ find . -type d -exec chmod g+s {} +
Also the setgid bit isn't like the execute bit. They can't be directly
compared. There are three execute bits. The +X implements a not
completely trivial control flow. If the file is a directory OR if the
file already had the user execute bit or the group execute bit or the
other execute bit set. It is the three execute bits that makes it
non-trivial and the usefulness of the +X mode. But by contrast
setting the setgid bit is very simple. Just set it. It is only one
bit.
Plus there are security ramifications to think about when setting the
setgid bit on files. And the decisions are operating system
dependent. On most systems scripts should never be suid/sgid. And
even on systems where it is safe to do so I don't think setting the
suid/sgid bit on normal executables is something that should be done
lightly.
Bob
This bug report was last modified 15 years and 56 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.