Description of problem: Augeas can not parse default /root/.ssh/known_hosts Augeas in RHEL works well with the same known_hosts file. Version-Release number of selected component (if applicable): augeas-1.3.0-1.fc22.x86_64 How reproducible: 100% Steps to Reproduce: 1. Copy attachment file: know_hosts to /root/.ssh/known_hosts (Backup your known_hosts first) 2. Run command: echo 'print /augeas//error' | augtool # augtool print /augeas//error Actual results: # augtool print /augeas//error ... /augeas/files/root/.ssh/known_hosts/error = "parse_failed" /augeas/files/root/.ssh/known_hosts/error/pos = "0" /augeas/files/root/.ssh/known_hosts/error/line = "1" /augeas/files/root/.ssh/known_hosts/error/char = "0" /augeas/files/root/.ssh/known_hosts/error/lens = "/usr/share/augeas/lenses/dist/known_hosts.aug:44.10-.46:" /augeas/files/root/.ssh/known_hosts/error/message = "Iterated lens matched less than it should" ... Expected results: No errors Additional info: The attachment is file /root/.ssh/known_hosts
Created attachment 1016273 [details] /root/.ssh/known_hosts
It fails on the first field, which is a comma-separated hostname,IP pair. The regexp only expects a value without commas. I'm unsure whether to split it into two fields, or parse as a single value.
Dominic's analysis of the problem is spot on; looking at the tree structure, it's really not flexible enough to expose multiple host names uniformly so that querying is easy. I am almost tempted to break backwards compatibility and change the tree to something like { "1" { "hostname" = ... } { "hostname" = ... }* { "type" = ... } { "key" = .. } }
(In reply to lutter from comment #3) > I am almost tempted to break backwards compatibility and change the tree to > something like > > { "1" > { "hostname" = ... } > { "hostname" = ... }* > { "type" = ... } > { "key" = .. } } Yeah, I think this would be best. Reading sshd(8), it says this is simply a comma-separated list of multiple hostnames, so this representation would make the most sense.
https://github.com/hercules-team/augeas/commit/0cf81830cdb404c7fa4107d080f094b9cb30ee18 added the following comma-separated values as aliases rather than changing the tree representation entirely.
augeas-1.4.0-1.fc22 has been submitted as an update for Fedora 22. https://admin.fedoraproject.org/updates/augeas-1.4.0-1.fc22
Package augeas-1.4.0-1.fc22: * should fix your issue, * was pushed to the Fedora 22 testing repository, * should be available at your local mirror within two days. Update it with: # su -c 'yum update --enablerepo=updates-testing augeas-1.4.0-1.fc22' as soon as you are able to. Please go to the following url: https://admin.fedoraproject.org/updates/FEDORA-2015-9397/augeas-1.4.0-1.fc22 then log in and leave karma (feedback).
augeas-1.4.0-1.fc22 has been pushed to the Fedora 22 stable repository. If problems still persist, please make note of it in this bug report.