Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.
RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.

Bug 1483888

Summary: sudoers lens fails to parse match_group_by_gid option
Product: Red Hat Enterprise Linux 7 Reporter: Vinay Mishra <vmishra>
Component: augeasAssignee: Pino Toscano <ptoscano>
Status: CLOSED ERRATA QA Contact: Virtualization Bugs <virt-bugs>
Severity: high Docs Contact:
Priority: high    
Version: 7.4CC: cdonnell, cww, jherrman, ltoscano, mryodatak, mtessun, pasik, pgrist, rjones, tenobreg, xchen, yoguo
Target Milestone: rcKeywords: Regression, Triaged, ZStream
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: augeas-1.4.0-3.el7 Doc Type: Bug Fix
Doc Text:
Prior to this update, Augeas was not able to read the default /etc/sudoers file provided by more recent versions of the sudo utility. The sudoers lens of Augeas has been fixed to parse also the match_group_by_gid option. As a result, Augeas now reads default /etc/sudoers as expected.
Story Points: ---
Clone Of:
: 1493005 (view as bug list) Environment:
Last Closed: 2018-04-10 09:55:26 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 1493005    

Description Vinay Mishra 2017-08-22 08:36:54 UTC
Description of problem:

augeas is no longer parse the /etc/sudoers file.

The problem is that the newer version of sudo adds the following line to /etc/sudoers:

Defaults    match_group_by_gid

Version-Release number of selected component (if applicable):
RHEL7.4
sudo-1.8.19p2-10.el7.x86_64

How reproducible:
Update to sudo package to sudo-1.8.19p2-10.el7.x86_64

And install the augeas package:
---
# yum install augeas
---

run below command:
---
# echo "print /files/etc/sudoers" | augtool
---

Actual results:
# echo "print /files/etc/sudoers" | augtool

no output in it

Expected results:
-------
# echo "print /files/etc/sudoers" | augtool
/files/etc/sudoers
/files/etc/sudoers/#comment[1] = "# Sudoers allows particular users to run various commands as"
/files/etc/sudoers/#comment[2] = "# the root user, without needing the root password."
/files/etc/sudoers/#comment[3] = "#"
/files/etc/sudoers/#comment[4] = "# Examples are provided at the bottom of the file for collections"
/files/etc/sudoers/#comment[5] = "# of related commands, which can then be delegated out to particular"
/files/etc/sudoers/#comment[6] = "# users or groups."
/files/etc/sudoers/#comment[7] = "#"
/files/etc/sudoers/#comment[8] = "# This file must be edited with the 'visudo' command."
/files/etc/sudoers/#comment[9] = "# Host Aliases"
/files/etc/sudoers/#comment[10] = "# Groups of machines. You may prefer to use hostnames (perhaps using"
/files/etc/sudoers/#comment[11] = "# wildcards for entire domains) or IP addresses instead."
/files/etc/sudoers/#comment[12] = "Host_Alias     FILESERVERS = fs1, fs2"
/files/etc/sudoers/#comment[13] = "Host_Alias     MAILSERVERS = smtp, smtp2"
/files/etc/sudoers/#comment[14] = "# User Aliases"
...
...
-------
augeas should parse the /etc/sudoers file.


Additional info:

Comment 3 Pino Toscano 2017-08-24 14:15:15 UTC
*** Bug 1484557 has been marked as a duplicate of this bug. ***

Comment 4 Pino Toscano 2017-08-24 14:16:22 UTC
*** Bug 1484886 has been marked as a duplicate of this bug. ***

Comment 6 Pino Toscano 2017-08-24 14:44:08 UTC
Let's give this bug a better summary, so it's easier to search.

Comment 7 YongkuiGuo 2017-08-25 08:29:32 UTC
Reproduced it with the package of sudo-1.8.19p2-10.el7.x86_64.

Steps:
1. On rhel7.4 host
#augtool -e "print /files/etc/sudoers"

There is no output. augeas cannot parse the /etc/sudoers file.

Comment 13 mryodatak 2017-09-19 14:26:16 UTC
Any way to test the augeas-1.4.0-3.el7 ? i can't find it on epel ? I start a issue here #1493174

Comment 14 Richard W.M. Jones 2017-09-19 14:32:13 UTC
I've uploaded them here:

http://oirase.annexia.org/tmp/bz1483888/

Comment 15 mryodatak 2017-09-19 15:35:22 UTC
sorry but your rpm file its in fact a html file :

<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
<html><head>
<title>302 Found</title>
</head><body>
<h1>Found</h1>
<p>The document has moved <a href="http://download-ipv4.eng.brq.redhat.com/brewroot/packages/augeas/1.4.0/4.el7/x86_64/augeas-1.4.0-4.el7.x86_64.rpm">here</a>.</p>
</body></html>


Thanks by advance

Comment 16 Richard W.M. Jones 2017-09-19 15:37:40 UTC
Grrr ‘brew download-build’ is broken ...

Will reupload in a few mins.

Comment 17 mryodatak 2017-09-19 16:00:13 UTC
I juste test this fix its works like a charm , when did this gonna be relase in epel repository for Centos 7 ?

Comment 18 Richard W.M. Jones 2017-09-19 16:03:34 UTC
It'll be in RHEL 7.4-z in a few weeks, and then CentOS 7.5 in a few
months.

Comment 19 YongkuiGuo 2017-09-20 03:13:52 UTC
Verified with the packages:
sudo-1.8.19p2-10.el7.x86_64
augeas-1.4.0-4.el7.x86_64


