Public bug reported: 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.
[EMAIL PROTECTED]:~$ mkdir ~/tmp [EMAIL PROTECTED]:~$ ls -ld ~/tmp drwxr-xr-x 2 aaron aaron 4096 2008-01-30 07:24 /home/aaron/tmp [EMAIL PROTECTED]:~$ sudo chown .root ~/tmp Password or swipe finger: [EMAIL PROTECTED]:~$ ls -ld ~/tmp drwxr-xr-x 2 aaron root 4096 2008-01-30 07:24 /home/aaron/tmp [EMAIL PROTECTED]:~$ chmod g+s ~/tmp [EMAIL PROTECTED]:~$ ls -ld ~/tmp drwxr-xr-x 2 aaron root 4096 2008-01-30 07:24 /home/aaron/tmp [EMAIL PROTECTED]:~$ chmod g+s ~/tmp [EMAIL PROTECTED]:~$ 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. ** Affects: coreutils (Ubuntu) Importance: Undecided Status: New ** Summary changed: - SGID not returning right exit code on failure + chmod not returning right exit code on SGID directory failure ** Description changed: - 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. + 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. [EMAIL PROTECTED]:~$ mkdir ~/tmp [EMAIL PROTECTED]:~$ ls -ld ~/tmp drwxr-xr-x 2 aaron aaron 4096 2008-01-30 07:24 /home/aaron/tmp [EMAIL PROTECTED]:~$ sudo chown .root ~/tmp Password or swipe finger: [EMAIL PROTECTED]:~$ ls -ld ~/tmp drwxr-xr-x 2 aaron root 4096 2008-01-30 07:24 /home/aaron/tmp [EMAIL PROTECTED]:~$ chmod g+s ~/tmp [EMAIL PROTECTED]:~$ ls -ld ~/tmp drwxr-xr-x 2 aaron root 4096 2008-01-30 07:24 /home/aaron/tmp [EMAIL PROTECTED]:~$ chmod g+s ~/tmp [EMAIL PROTECTED]:~$ 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 not returning right exit code on SGID directory failure https://bugs.launchpad.net/bugs/187315 You received this bug notification because you are a member of Ubuntu Bugs, which is the bug contact for Ubuntu. -- ubuntu-bugs mailing list ubuntu-bugs@lists.ubuntu.com https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs