Am 28.10.25 um 20:56 schrieb 'Nick Anderson' via help-cfengine:
> There was this fix to findfiles() in 3.24, but it only affected windows
> as far as I know:
>
> (ENT-11923)
>
> * Fixed bug related to failing backwards directory traversial when
> using forward slashes in path argument of the findfiles_up() policy
> function on Windows.
>
Hallo Nick,
I made a second attempt and it looks as if findfiles causes the trouble.
In our script we use this lines:
"dirs_found" slist => findfiles("$(constants.conf_dir)/*/");
"dirs_expected" slist => { maplist("$(constants.conf_dir)/$(this)/",
@(file_list) ), "$(constants.conf_dir)/host_config/"};
I modfied my test script:
------------:<-------------
body common control
{
bundlesequence => { "test" };
}
bundle agent test {
vars:
"file_list" slist => { "a", "b", "c", "d", "e", "f", "g", "x", "z" };
"dirs_found" slist => findfiles("/tmp/diff_test/*/");
"dirs2_found" slist => findfiles("/tmp/diff_test/*");
"dirs_expected" slist => { maplist("/tmp/diff_test/$(this)/",
@(file_list) ), "/tmp/diff_test/host_config/"};
"dirs_diff" slist => difference(dirs_found, dirs_expected);
"dirs2_diff" slist => difference(dirs2_found, dirs_expected);
reports:
"version: $(sys.cf_version)";
"found: $(dirs_found)";
"found2: $(dirs2_found)";
"expected: $(dirs_expected)";
"diff: $(dirs_diff)";
"diff2: $(dirs2_diff)";
}
------------:<-------------
Create /tmp/diff_test/ with the subdirectories from $(file_list) and run
the script in both cfengine versions:
------------:<-------------
R: version: 3.23.0
R: found: /tmp/diff_test/a/
R: found: /tmp/diff_test/b/
R: found: /tmp/diff_test/c/
R: found: /tmp/diff_test/d/
R: found: /tmp/diff_test/e/
R: found: /tmp/diff_test/f/
R: found: /tmp/diff_test/g/
R: found: /tmp/diff_test/x/
R: found: /tmp/diff_test/z/
R: found2: /tmp/diff_test/a
R: found2: /tmp/diff_test/b
R: found2: /tmp/diff_test/c
R: found2: /tmp/diff_test/d
R: found2: /tmp/diff_test/e
R: found2: /tmp/diff_test/f
R: found2: /tmp/diff_test/g
R: found2: /tmp/diff_test/x
R: found2: /tmp/diff_test/z
R: expected: /tmp/diff_test/a/
R: expected: /tmp/diff_test/b/
R: expected: /tmp/diff_test/c/
R: expected: /tmp/diff_test/d/
R: expected: /tmp/diff_test/e/
R: expected: /tmp/diff_test/f/
R: expected: /tmp/diff_test/g/
R: expected: /tmp/diff_test/x/
R: expected: /tmp/diff_test/z/
R: expected: /tmp/diff_test/host_config/
R: diff2: /tmp/diff_test/a
R: diff2: /tmp/diff_test/b
R: diff2: /tmp/diff_test/c
R: diff2: /tmp/diff_test/d
R: diff2: /tmp/diff_test/e
R: diff2: /tmp/diff_test/f
R: diff2: /tmp/diff_test/g
R: diff2: /tmp/diff_test/x
R: diff2: /tmp/diff_test/z
------------:<-------------
R: version: 3.24.0
R: found: /tmp/diff_test/a
R: found: /tmp/diff_test/b
R: found: /tmp/diff_test/c
R: found: /tmp/diff_test/d
R: found: /tmp/diff_test/e
R: found: /tmp/diff_test/f
R: found: /tmp/diff_test/g
R: found: /tmp/diff_test/x
R: found: /tmp/diff_test/z
R: found2: /tmp/diff_test/a
R: found2: /tmp/diff_test/b
R: found2: /tmp/diff_test/c
R: found2: /tmp/diff_test/d
R: found2: /tmp/diff_test/e
R: found2: /tmp/diff_test/f
R: found2: /tmp/diff_test/g
R: found2: /tmp/diff_test/x
R: found2: /tmp/diff_test/z
R: expected: /tmp/diff_test/a/
R: expected: /tmp/diff_test/b/
R: expected: /tmp/diff_test/c/
R: expected: /tmp/diff_test/d/
R: expected: /tmp/diff_test/e/
R: expected: /tmp/diff_test/f/
R: expected: /tmp/diff_test/g/
R: expected: /tmp/diff_test/x/
R: expected: /tmp/diff_test/z/
R: expected: /tmp/diff_test/host_config/
R: diff: /tmp/diff_test/a
R: diff: /tmp/diff_test/b
R: diff: /tmp/diff_test/c
R: diff: /tmp/diff_test/d
R: diff: /tmp/diff_test/e
R: diff: /tmp/diff_test/f
R: diff: /tmp/diff_test/g
R: diff: /tmp/diff_test/x
R: diff: /tmp/diff_test/z
R: diff2: /tmp/diff_test/a
R: diff2: /tmp/diff_test/b
R: diff2: /tmp/diff_test/c
R: diff2: /tmp/diff_test/d
R: diff2: /tmp/diff_test/e
R: diff2: /tmp/diff_test/f
R: diff2: /tmp/diff_test/g
R: diff2: /tmp/diff_test/x
R: diff2: /tmp/diff_test/z
------------:<-------------
Regards
Berthold Cogel