cf3 (3.0.2) readstring array with no values (after comments)

Matt Richards <[email protected]> Fri, 28 Aug 2009 10:03:20 -0400
Newsgroups gmane.comp.sysutils.cfengine.bugs
Message-ID <[email protected]>
Greetings. A little issue with using readstringlist. It seems the list
gets populated with garbage characters when the resulting list should
contain nothing. I tried to track it down, but I think Mark would find
this one within minutes.

Consider the following example:

##########################################################################

body common control {

    bundlesequence =3D> { "readstring_test" };

}

##########################################################################


bundle agent readstring_test {

  vars:

    "entry" slist =3D> { readstringlist("/tmp/testfile","#.*","[\n]",200,40=
00) };

  reports:
    Yr2009::
       "entry:$(entry)";
}

##########################################################################


If /tmp/testfile contain only comments:

############################################
# comments
#
# more comments
#
# boy, do I love comments
#
############################################

The resulting report looks like:

cf3    =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
cf3    reports in bundle readstring_test (1)
cf3    =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
cf3
cf3 Verifying SQL table promises is only available with Cfengine Nova or ab=
ove
cf3
cf3     .........................................................
cf3     Promise handle:
cf3     Promise made by: entry:  =B8 <<<< ouch (part 1)
cf3     .........................................................
cf3
cf3 R: entry:  =B8 <<<<<< ouch (part 2)