Bugzilla – Bug 396
Error message unrelated to cause
Last modified: 2011-03-03 09:56:33 MST
When the setting "requiretty" blocks an attempt to use sudo without a tty, the error message is "sudo: must be setuid root\n". This error is unrelated to the cause which is a permission failure as configured in sudoers. It would be very useful for troubleshooting if sudo gave an error advising why permission was denied rather than the red herring setuid message.
That error message is only printed when the effective uid of the process is non-zero; it has nothing whatsoever to do with requiretty.
Regardless of the intent, my point is that if requiretty is invoked, this is the error message that is provided. Can this not be caught elsewise and error before hitting the non-zero error?
Unable to reproduce in sudo 1.7.5 or 1.8.0.