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:


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.