Bug 283 - SIGPIPE crash when sendmail is not installed.
SIGPIPE crash when sendmail is not installed.
Status: RESOLVED FIXED
Product: Sudo
Classification: Unclassified
Component: Sudo
1.6.9
PC Linux
: normal normal
Assigned To: Todd C. Miller
https://bugs.launchpad.net/bugs/193516
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2008-03-17 07:12 MDT by Martin Pitt
Modified: 2008-03-17 11:10 MDT (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Martin Pitt 2008-03-17 07:12:57 MDT
This was reported originally in https://bugs.launchpad.net/bugs/193516:

When sudo is used in an environment where /usr/sbin/sendmail is not installed, it is subject to a race condition that makes the forked process in logging.c, send_mail() (which is execve'ing sendmail) exit(127) quickly, and thus the following write() produces a SIGPIPE:

  kolon[i686]:~/doc> sudo ls
  [sudo] password for mast:
  Broken pipe

forked process:
execve("/usr/sbin/sendmail", ["/usr/sbin/sendmail", "-t"], [/* 4 vars */]) = -1 ENOENT (No such file or directory)
exit_group(127) = ?

main process:
write(5, "To: root\nFrom: mast\nSubject: ***"..., 176) = -1 EPIPE (Broken pipe)
--- SIGPIPE (Broken pipe) @ 0 (0) ---
+++ killed by SIGPIPE +++

This should be handled gracefully, and instead sudo should print the usual warning about "martin is not in the sudoers file. This incident will be reported."
Comment 1 Todd C. Miller 2008-03-17 11:10:56 MDT
Thanks, I've fixed this in cvs.  The fix w ill appear in the next sudo release.