bug#43162: chgrp clears setgid even when group is not changed
Paul Eggert wrote: > Karl Berry wrote: > > I was on centos7. > > > > (I don't observe your problem on my Fedora 31 box, for example). > > > > Maybe there is hope for a future centos, then. Just another few data points... I was able to recreate this issue on a CentOS 7 system running in a tmpfs filesystem. So that's pretty much pointing directly at the Linux kernel behavior independent of file system type. Meanwhile... I can also recreate this on a Debian system with a Linux 4.9 kernel in 9 Stretch. But not on 10 Buster Linux 4.19. But once again not on an earlier Linux 3.2 kernel. 3.2 good, 4.9 bad, 4.19 good. Therefore this seems to be a Linux behavior that was the desired way, then flipped to the annoying behavior way, then has flipped back again later. Apparently. Anyway just a few data points. Bob
bug#43162: chgrp clears setgid even when group is not changed
On 9/1/20 3:30 PM, Karl Berry wrote: I was on centos7. (I don't observe your problem on my Fedora 31 box, for example). Maybe there is hope for a future centos, then. Maybe. Or it could be a filesystem or mounting issue. My filesystem was ext4 mounted rw,relatime,seclabel, for what it's worth. Anyway, closing the bug report.
bug#43162: chgrp clears setgid even when group is not changed
So partly this is a platform issue I was on centos7. (I don't observe your problem on my Fedora 31 box, for example). Maybe there is hope for a future centos, then. adding a run-time option to the chown and chgrp commands. Not sure it's worth it. Agreed about not being worth it. Oh well. --thanks, karl.
bug#43162: chgrp clears setgid even when group is not changed
On 9/1/20 2:25 PM, Karl Berry wrote: Is it necessary for chgrp to clear setgid on directories even when the group is not actually changed? In my life at least, it is rather annoying. The chgrp command isn't doing that directly; it's merely invoking the fchownat syscall, and the syscall is clearing setgid. POSIX requires chgrp to behave like the chown syscall even if the file's group is already correct, and it appears that the syscall clears the setgid bit on your platform (a behavior that POSIX allows, and even requires for regular files). So partly this is a platform issue (I don't observe your problem on my Fedora 31 box, for example). I don't see an easy way to change chgrp without departing from POSIX, or perhaps adding a run-time option to the chown and chgrp commands. Not sure it's worth it.
bug#43162: chgrp clears setgid even when group is not changed
Is it necessary for chgrp to clear setgid on directories even when the group is not actually changed? In my life at least, it is rather annoying. --thanks, karl. $ mkdir foo $ chmod g+s foo $ ls -ld foo drwxrwsr-x 2 karl root 6 Sep 1 10:36 foo/ $ chgrp root foo $ ls -ld foo drwxrwxr-x 2 karl root 6 Sep 1 10:36 foo/