Bug 492274 - Augeas can't write sudoers
Summary: Augeas can't write sudoers
Keywords:
Status: CLOSED UPSTREAM
Alias: None
Product: Fedora EPEL
Classification: Fedora
Component: augeas
Version: el5
Hardware: All
OS: Linux
low
medium
Target Milestone: ---
Assignee: David Lutterkort
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2009-03-26 10:22 UTC by Sergio Pascual
Modified: 2013-04-30 23:40 UTC (History)
3 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2009-04-24 16:38:46 UTC
Type: ---
Embargoed:


Attachments (Terms of Use)
Output of strace (141.62 KB, text/plain)
2009-03-26 10:22 UTC, 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 09:39 UTC, Sergio Pascual
no flags Details

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


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