Bugzilla – Bug 878
sudo segfaults when "Defaults mailerpath" is set in sudoers
Last modified: 2019-10-14 10:35:21 MDT
I'm on Arch Linux. My sudoers include these lines: Defaults mail_always Defaults mailerpath=/usr/bin/sendmail Whenever I execute a sudo command, it runs fine but no e-mail is sent. These lines appear in the system journal: Apr 18 13:19:02 plankton kernel: sudo[590]: segfault at 0 ip 00007ff2c77b36e5 sp 00007ffc664bb8c8 error 4 in libc-2.28.so[7ff2c7676000+14b000] Apr 18 13:19:02 plankton kernel: Code: 00 00 0f 1f 00 31 c0 c5 f8 77 c3 66 2e 0f 1f 84 00 00 00 00 00 f3 0f 1e fa 89 f9 48 89 fa c5 f9 ef c0 83 e1 3f 83 f9 20 77 2b <c5> fd 74 0f c5 fd d7 c1 85 c0 0f 85 eb 00 00 00 48 83 c7 20 83 e1 Please let me know what further information you need from me.
Possibly related: Arch upgraded glibc 2.28 last week. But I hadn't been running this configuration before today, so I can't tell you if it worked before. I tried downgrading glibc and sudo but I still get the error.
Do you have mailerflags set in sudoers as well?
No other mail-related commands in my sudoers. I can post the whole thing if you like, it's only a few lines. Also, I tried changing the mailerpath to a script that just records the arguments to see how it was invoking sendmail. The script didn't execute at all, so it looks like this segfault is happening before the invocation.
Thanks, that is helpful. I haven't been able to reproduce this on other Linux systems so I installed arch linux in a VM and can reproduce it there. However, if I rebuild sudo from source the crash no longer occurs.
I see the problem. Since sendmail was not detected during build, mailerflags was not set. You can work around this by adding: Defaults mailerflags="-t" to sudoers. I have committed a fix for the issue: https://www.sudo.ws/repos/sudo/rev/6c57f5ddca54
Fixed in sudo 1.8.28