cfengine/masterfiles — pull request #49 by estenberg (2013-11-12 03:55:01+00:00)
Title: fix for when set_variable_values value contains =

The following policy where set_variable_values RHS (right hand side) contains a = would previously never converge:

bundle agent test
{
vars:
"test[noequals]" string => "no equals in this string";
"test[hasequals]" string => "there is an equals in this = string right in the middle";

files:

"/tmp/test"
create => "true",
edit_line => set_variable_values2("test.test");
}

It would always append what came after the = because it replaced column 2 which is matched to just parts of the value (resulting in a new column being implicitly added on every run).

We fix it by being more specific so that we are sure that we match everything in the value.

Tested manually.