[augeas-devel] Re: sshd_config lens patch
Dominique Dumont
dominique.dumont at hp.com
Tue Sep 9 11:38:22 UTC 2008
David Lutterkort <lutter at redhat.com> writes:
>> + let match_cond =
>> + [ label "Condition" . sep . [ key /[A-Za-z0-9]+/ . sep .
>> + store /[^ \t\n]+/ ] ]
>> +
>> + let match_entry =
>> + ( comment | other_entry )
>> +
>
> I changed this to
> let match_entry = (comment | (Util.indent . other_entry))
> so that indented lines in the Match block are processed properly - I
> wonder if that should just be done for 'other_entry' in general.
Looks like sshd works when lines are indented. So it may need to be
done for all entries.
>
>> diff -r 09dcb70fa724 lenses/tests/test_sshd.aug
>> --- a/lenses/tests/test_sshd.aug Thu Aug 28 21:38:11 2008 -0700
>> +++ b/lenses/tests/test_sshd.aug Mon Sep 08 18:33:42 2008 +0200
>
>> + let match_blocks = "X11Forwarding yes
>> +Match User sarko Group pres.*
>> +Banner /etc/bienvenue.txt
>> +X11Forwarding no
>> +Match User bush Group pres.* Host white.house.*
>> +Banner /etc/welcome.txt
>> +"
>
> I indented the two lines after the first Match by a few spaces to make
> sure that indented entries are processed properly.
Ok.
Btw, could we write sshd lens as :
let lns = (comment | accept_env | allow_groups | allow_users
| deny_groups | subsystem | deny_users | macs
| other_entry ) * . match* . end_of_file
So that we would be sure that Match entries are the last in the
sshd_config file ?
If this is possible, augeas could ensure that added entries in
sshd_config are not written after the Match block.
All the best
--
Dominique Dumont
"Delivering successful solutions requires giving people what they
need, not what they want." Kurt Bittner
More information about the augeas-devel
mailing list