Bug 1324091 - Sudo mailfrom not working as documented
Summary: Sudo mailfrom not working as documented
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Fedora
Classification: Fedora
Component: sudo
Version: 23
Hardware: x86_64
OS: Linux
unspecified
unspecified
Target Milestone: ---
Assignee: Tomas Sykora
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2016-04-05 13:44 UTC by David Jansen
Modified: 2016-09-27 00:33 UTC (History)
5 users (show)

Fixed In Version: sudo-1.8.18-1.fc24 sudo-1.8.18-1.fc23 sudo-1.8.18-1.fc25
Clone Of:
Environment:
Last Closed: 2016-09-25 00:22:20 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)
Configure option patch (1005 bytes, patch)
2016-07-14 10:08 UTC, Tomas Sykora
no flags Details | Diff
sudo-1.8.17p1-2.fc25.src.rpm (2.69 MB, application/x-rpm)
2016-07-14 10:10 UTC, Tomas Sykora
no flags Details

Description David Jansen 2016-04-05 13:44:37 UTC
Description of problem:

Failed attempts to run 'sudo' result in a mail from root. However, 'man sudoers' mentions that the default should be to send mail as if coming from the user:
     mailfrom      Address to use for the “from” address when sending warning
                   and error mail.  The address should be enclosed in double
                   quotes ("") to protect against sudo interpreting the @
                   sign.  Defaults to the name of the user running sudo.

My reason for wanting the user's mail as sender is, so the system manager (me) can reply to the mail and explain to the user why it didn't work, and other custom suggestions that cannot be included in the default 'lecture'

So, this looks like a discrepancy between the program and its documentation. Fixing the program would be best, but if that is not possible, the documentation may have to be patched to match.

Version-Release number of selected component (if applicable):
sudo-1.8.15-1.fc23.x86_64

How reproducible:

Run 'sudo' as a user that is not authorized in /etc/sudoers

Steps to Reproduce:
1. Install sudo
2. As a non-root user (eg joe), run something like 'sudo bash'
3. As root, read the mail with the "SECURITY information"

Actual results:
The mail to root will also be from root, not from the user joe, so a direct reply is not possible.

Expected results:
Mail from the user that invoked sudo, as documented.

Additional info:
Even hardcoding 'mailfrom' in /etc/sudoers doesn't seem to make a difference, although 'sudo -V' run as root will report this setting if it is present.

Comment 1 Tomas Sykora 2016-07-14 10:08:56 UTC
Created attachment 1179719 [details]
Configure option patch

Hi,
I added --disable-root-mailer configure option to the spec file, it seems that solved the problem. I attach patch for the spec file and srpm so you can test if the current behaviour is OK.

Comment 2 Tomas Sykora 2016-07-14 10:10:08 UTC
Created attachment 1179721 [details]
sudo-1.8.17p1-2.fc25.src.rpm

Comment 4 David Jansen 2016-08-22 15:18:16 UTC
I can confim that the updates spec file fixes this issue. Thanks for the work.

Comment 5 Fedora Update System 2016-09-22 09:55:00 UTC
sudo-1.8.18-1.fc25 has been pushed to the Fedora 25 testing repository. If problems still persist, please make note of it in this bug report.
See https://fedoraproject.org/wiki/QA:Updates_Testing for
instructions on how to install test updates.
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2016-dc73575f3f

Comment 6 Fedora Update System 2016-09-23 06:53:02 UTC
sudo-1.8.18-1.fc23 has been pushed to the Fedora 23 testing repository. If problems still persist, please make note of it in this bug report.
See https://fedoraproject.org/wiki/QA:Updates_Testing for
instructions on how to install test updates.
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2016-f172899668

Comment 7 Fedora Update System 2016-09-23 08:00:56 UTC
sudo-1.8.18-1.fc24 has been pushed to the Fedora 24 testing repository. If problems still persist, please make note of it in this bug report.
See https://fedoraproject.org/wiki/QA:Updates_Testing for
instructions on how to install test updates.
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2016-9db768d012

Comment 8 Fedora Update System 2016-09-25 00:22:20 UTC
sudo-1.8.18-1.fc24 has been pushed to the Fedora 24 stable repository. If problems still persist, please make note of it in this bug report.

Comment 9 Fedora Update System 2016-09-25 20:49:11 UTC
sudo-1.8.18-1.fc23 has been pushed to the Fedora 23 stable repository. If problems still persist, please make note of it in this bug report.

Comment 10 Fedora Update System 2016-09-27 00:33:54 UTC
sudo-1.8.18-1.fc25 has been pushed to the Fedora 25 stable repository. If problems still persist, please make note of it in this bug report.


Note You need to log in before you can comment on or make changes to this bug.