Jason, I don't think this is the problem. THe original logic was
nonsense, but I had not considered the variables you mention. I will
look at this again. A test I applied while fixing this no longer works
for some reason, but I'm too tired now to fix it.
More soon
M
Jason Kim wrote:
> It appears that a bug in 2.1.22 was introduced in src/varstring.c, revision
> 298, function ExtractInnerVarString. Subversion info:
>
> Revision 298
> Modified Mon Jan 8 16:08:10 2007 UTC (3 weeks, 2 days ago) by mark
> varstring expansion patch
>
> In the second chunk of that change, while formatting an if conditional the
> logic was changed, replacing '!=' with '==' (possibly a copy and paste
> error). This breaks parsing in my setup since I use bash variable expansion
> in ExecResult statements (ie "${var:-foo}') and the ':' and '-' characters
> are incorrectly flagged as illegal cfengine characters.
>
> I'm assuming this change was unintentional. If so, there may also be a logic
> error in this section of code, allowing illegal chars to pass through the
> test. I'm guessing the test should look more like:
>
> if (isalnum((int)*sp) ||
> ((*sp != '_') &&
> (*sp != '[') && (*sp != ']') &&
> (*sp != '$') &&
> (*sp != '.')))
>
> Unfortunately I don't have the time to look at/test it in more depth. I've
> attached a simple patch that changes the '==' back to '!=', reverting to the
> previous (2.1.21) behavior.
> -JayKim
>
>
>
> ------------------------------------------------------------------------
>
> Index: src/varstring.c
> ===================================================================
> --- src/varstring.c (revision 327)
> +++ src/varstring.c (working copy)
> @@ -255,10 +255,10 @@
>
> default:
> if (isalnum((int)*sp)
> - || (*sp == '_')
> - || (*sp == '[') || (*sp == ']')
> - || (*sp == '$')
> - || (*sp == '.'))
> + || (*sp != '_')
> + || (*sp != '[') || (*sp != ']')
> + || (*sp != '$')
> + || (*sp != '.'))
> {
> }
> else
>
>
> ------------------------------------------------------------------------
>
> _______________________________________________
> Bug-cfengine mailing list
> [email protected]
> https://cfengine.org/mailman/listinfo/bug-cfengine
--
Mark Burgess
Professor of Network and System Administration
Oslo University College
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Work: +47 22453272 Email: [EMAIL PROTECTED]
Fax : +47 22453205 WWW : http://www.iu.hio.no/~mark
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
_______________________________________________
Bug-cfengine mailing list
[email protected]
https://cfengine.org/mailman/listinfo/bug-cfengine