Bug 1652543 - cvtsudoers filters out some user defaults when filtering by a group
Summary: cvtsudoers filters out some user defaults when filtering by a group
Keywords:
Status: CLOSED WONTFIX
Alias: None
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: sudo
Version: 7.6
Hardware: Unspecified
OS: Linux
medium
medium
Target Milestone: rc
: ---
Assignee: Radovan Sroka
QA Contact: BaseOS QE Security Team
URL:
Whiteboard:
Depends On:
Blocks: 1683581
TreeView+ depends on / blocked
 
Reported: 2018-11-22 10:44 UTC by Dalibor Pospíšil
Modified: 2019-02-27 09:27 UTC (History)
7 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of: 1652541
: 1683581 (view as bug list)
Environment:
Last Closed: 2019-02-27 09:27:04 UTC
Target Upstream Version:


Attachments (Terms of Use)

Description Dalibor Pospíšil 2018-11-22 10:44:46 UTC
+++ This bug was initially created as a clone of Bug #1652541 +++

Description of problem:
When filtering the output by a group, some user bound defaults are removed too even cvtsudoers cannot know in advance that the user used in those default rules is or in not a member of that group. The actual presence of that user in the specified group does not make any change.
Cvtsudoers should preserve all the user bound defaults when filering by a group the same as if fintering by a host.

Version-Release number of selected component (if applicable):
sudo-1.8.23-3.el7

How reproducible:
100%

Steps to Reproduce:
1. cvtsudoers -f sudoers -m group=wheel << 'EOF'
Defaults syslog=auth
Defaults>root !set_logname
Defaults:FULLTIMERS !lecture
Defaults:millert !authenticate
Defaults@SERVERS log_year, logfile=/var/log/sudo.log

Host_Alias CDROM = orion, perseus, hercules
Host_Alias SERVERS = master, mail, www, ns

%wheel ALL = (ALL) ALL
ALL CDROM = NOPASSWD: /sbin/umount /CDROM, /sbin/mount -o nosuid\,nodev /dev/cdrom /CDROM
EOF

Actual results:
Defaults syslog=auth
Defaults>root !set_logname
Defaults@SERVERS log_year, logfile=/var/log/sudo.log

Host_Alias CDROM = orion, perseus, hercules
Host_Alias SERVERS = master, mail, www, ns

%wheel ALL = (ALL) ALL

ALL CDROM = NOPASSWD: /sbin/umount /CDROM, /sbin/mount -o nosuid\,nodev\
    /dev/cdrom /CDROM


Expected results:
Defaults syslog=auth
Defaults>root !set_logname
Defaults:FULLTIMERS !lecture
Defaults:millert !authenticate
Defaults@SERVERS log_year, logfile=/var/log/sudo.log

Host_Alias CDROM = orion, perseus, hercules
Host_Alias SERVERS = master, mail, www, ns

%wheel ALL = (ALL) ALL
ALL CDROM = NOPASSWD: /sbin/umount /CDROM, /sbin/mount -o nosuid\,nodev /dev/cdrom /CDROM

Comment 1 Daniel Kopeček 2019-02-27 09:27:04 UTC
This Bugzilla has been reviewed by Red Hat and is not planned on being addressed in Red Hat Enterprise Linux 7 and therefore will be closed. If this bug is critical to production systems, please contact your Red Hat support representative and provide sufficient business justification.


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