Bug 1032562
Summary: | Augeas save does not create directory when needed | ||
---|---|---|---|
Product: | Red Hat Enterprise Linux 7 | Reporter: | Jakub Filak <jfilak> |
Component: | augeas | Assignee: | Dominic Cleal <dcleal> |
Status: | CLOSED WONTFIX | QA Contact: | Virtualization Bugs <virt-bugs> |
Severity: | unspecified | Docs Contact: | |
Priority: | unspecified | ||
Version: | 7.0 | CC: | bfan, jberan, leiwang, lkong |
Target Milestone: | rc | ||
Target Release: | --- | ||
Hardware: | Unspecified | ||
OS: | Unspecified | ||
Whiteboard: | |||
Fixed In Version: | Doc Type: | Bug Fix | |
Doc Text: | Story Points: | --- | |
Clone Of: | Environment: | ||
Last Closed: | 2014-07-10 07:01:31 UTC | Type: | Bug |
Regression: | --- | Mount Type: | --- |
Documentation: | --- | CRM: | |
Verified Versions: | Category: | --- | |
oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |
Cloudforms Team: | --- | Target Upstream Version: | |
Embargoed: |
Description
Jakub Filak
2013-11-20 11:57:00 UTC
Can reproduce with augeas-1.1.0-6.el7 Steps to reproduce: [host-b]#mkdir -p /tmp/root/etc [host-b]# augtool -r /tmp/root/ augtool> set /files/etc/ssh/sshd_config/X11Forwarding yes augtool> save error: Failed to execute command saving failed (run 'print /augeas//error' for details) augtool> print /augeas/files/etc/ssh/sshd_config/ /augeas/files/etc/ssh/sshd_config /augeas/files/etc/ssh/sshd_config/path = "/files/etc/ssh/sshd_config" /augeas/files/etc/ssh/sshd_config/mtime = "0" /augeas/files/etc/ssh/sshd_config/lens = "@Sshd" /augeas/files/etc/ssh/sshd_config/lens/info = "/usr/share/augeas/lenses/dist/sshd.aug:123.12-125.36:" /augeas/files/etc/ssh/sshd_config/error = "mk_augtemp" /augeas/files/etc/ssh/sshd_config/error/message = "No such file or directory" augtool> quit [host-b]#mkdir -p /tmp/root/etc/ssh [host-b]#augtool -r /tmp/root/ augtool> set /files/etc/ssh/sshd_config/X11Forwarding yes augtool> save Saved 1 file(s) augtool> quit [host-b]#cat /tmp/root/etc/ssh/sshd_config X11Forwarding yes After discussing with SRT, I'm unsure now that there's any precedence for doing this, so am inclined to reject the request. Usually text editors (thinking vim etc), shells (I/O redirection) or utilities (touch) won't create parent directories if you request that they create a file in a directory that doesn't yet exist. Just on this point, I don't think that Augeas should be any different. The only case that SRT could think of was perhaps Webmin, but I wouldn't compare Augeas to Webmin. Unlike SELinux contexts, we don't have a database of any sort to know what the correct permissions and ownership should be. The umask would be a fairly safe bet, but I'd say this behaviour would still be unusual and possibly unexpected. The thread linked in the description does detail many of the risks. The only outcome that David suggests to be reasonable is adding metadata to the tree for ownership, mode etc, but this feels a bit complex to me, and probably wouldn't be used in practice (at least not in your simple example). This request was not resolved in time for the current release. Red Hat invites you to ask your support representative to propose this request, if still desired, for consideration in the next release of Red Hat Enterprise Linux. |