Bug 492274 - Augeas can't write sudoers
Augeas can't write sudoers
Status: CLOSED UPSTREAM
Product: Fedora EPEL
Classification: Fedora
Component: augeas (Show other bugs)
el5
All Linux
low Severity medium
: ---
: ---
Assigned To: David Lutterkort
Fedora Extras Quality Assurance
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2009-03-26 06:22 EDT by Sergio Pascual
Modified: 2013-04-30 19:40 EDT (History)
3 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2009-04-24 12:38:46 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)
Output of strace (141.62 KB, text/plain)
2009-03-26 06:22 EDT, Sergio Pascual
no flags Details
Ouput of strace with print /files/etc/sudoers and print /augeas/files/etc/sudoers (153.96 KB, application/octet-stream)
2009-03-27 05:39 EDT, Sergio Pascual
no flags Details

  None (edit)
Description Sergio Pascual 2009-03-26 06:22:28 EDT
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 15:21:42 EDT
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 05:36:42 EDT
# 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 05:39:02 EDT
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 19:24:47 EDT
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 19:47:41 EDT
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 14:19:21 EDT
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 04:00:00 EDT
David, it works with augeas 0.5.0. Thanks

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