Bug 492274

Summary: Augeas can't write sudoers
Product: [Fedora] Fedora EPEL Reporter: Sergio Pascual <sergio.pasra>
Component: augeasAssignee: David Lutterkort <lutter>
Status: CLOSED UPSTREAM QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: medium Docs Contact:
Priority: low    
Version: el5CC: apevec, hbrock, lutter
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2009-04-24 16:38:46 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Attachments:
Description Flags
Output of strace
none
Ouput of strace with print /files/etc/sudoers and print /augeas/files/etc/sudoers none

Description Sergio Pascual 2009-03-26 10:22:28 UTC
Created attachment 336775 [details]
Output of strace

This works fine in fedora 10 and 9

# augtool 
augtool> set /files/etc/sudoers/spec[801]/user foo
augtool> set /files/etc/sudoers/spec[last()]/host_group/host ALL
augtool> set /files/etc/sudoers/spec[last()]/host_group/command ALL
augtool> save
Saved 1 file(s)
augtool>

but it's not working in el5
# augtool 
augtool> set /files/etc/sudoers/spec[801]/user foo
augtool> set /files/etc/sudoers/spec[last()]/host_group/host ALL
augtool> set /files/etc/sudoers/spec[last()]/host_group/command ALL
augtool> save
Saving failed
augtool>

Versions:
augeas-0.3.6-2.el5
sudo-1.6.8p12-12.el5


The ouput of strace augeas is attached

Comment 1 David Lutterkort 2009-03-26 19:21:42 UTC
Can you also add the following to commands at the end of your little test script:

  augtool> print /files/etc/sudoers/spec[last()]
  augtool> print /augeas/files/etc/sudoers

and add that output from the EL5 machine.

Comment 2 Sergio Pascual 2009-03-27 09:36:42 UTC
# augtool 
augtool> set /files/etc/sudoers/spec[801]/user foo
augtool> set /files/etc/sudoers/spec[last()]/host_group/host ALL
augtool> set /files/etc/sudoers/spec[last()]/host_group/command ALL
augtool> print /files/etc/sudoers/spec[last()]
/files/etc/sudoers/spec
/files/etc/sudoers/spec/user = "foo"
/files/etc/sudoers/spec/host_group
/files/etc/sudoers/spec/host_group/host = "ALL"
/files/etc/sudoers/spec/host_group/command = "ALL"
augtool> print /augeas/files/etc/sudoers
/augeas/files/etc/sudoers
/augeas/files/etc/sudoers/path = "/files/etc/sudoers"
/augeas/files/etc/sudoers/lens
/augeas/files/etc/sudoers/lens/info = "/usr/share/augeas/lenses/sudoers.aug:339.10-.57"
/augeas/files/etc/sudoers/lens/id = "0x81095a8"
/augeas/files/etc/sudoers/error = "parse_failed"
/augeas/files/etc/sudoers/error/pos = "1848"
/augeas/files/etc/sudoers/error/message = "Short iteration"
augtool> save
Saving failed
augtool>

Comment 3 Sergio Pascual 2009-03-27 09:39:02 UTC
Created attachment 336986 [details]
Ouput of strace with print /files/etc/sudoers and print /augeas/files/etc/sudoers

Comment 4 David Lutterkort 2009-03-27 23:24:47 UTC
The problem is that the sudoers lens fails reading the sudoers file on startup (the failure is around character 1848 in the file) - that's what the entries under /augeas/files/etc/sudoers/error are saying

When you subsequently change some entries and try to save, the tree is incomplete and saving fails for that reason.

The big question now is why it's not reading your sudoers file - we have a bunch of fixes queued up for 0.5.0 that _might_ address that.

Is your sudoers changed in any way or is it the stock file from EL5 ?

Comment 5 Sergio Pascual 2009-03-27 23:47:41 UTC
Just to be sure, I uninstalled sudo and then reinstalled again, augeas is  still failing in the same place, in the sudoers from rpm without modification

Comment 6 David Lutterkort 2009-04-02 18:19:21 UTC
Could you try again with augeas-0.5.0 ? If it still fails, please add the result of "print /augeas//error" to this bug.

Comment 7 Sergio Pascual 2009-04-24 08:00:00 UTC
David, it works with augeas 0.5.0. Thanks