Merge pull request #1769 from kacfengine/3.6.x

3.6.x Cherry-picks
Redmine #4730: Add findfiles support for Windows by glob() replacement
(cherry picked from commit 6b913d85822f507a0f0eb221bc2929734cf2bac5)
Add message aid on Windows to avoid dir separator errors in findfiles.
(cherry picked from commit 468e227b004e2d7374e75e34c257423d3b9c0af5)
Add env in test commands list and resort the list.
(cherry picked from commit 02e182a13a95d5a19d3ff770a65df0f004949d85)
Fix test failure on platforms with non-standard sorting locale.
(cherry picked from commit 27f69dbbb7f5436079cb6eece90e8035dc40b7bf)
only assume ID if entire string is numeric
(cherry picked from commit 7487edb8ca5ba02ad082080fced29ad3844ed8ea)
Fix incorrect pointer cast in lock purging code.

NextDB() takes a (void **) pointer, not a (void *), so we would write
the pointer value into the struct instead, giving incorrect results
when comparing the time later.
(cherry picked from commit 7a1f14b76c08f6bdcbaf074d1f4d6629f1794f9d)
Introduce timed tests in acceptance test framework.

They enable waiting for a period of time, for example to let locks
expire, while running other, non-timed tests in the meantime. See the
README for more details.
(cherry picked from commit 314be2c078e29ad67abcd7a31558796cce1bda8b)
Redmine #6088: Fix cfengine template producing a zero sized file.

The bug depends on timing: If you run a file promise with a template,
everything works fine. Now, if you run the same promise again after
more than one minute, but less than three, the resulting file is
empty.

The reason is that the internal bundle produced by the cfengine
template engine has an ifelapsed value of 3 minutes. What would happen
then is that the file promise, which has an ifelapsed value of 1,
would execute, but none of the contained edit_line promises would,
leaving the file empty.

Fixed by reducing the ifelapsed value for internal edit_line promises
to one.

Also moved the definition to a more local header file. It is not
needed globally.
(cherry picked from commit 1f737d8114241fd43360a52db82f0912590e0a21)
Redmine#6109: Make CFEngine able to compile on old OpenSSL implementations by assuming sane defaults, and alerting the user if they are not.

Modified by: Kristian Amlie <kristian.amlie@cfengine.com>
(cherry picked from commit c608b09f4fce85e025deceedd257272d28c00c20)
Fix incorrect variable incrementation in testall.
(cherry picked from commit 1e2fcb7f5525212b71fbcebdf3088c844288f2e4)