Skip cf_null entries in bundlesequence.

Fixes Redmine 6119
(cherry picked from commit 058dc2bc9fd55d098af6f0aaa99b4762ed4a14ef)
Test for cf_null in bundlesequence being skipped

Redmine 6119
(cherry picked from commit 777b381579ca507ad0e49a2404f2eab1944cebfa)
Add: Acceptance test for ifelapsed

Ifelapsed should always be respected, especially at the individual
promise level.

Ref: https://dev.cfengine.com/issues/6334
(cherry picked from commit c2dde33f9f6dd7980787173d3ec3a1aa8523edcc)
Adjust test so that it fails for the right reasons.

Test passes if second cf-agent invokation also uses -K, which
is expected (and a crude workaround). But at least it shows that
the test is implemented correctly now.

Using ifelapsed => 0 in the method promise in bundle example
is necessary.

The regex can probably be made less aggressive, but it does the job.
(cherry picked from commit 81dfa3517d675b21bd9e06a48c1016cd09681867)
Implement the currently held locks as a stack.

The atexit handler can then clean up the entire stack of
currently held locks, rather than only the one that was
acquired last.

If any promise sets an abort class, the exit handler is
called, cleaning up the stack. Promises in the next run
are then no longer blocked, and usual lock elapse kicks in.

Fixes Redmine #6334
(cherry picked from commit 0653d5af46028245f65b8ff1d1a412f1f33851e0)
Evaluate functions also for ifvarclass'ed promises

This takes in a small modification from
3054d112a4b537c63a248dc59b6aa66f53d9f6dc and reverts parts of
the logic introduced in f0f4743f4071c9f605da13bee9ea4f195b826ca3.

In master, we no longer skip function evaluations here at all -
the promise skipping should be done earlier.
Testcase for Redmine 3172

Shows that touch attribute ignores warn_only action policy.
(cherry picked from commit abb0ba4e0805e706196ffe2f0c92f58f14aecf27)
Respect warn-only action policy when touching files

Also, use correct logging mechanism and update
compliance status for promise.

Fixes Redmine 3172.
(cherry picked from commit c338e565c2671ec2d64d80719eded856f9753836)
Fix wording in info message.

edit.maxfilesize is an internal detail that has no meaning to
the user, and it makes for broken grammar.
(cherry picked from commit 815aee00a3ce43b97ea0aee9e5a930b2fc6dda69)
Respect max_file_size set to 0 to mean "unlimited"

As documented, an explicitly set value of 0 should mean "any size".

Also, consistently initialize the value to 100K, as documented.

See Redmine 6588
(cherry picked from commit cd97ac189c67b009ba6c7dc8cc466042815fbb64)
Skip over empty (cf_null) list entries in maplist.

Fixes Redmine #6576, includes acceptance test.
(cherry picked from commit 0eb34d6dc4d116893c20f105d4f6a5092f9e7cc1)
Testcase for Redmine 6569
(cherry picked from commit 49361121f2228cf55e1e2154243a4cea60d661ab)
Support or-entries not evaluated to a scalar

If any entry in an or-list was not evaluated to a scalar, consider it a
"class not set" and evaluate the rest of the entries.

Behavior change for classes promises that use an or constraint where
one of the list entries cannot be evaluated.

Implements redmine 6569
(cherry picked from commit bcab880c7fdb4e245a309a0129027d71c27ec1de)
Avoid unwanted writing of measurements

Only write the performance of copy-operations if the corresponding
files promise has a measurement_class set.

See redmine #6523

(cherry picked from commit 108fb1c046ec1b2418aa688e5ff10ecd54ed0711)

Conflicts:

	cf-agent/verify_files_utils.c
Move test case for bug in files into right place
(cherry picked from commit 697d445ad294ac1e36f94e5be23f3446d1ded751)
Record a kept promise only if nothing was repaired.

There is no code anywhere that sets a class "repaired", so this
call to cfPS would happen in all cases where the basedir was
not included, incorrectly setting "kept" classes.

Fixes Redmine 6509
(cherry picked from commit adda8e9a8fd85d3eb75751c59ebcf6cdcd46ba11)
Fix bug in testcase.

The file_select body in those examples never should have
matched the base-directory, so no kept or repaired class
should have been set for it either.
(cherry picked from commit 5fefb4bffb20034e9cc28265533ba07e46f535fd)
Testcase for defaults promises

Classes promises trigger a re-evaluation of the bundle's variables
to resolve dependencies quickly. This overrides and thus breaks defaults,
promises which have already been evaluated.

Why the test case has to be so complicated, testing both for positive
and negative outcome explicitly, is beyond me. Probably because bundle
return values are not just terrible to use, but also implemented in
some fascinatingly complex way.

See redmine 5748
(cherry picked from commit c3b42727d2dc47c3d6147d7bb4da94667f998505)
Evaluate defaults promises again after classes promises

Since we re-evaluate variables to resolve dependencies between
classes and variables quickly, we also need to re-evaluate defaults
promises again.

Fixes Redmine 5748

This includes the refactoring from e92efc5458117c4988ddb8c815c72a017bd5f981
(cherry picked from commit efcdccfe039543215b1b109a6415b0a2d0f285c7)

Conflicts:

	cf-agent/cf-agent.c
Test case for Redmine 6589.

Trying to delete a region where a specific select_end doesn't match
should be noop.

This is different from insert_lines, which appends the line at the
end if there is no match for select_end (see existing test case
10_files/09_insert_lines/302.cf). While it would be best to make
this behavior consistent, I'm opting for not rocking the boat and
keep existing behavior of insert_lines in place.
(cherry picked from commit a9eb47e56abf3cfbbef2966f4fb3e3030a7107b5)