[config-model-users] [augeas-devel] Re: Semantic problem in augeas sshd lens ?

David Lutterkort lutter at redhat.com
Thu Sep 4 22:14:15 UTC 2008


On Thu, 2008-09-04 at 14:19 +0200, Dominique Dumont wrote:
> David Lutterkort <lutter at redhat.com> writes:
> > So you need to insert the entry explicitly, for example with
> >         insert HostKey before /files/etc/ssh/sshd_config/Match[1]
> >         set /files/etc/ssh/sshd_config/HostKey[last()] foo
> 
> Furthermore, one must use 'set' only if the entry already exists...

In general, 'set' will create non existing nodes, provided that for each
path component there is at most one node with that label in the tree. If
nodes are created, they are added as the last child of their parent.

> Look like Augeas users are not completely shielded from syntactic
> idiosyncrasies.

Yeah, sadly, some of that still creeps in. To avoid that, we'd need
another step that knows how to groom the tree before trying to save it,
e.g. that knows that 'Match' nodes must come as the last nodes under
sshd_config. No idea how to do that in the general case, though.

> I'm somewhat reluctant to mix Augeas defined keyword with OpenSSH
> keywords at the same structural level. How about :
> 
>      { "Match"
>        { "Condition" { "User" = "sarko" }}
>        { "Condition" { "Group" = "pres.*" }}
>        { "Payload"   { "Banner" = "/etc/bienvenue.txt" }
>                      { "X11Forwarding" = "no" } 
>                      }
> 
> Then, the effect of the Match'ed condition are explicit in the Payload
> lens.

Can we call that 'Settings' or similar ? Though I quite liked the
'.Condition', especially since I came up with it ;)

David





More information about the augeas-devel mailing list