[krbdev.mit.edu #8618] ksu doesn't exit nonzero

Todd Lubin via RT rt-comment at krbdev.mit.edu
Wed Nov 1 16:12:56 EDT 2017


There is a bug in ksu where it fails to exit with a nonzero status if it
forks a child to run the command and the child exits nonzero.

For example:
$ su user1
$ echo 'user2 at REALM *' > ~/.k5users
$ su user2
$ kinit user2
$ ksu user1 -e /file-that-does-not-exist

In the above example, ksu exits with status code 0.

The problem is that ksu calls:

waitpid(child_pid, &statusp, WUNTRACED)
and
exit (statusp);

but should be calling:
exit (WEXITSTATUS(statusp));

Best,
Todd



More information about the krb5-bugs mailing list