Activity log for bug #187315

Date Who What changed Old value New value Message
2008-01-30 14:28:15 Aaron Toponce bug added bug
2008-01-30 14:29:14 Aaron Toponce title SGID not returning right exit code on failure chmod not returning right exit code on SGID directory failure
2008-01-30 14:29:31 Aaron Toponce description SGID is not setting the correct exit code upon failure. For example, follow along below. This not only affects Ubuntu, but I assume Linux in general, as I've duplicated the bug on Debian and Red Hat, the two largest forked distros. aaron@kratos:~$ mkdir ~/tmp aaron@kratos:~$ ls -ld ~/tmp drwxr-xr-x 2 aaron aaron 4096 2008-01-30 07:24 /home/aaron/tmp aaron@kratos:~$ sudo chown .root ~/tmp Password or swipe finger: aaron@kratos:~$ ls -ld ~/tmp drwxr-xr-x 2 aaron root 4096 2008-01-30 07:24 /home/aaron/tmp aaron@kratos:~$ chmod g+s ~/tmp aaron@kratos:~$ ls -ld ~/tmp drwxr-xr-x 2 aaron root 4096 2008-01-30 07:24 /home/aaron/tmp aaron@kratos:~$ chmod g+s ~/tmp aaron@kratos:~$ echo $? 0 Obviously, it's not setting the SGID (drwxr-sr-x), as I am not a member of the 'root' group. This is expected behavior. However, it's also not sending a permission denied error to STDERR as I would expect. As we can see from the exit status, it is telling me, by returning a zero, that it has succeeded, which of course it hasn't. chmod is not setting the correct exit code upon SGID directory failure. For example, follow along below. This not only affects Ubuntu, but I assume Linux in general, as I've duplicated the bug on Debian and Red Hat, the two largest forked distros. aaron@kratos:~$ mkdir ~/tmp aaron@kratos:~$ ls -ld ~/tmp drwxr-xr-x 2 aaron aaron 4096 2008-01-30 07:24 /home/aaron/tmp aaron@kratos:~$ sudo chown .root ~/tmp Password or swipe finger: aaron@kratos:~$ ls -ld ~/tmp drwxr-xr-x 2 aaron root 4096 2008-01-30 07:24 /home/aaron/tmp aaron@kratos:~$ chmod g+s ~/tmp aaron@kratos:~$ ls -ld ~/tmp drwxr-xr-x 2 aaron root 4096 2008-01-30 07:24 /home/aaron/tmp aaron@kratos:~$ chmod g+s ~/tmp aaron@kratos:~$ echo $? 0 Obviously, it's not setting the SGID (drwxr-sr-x), as I am not a member of the 'root' group. This is expected behavior. However, it's also not sending a permission denied error to STDERR as I would expect. As we can see from the exit status, it is telling me, by returning a zero, that it has succeeded, which of course it hasn't.
2008-11-04 00:03:43 C de-Avillez coreutils: status New Triaged
2008-11-04 00:03:43 C de-Avillez coreutils: importance Undecided Low
2008-11-04 00:03:43 C de-Avillez coreutils: statusexplanation Marking as triaged -- Ondřej's proposed patch is waiting approval upstream.