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 1325741 - cgconfig.aug augeas lens does not handle dperm and fperm in the permissions block
Summary: cgconfig.aug augeas lens does not handle dperm and fperm in the permissions b...
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: augeas
Version: 7.2
Hardware: All
OS: Linux
medium
medium
Target Milestone: rc
: ---
Assignee: Pino Toscano
QA Contact: Virtualization Bugs
URL: https://github.com/hercules-team/auge...
Whiteboard:
Depends On:
Blocks: 1420851
TreeView+ depends on / blocked
 
Reported: 2016-04-11 04:50 UTC by Muhammad Azhar Shaikh
Modified: 2020-07-16 08:44 UTC (History)
2 users (show)

Fixed In Version: augeas-1.4.0-5.el7
Doc Type: Bug Fix
Doc Text:
Prior to this update, Augeas was not able to parse the dperm and fperm keys in permissions blocks in the cgroup configuration (/etc/cgconfig.conf). The cgconfig lens of Augeas has been fixed to parse also the dperm and fperm keys. As a result, Augeas now reads /etc/cgconfig.conf also with dperm and fperm keys in permissions blocks.
Clone Of:
Environment:
Last Closed: 2018-04-10 09:55:26 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Github hercules-team augeas pull 491 0 None None None 2017-09-04 16:54:35 UTC
Red Hat Product Errata RHBA-2018:0684 0 None None None 2018-04-10 09:56:37 UTC

Description Muhammad Azhar Shaikh 2016-04-11 04:50:54 UTC
augeas fails to parse a cgconfig.conf file with the fperm and dperm keys in the task/admin blocks inside a perm block inside a group block.


Red Hat Enterprise Linux Workstation release 7.2 (Maipo)
kernel-3.10.0-327.4.5.el7.x86_64 
augeas-libs-1.4.0-2.el7.x86_64
python-augeas-0.5.0-2.el7.noarch
ruby-augeas-0.5.0-1.el7.x86_64



Here is a success (not trying to use fperm or dperm):

# cat >/var/tmp/succeeds.aug <<EOM
set /files/etc/cgconfig.conf/group[ .= 'new_group' ] 'new_group'
set /files/etc/cgconfig.conf/group[ .= 'new_group' ]/perm/task/uid 'root'
set /files/etc/cgconfig.conf/group[ .= 'new_group' ]/perm/task/gid 'root'
save
EOM

# augtool -f /var/tmp/succeeds.aug -e
augtool> set /files/etc/cgconfig.conf/group[ .= 'new_group' ] 'new_group'
augtool> set /files/etc/cgconfig.conf/group[ .= 'new_group' ]/perm/task/uid 'root'
augtool> set /files/etc/cgconfig.conf/group[ .= 'new_group' ]/perm/task/gid 'root'
augtool> save
Saved 1 file(s)




And here is a failure with the augeas error:

# cat >/var/tmp/fails.aug <<EOM
set /files/etc/cgconfig.conf/group[ .= 'new_group' ] 'new_group'
set /files/etc/cgconfig.conf/group[ .= 'new_group' ]/perm/task/uid 'root'
set /files/etc/cgconfig.conf/group[ .= 'new_group' ]/perm/task/gid 'root'
set /files/etc/cgconfig.conf/group[ .= 'new_group' ]/perm/task/fperm '777'
save
errors
EOM


# augtool -f /var/tmp/fails.aug -e
augtool> set /files/etc/cgconfig.conf/group[ .= 'new_group' ] 'new_group'
augtool> set /files/etc/cgconfig.conf/group[ .= 'new_group' ]/perm/task/uid 'root'
augtool> set /files/etc/cgconfig.conf/group[ .= 'new_group' ]/perm/task/gid 'root'
augtool> set /files/etc/cgconfig.conf/group[ .= 'new_group' ]/perm/task/fperm '777'
augtool> save
error: Failed to execute command
saving failed (run 'errors' for details)
augtool> errors
Error in /etc/cgconfig.conf (put_failed)
  Failed to match

(    { /uid|gid/ = /[^\001-\004\t\n #;{}]+/ }
      | { /#comment/ = /[^\001-\004\t\n\r ][^\001-\004\n]*[^\001-\004\t\n\r ]|[^\001-\004\t\n\r ]/ }
      | { })*
  with tree
    { "uid" = "root" } { "gid" = "root" } { "fperm" = "777" }
  Lens: /usr/share/augeas/lenses/dist/cgconfig.aug:51.7-.49:
augtool>

If I modify /usr/share/augeas/lenses/dist/cgconfig.aug and change (uid|gid) to (uid|gid|fperm|dperm) it can save the file.

Comment 5 YongkuiGuo 2017-10-10 07:42:09 UTC
Verified with package:
augeas-1.4.0-5.el7.x86_64

Steps:

1. #yum install libcgroup-tools (there is no /etc/cgconfig.conf by default on rhel7.4 host. so need to install this package)

2. # augtool 
augtool> set /files/etc/cgconfig.conf/group[ .= 'new_group' ] 'new_group'
augtool> set /files/etc/cgconfig.conf/group[ .= 'new_group' ]/perm/task/uid 'root'
augtool> set /files/etc/cgconfig.conf/group[ .= 'new_group' ]/perm/task/gid 'root'
augtool> set /files/etc/cgconfig.conf/group[ .= 'new_group' ]/perm/task/fperm '777'
augtool> save
Saved 1 file(s)
augtool>


The save command can be executed successfully. No error occurs. Verified it.

Comment 8 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


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