Wrong debug message in src/syntax.c

Jean-Noël Rivasseau <[email protected]> Sun, 6 Dec 2009 21:50:37 -0800
Newsgroups gmane.comp.sysutils.cfengine.bugs
Message-ID <[email protected]>
--===============0686602776==
Content-Type: multipart/alternative; boundary=00032555ac0272d59e047a1d0949

--00032555ac0272d59e047a1d0949
Content-Type: text/plain; charset=UTF-8

Hi,

First why does the code:

bundle common global
{
    vars:
    any::
        "AUTHORIZED_IPS" slist => {"127.0.0.1", "192.168.0/24"};
}

body server control
{
    trustkeysfrom => @{global.AUTHORIZED_IPS};
    allowconnects => @{global.AUTHORIZED_IPS};
    maxconnections => "10";
    logallconnections => "true";
}

produces this error:

rhs is a scalar, but lhs (slist) is not list type, near token
'@{global.AUTHORIZED_IPS}'

I have to write it as

    trustkeysfrom => { @{global.AUTHORIZED_IPS} };

to get it working, which is a cumbersome syntax. Is this "normal", eg the
expected behavior? I think @{global.AUTHORIZED_IPS} should be enough for
cf-engine to recognize it is dealing with a list.

Second, the error message

rhs is a scalar, but lhs (slist) is not list type, near token
'@{global.AUTHORIZED_IPS}'

which comes from the

CheckConstraintTypeMatch() function in syntax.c, is obviously wrong,
it should read


rhs is a scalar, but lhs (slist) is not a scalar type.

Can someone fix this, as it is quite confusing?

Thanks.

Jean-Noel

--00032555ac0272d59e047a1d0949
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: quoted-printable

Hi,<br><br>First why does the code:<br><br>bundle common global<br>{<br>=C2=
=A0=C2=A0=C2=A0 vars:<br>=C2=A0=C2=A0=C2=A0 any::<br>=C2=A0=C2=A0=C2=A0 =C2=
=A0=C2=A0=C2=A0 &quot;AUTHORIZED_IPS&quot; slist =3D&gt; {&quot;127.0.0.1&q=
uot;, &quot;192.168.0/24&quot;};=C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 <br>}=
<br><br>body server control<br>
{<br>=C2=A0=C2=A0=C2=A0 trustkeysfrom =3D&gt; @{global.AUTHORIZED_IPS};<br>=
=C2=A0=C2=A0=C2=A0 allowconnects =3D&gt; @{global.AUTHORIZED_IPS};<br>=C2=
=A0=C2=A0=C2=A0 maxconnections =3D&gt; &quot;10&quot;;<br>=C2=A0=C2=A0=C2=
=A0 logallconnections =3D&gt; &quot;true&quot;;<br>}<br><br>produces this e=
rror:<br>
<br>rhs is a scalar, but lhs (slist) is not list type, near token &#39;@{gl=
obal.AUTHORIZED_IPS}&#39;<br><br>I have to write it as <br clear=3D"all"><b=
r>=C2=A0=C2=A0=C2=A0 trustkeysfrom =3D&gt; { @{global.AUTHORIZED_IPS} };<br=
><br>to get it working, which is a cumbersome syntax. Is this &quot;normal&=
quot;, eg the expected behavior? I think @{global.AUTHORIZED_IPS} should be=
 enough for cf-engine to recognize it is dealing with a list.<br>
<br>Second, the error message<br><br>
rhs is a scalar, but lhs (slist) is not list type, near token &#39;@{global=
.AUTHORIZED_IPS}&#39;<br><br>which comes from the <br><pre>CheckConstraintT=
ypeMatch() function in syntax.c, is obviously wrong, it should read <br>
<br><br>rhs is a scalar, but lhs (slist) is not a scalar type.<br><br>Can s=
omeone fix this, as it is quite confusing?<br><br>Thanks.<br><br>Jean-Noel<=
br>
</pre>

--00032555ac0272d59e047a1d0949--

--===============0686602776==
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

_______________________________________________
Bug-cfengine mailing list
[email protected]
https://cfengine.org/mailman/listinfo/bug-cfengine

--===============0686602776==--