Bug 283

Summary: SIGPIPE crash when sendmail is not installed.
Product: Sudo Reporter: Martin Pitt <martin.pitt>
Component: SudoAssignee: Todd C. Miller <Todd.Miller>
Status: RESOLVED FIXED    
Severity: normal    
Priority: normal    
Version: 1.6.9   
Hardware: PC   
OS: Linux   
URL: https://bugs.launchpad.net/bugs/193516

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.