[augeas-devel] Re: [Augeas] #7: match lists nodes that do not exist
Augeas
trac at fedorahosted.org
Thu Dec 11 11:20:16 UTC 2008
#7: match lists nodes that do not exist
----------------------+-----------------------------------------------------
Reporter: raphink | Owner: lutter
Type: defect | Status: assigned
Priority: major | Milestone: next
Component: Augeas | Version: 0.2.2
Resolution: | Keywords:
----------------------+-----------------------------------------------------
Comment (by ddumont):
I've found the same behavior with sshd lenses and a small sshd_config
file. The bug looks related to the generation of the index between square
brackets.
When playing with augtool and sshd lense, I've found that:
* print gives correct result
* print /files/etc/ssh/sshd_config/Match/Condition is wrong (messed up
indexes in Condition)
* match /files/etc/ssh/sshd_config/Match/Condition is wrong
In more details, 2 wrong outputs:
{{{
augtool> match /files/etc/ssh/sshd_config/Match/Condition
/files/etc/ssh/sshd_config/Match[1]/Condition = (none)
/files/etc/ssh/sshd_config/Match[2]/Condition[1] = (none)
/files/etc/ssh/sshd_config/Match[2]/Condition[2] = (none)
/files/etc/ssh/sshd_config/Match[3]/Condition[2] = (none)
/files/etc/ssh/sshd_config/Match[3]/Condition[3] = (none)
/files/etc/ssh/sshd_config/Match[3]/Condition[4] = (none)
augtool> print /files/etc/ssh/sshd_config/Match/Condition
/files/etc/ssh/sshd_config/Match[1]/Condition
/files/etc/ssh/sshd_config/Match[1]/Condition/User = "domi"
/files/etc/ssh/sshd_config/Match[2]/Condition[1]
/files/etc/ssh/sshd_config/Match[2]/Condition[1]/User = "sarko"
/files/etc/ssh/sshd_config/Match[2]/Condition[2]
/files/etc/ssh/sshd_config/Match[2]/Condition[2]/Group = "pres.*"
/files/etc/ssh/sshd_config/Match[3]/Condition[2]
/files/etc/ssh/sshd_config/Match[3]/Condition[2]/User = "bush"
/files/etc/ssh/sshd_config/Match[3]/Condition[3]
/files/etc/ssh/sshd_config/Match[3]/Condition[3]/Group = "pres.*"
/files/etc/ssh/sshd_config/Match[3]/Condition[4]
/files/etc/ssh/sshd_config/Match[3]/Condition[4]/Host = "white.house.*"
}}}
Whereas print result is correct:
{{{
augtool> print
/augeas
/augeas/root = "wr_test/augeas_match/"
/augeas/save = "overwrite"
/augeas/files
/augeas/files/etc
/augeas/files/etc/ssh
/augeas/files/etc/ssh/sshd_config
/augeas/files/etc/ssh/sshd_config/path = "/files/etc/ssh/sshd_config"
/augeas/files/etc/ssh/sshd_config/lens
/augeas/files/etc/ssh/sshd_config/lens/info =
"/usr/share/augeas/lenses/sshd.aug:56.12-58.36"
/augeas/files/etc/ssh/sshd_config/lens/id = "0x94215d0"
/files
/files/etc
/files/etc/ssh
/files/etc/ssh/sshd_config
/files/etc/ssh/sshd_config/X11Forwarding = "yes"
/files/etc/ssh/sshd_config/Match[1]
/files/etc/ssh/sshd_config/Match[1]/Condition
/files/etc/ssh/sshd_config/Match[1]/Condition/User = "domi"
/files/etc/ssh/sshd_config/Match[1]/Settings
/files/etc/ssh/sshd_config/Match[1]/Settings/AllowTcpForwarding = "yes"
/files/etc/ssh/sshd_config/Match[1]/Settings/PasswordAuthentication =
"yes"
/files/etc/ssh/sshd_config/Match[1]/Settings/RhostsRSAAuthentication =
"no"
/files/etc/ssh/sshd_config/Match[1]/Settings/RSAAuthentication = "yes"
/files/etc/ssh/sshd_config/Match[1]/Settings/X11DisplayOffset = "10"
/files/etc/ssh/sshd_config/Match[1]/Settings/X11Forwarding = "yes"
/files/etc/ssh/sshd_config/Match[2]
/files/etc/ssh/sshd_config/Match[2]/Condition[1]
/files/etc/ssh/sshd_config/Match[2]/Condition[1]/User = "sarko"
/files/etc/ssh/sshd_config/Match[2]/Condition[2]
/files/etc/ssh/sshd_config/Match[2]/Condition[2]/Group = "pres.*"
/files/etc/ssh/sshd_config/Match[2]/Settings
/files/etc/ssh/sshd_config/Match[2]/Settings/Banner = "/etc/bienvenue.txt"
/files/etc/ssh/sshd_config/Match[2]/Settings/X11Forwarding = "no"
/files/etc/ssh/sshd_config/Match[3]
/files/etc/ssh/sshd_config/Match[3]/Condition[1]
/files/etc/ssh/sshd_config/Match[3]/Condition[1]/User = "bush"
/files/etc/ssh/sshd_config/Match[3]/Condition[2]
/files/etc/ssh/sshd_config/Match[3]/Condition[2]/Group = "pres.*"
/files/etc/ssh/sshd_config/Match[3]/Condition[3]
/files/etc/ssh/sshd_config/Match[3]/Condition[3]/Host = "white.house.*"
/files/etc/ssh/sshd_config/Match[3]/Settings
/files/etc/ssh/sshd_config/Match[3]/Settings/Banner = "/etc/welcome.txt"
}}}
Unfortunately, this bug breaks the linkage between Config::Model and
Augeas :-(
Hope this helps
--
Ticket URL: <https://fedorahosted.org/augeas/ticket/7#comment:5>
Augeas <http://augeas.net/>
a configuration API
More information about the augeas-devel
mailing list