Nathan Stratton Treadway <natha...@ontko.com> (Do 31 Okt 2019 00:36:13 CET):
> On Wed, Oct 30, 2019 at 23:12:15 +0100, Heiko Schlittermann wrote:
> > If I have it in "foo" only, it is only there and does not propagate.
> > If I have it in "foo-foo" only, it is only there and does not propagate.
> > If I have it in "foo-foo-foo" only, it is only there and does not propagate.
> >
> > If I have it in "foo" and "foo-foo", it is twice in "foo-foo" (one
> > propagated from "foo"), but doesn't propagate further.
> >
> > And so on.
>
> Are you sure?  I ran some tests using a config file based on your
…
> tests, it appears that the simple "script pre-dle" value propages down
> one level (but not down two as expected):

Not sure anymore, I'll re-run my test.
Ok. It seems to be even more interesting, but is probably even better
pointing to the malicious code

> # tail -13 $CONF; echo "====="; su backup -c "amadmin TestBackup config" | 
> awk -e 'BEGIN {in_def=0; }; /foo/ {in_def=1; print $0}; /}/ {in_def=0}; 
> /SCRIPT/ {if (in_def==1) print $0;}'

For simplifying the output I used now

    perl -naE 'say "@F" if /^DEFINE DUMPTYPE foo/../^}/ and /SCRIPT|DUMPTYPE/'

Given my config example from the recent post (set the script in "foo"):

    $ amadmin foo config --no-default | perl …
    DEFINE DUMPTYPE foo {
    SCRIPT pre-dle
    DEFINE DUMPTYPE foo-foo {
    DEFINE DUMPTYPE foo-foo-foo {

    $ amadmin foo config | perl …
    DEFINE DUMPTYPE foo {
    SCRIPT pre-dle
    DEFINE DUMPTYPE foo-foo {
    SCRIPT pre-dle
    DEFINE DUMPTYPE foo-foo-foo {
    SCRIPT ""

So we're right both. With '--no-default' it does not propagate at all,
but it does one level w/o '--no-default'.

This matches the behaviour I watched but didn't investigate further,
because I thought it was confused by too much inheritance: My actual
production config has the script declaration in the last but one level
*and* worked as expected.

    Best regards from Dresden/Germany
    Viele Grüße aus Dresden
    Heiko Schlittermann
--
 SCHLITTERMANN.de ---------------------------- internet & unix support -
 Heiko Schlittermann, Dipl.-Ing. (TU) - {fon,fax}: +49.351.802998{1,3} -
 gnupg encrypted messages are welcome --------------- key ID: F69376CE -
 ! key id 7CBF764A and 972EAC9F are revoked since 2015-01 ------------ -

Attachment: signature.asc
Description: PGP signature

Reply via email to