Steps:
1. On rhel7.4 host
#augtool -e "print /files/etc/sudoers"
----------------------------------------
augtool> print /files/etc/sudoers 
/files/etc/sudoers
/files/etc/sudoers/#comment[1] = "# Sudoers allows particular users to run various commands as"
/files/etc/sudoers/#comment[2] = "# the root user, without needing the root password."
/files/etc/sudoers/#comment[3] = "#"
/files/etc/sudoers/#comment[4] = "# Examples are provided at the bottom of the file for collections"
/files/etc/sudoers/#comment[5] = "# of related commands, which can then be delegated out to particular"
/files/etc/sudoers/#comment[6] = "# users or groups."
/files/etc/sudoers/#comment[7] = "#"
/files/etc/sudoers/#comment[8] = "# This file must be edited with the 'visudo' command."
/files/etc/sudoers/#comment[9] = "# Host Aliases"
/files/etc/sudoers/#comment[10] = "# Groups of machines. You may prefer to use hostnames (perhaps using"
/files/etc/sudoers/#comment[11] = "# wildcards for entire domains) or IP addresses instead."
/files/etc/sudoers/#comment[12] = "Host_Alias     FILESERVERS = fs1, fs2"
/files/etc/sudoers/#comment[13] = "Host_Alias     MAILSERVERS = smtp, smtp2"
/files/etc/sudoers/#comment[14] = "# User Aliases"
/files/etc/sudoers/#comment[15] = "# These aren't often necessary, as you can use regular groups"
/files/etc/sudoers/#comment[16] = "# (ie, from files, LDAP, NIS, etc) in this file - just use %groupname"
/files/etc/sudoers/#comment[17] = "# rather than USERALIAS"
/files/etc/sudoers/#comment[18] = "User_Alias ADMINS = jsmith, mikem"
/files/etc/sudoers/#comment[19] = "# Command Aliases"
/files/etc/sudoers/#comment[20] = "# These are groups of related commands..."
/files/etc/sudoers/#comment[21] = "# Networking"
/files/etc/sudoers/#comment[22] = "Cmnd_Alias NETWORKING = /sbin/route, /sbin/ifconfig, /bin/ping, /sbin/dhclient, /usr/bin/net, /sbin/iptables, /usr/bin/rfcomm, /usr/bin/wvdial, /sbin/iwconfig, /sbin/mii-tool"
/files/etc/sudoers/#comment[23] = "# Installation and management of software"
/files/etc/sudoers/#comment[24] = "Cmnd_Alias SOFTWARE = /bin/rpm, /usr/bin/up2date, /usr/bin/yum"
/files/etc/sudoers/#comment[25] = "# Services"
/files/etc/sudoers/#comment[26] = "Cmnd_Alias SERVICES = /sbin/service, /sbin/chkconfig, /usr/bin/systemctl start, /usr/bin/systemctl stop, /usr/bin/systemctl reload, /usr/bin/systemctl restart, /usr/bin/systemctl status, /usr/bin/systemctl enable, /usr/bin/systemctl disable"
/files/etc/sudoers/#comment[27] = "# Updating the locate database"
/files/etc/sudoers/#comment[28] = "Cmnd_Alias LOCATE = /usr/bin/updatedb"
/files/etc/sudoers/#comment[29] = "# Storage"
/files/etc/sudoers/#comment[30] = "Cmnd_Alias STORAGE = /sbin/fdisk, /sbin/sfdisk, /sbin/parted, /sbin/partprobe, /bin/mount, /bin/umount"
/files/etc/sudoers/#comment[31] = "# Delegating permissions"
/files/etc/sudoers/#comment[32] = "Cmnd_Alias DELEGATING = /usr/sbin/visudo, /bin/chown, /bin/chmod, /bin/chgrp"
/files/etc/sudoers/#comment[33] = "# Processes"
/files/etc/sudoers/#comment[34] = "Cmnd_Alias PROCESSES = /bin/nice, /bin/kill, /usr/bin/kill, /usr/bin/killall"
/files/etc/sudoers/#comment[35] = "# Drivers"
/files/etc/sudoers/#comment[36] = "Cmnd_Alias DRIVERS = /sbin/modprobe"
/files/etc/sudoers/#comment[37] = "Defaults specification"
/files/etc/sudoers/#comment[38] = "Refuse to run if unable to disable echo on the tty."
/files/etc/sudoers/Defaults[1]
/files/etc/sudoers/Defaults[1]/visiblepw
/files/etc/sudoers/Defaults[1]/visiblepw/negate
/files/etc/sudoers/#comment[39] = "Preserving HOME has security implications since many programs"
/files/etc/sudoers/#comment[40] = "use it when searching for configuration files. Note that HOME"
/files/etc/sudoers/#comment[41] = "is already set when the the env_reset option is enabled, so"
/files/etc/sudoers/#comment[42] = "this option is only effective for configurations where either"
/files/etc/sudoers/#comment[43] = "env_reset is disabled or HOME is present in the env_keep list."
/files/etc/sudoers/Defaults[2]
/files/etc/sudoers/Defaults[2]/always_set_home
/files/etc/sudoers/Defaults[3]
/files/etc/sudoers/Defaults[3]/match_group_by_gid
...
...

----------------------------------------
Sudoers lens can parse match_group_by_gid option normally. Verified it.

Comment 22 errata-xmlrpc 2018-04-10 09:55:26 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHBA-2018:0684