Here comes a profoundly belated blog post on a behavior change. Better late than never.
Due to various bugs with the glob engine on Windows, we decided to rewrite it in CFEngine 3.24.0. Not only does the new glob engine resolve these bugs on Windows, but it also adds support for brace expansion on all platforms. E.g.
bundle agent main
{
vars:
"matches"
slist => findfiles("C:/{foo,bar}.txt");
reports:
"$(matches)";
}
& 'C:\Program Files\Cfengine\bin\cf-agent.exe' -Kf C:\findfiles.cf
R: C:\bar.txt
R: C:\foo.txt
The introduction of brace expansions will probably not break your policy unless
you have files with brackets in their names. But what may break your policy is
the fact that the new glob engine outputs the matched paths with the system
separator (i.e., $(const.dirsep)
). E.g., given the following policy, you can
see how the output with the matched files changed from having forward slashes in
CFEngine 3.21 to having backslashes in CFEngine 3.24 on Windows.
bundle agent main
{
vars:
"matches"
slist => findfiles("C:/Users/Administrator/Downloads/*.msi");
reports:
"CFEngine $(sys.cf_version) matches:";
"$(matches)";
}
& 'C:\Program Files\Cfengine\bin\cf-agent.exe' -Kf C:\findfiles.cf
R: CFEngine 3.21.7 matches:
R: C:/Users/Administrator/Downloads/cfengine-nova-3.21.7-1-x86_64.msi
R: C:/Users/Administrator/Downloads/cfengine-nova-3.24.2-1-x86_64.msi
& 'C:\Program Files\Cfengine\bin\cf-agent.exe' -Kf C:\findfiles.cf
R: CFEngine 3.24.2 matches:
R: C:\Users\Administrator\Downloads\cfengine-nova-3.21.7-1-x86_64.msi
R: C:\Users\Administrator\Downloads\cfengine-nova-3.24.2-1-x86_64.msi
Hence, if your policy breaks due to the fact that it depends on the assumption that the matched paths contain forward slashes, then you know why.
If you have questions or need help, reach out on the mailing list or GitHub discussions. If you have a support contract, feel free to open a ticket in our support system.