Fix a few parsing bugs that can allow for silent truncation of valid JSON
(cherry picked from commit c59c9276a91fbd02d486cef9ab8a3eaedceb1309)
Eliminate pointless intermediary in JsonParseFile()

We're going to write to the pointer we were passed in any case, so we
may as well pass that into the parser for it to write to, instead of
having our own local variable to passdown and then copy to the pointer
we received.
(cherry picked from commit 1812325c7e0fb8788056b7963ce01c56e6662543)
Hard error on JSON truncation
(cherry picked from commit cbf48eec43397a4891827b1c619bade63a80ac04)
redmine6549: Tolerate unrecognised escape sequences.

We have no way to represent \u{hex digit} escapes for Unicode, which
are perfectly valid JSON; so we need to tolerate these in some form
rather than choking on them.  Given that the only sane way to do so is
to preserve them verbatim, we may as well do the same for any other
unrecognised escapes.  This eliminates the need for an error code to
represent unrecognised escape.

Log() a warning when handling an escape verbatim, though; which, in
turn, requires a #include <logging.h>
(cherry picked from commit 95f8d71a59a064ad22535529da44a6ad958206f7)
Redmine #6623: Fix agents constantly retrying long running promises.

The expireafter default should be two hours, but it was erronously set
to one minute in the initialization code, so remove that and stick to
the globally set value.

This fixes the problem where, when transferring a large file that
takes longer than the execution interval to finish, no agent will ever
succeed. What happens is that if a second cf-agent starts downloading
the same file, locking will not prevent the attempt, despite already
being in progress by the first agent. No agent will ever succeed,
because the second agent will delete the temporary file created by the
first agent, then create its own temporary file, which will be deleted
by the third agent, and so on.
(cherry picked from commit 56eec440dd1b13c6c5e236af7b2a711c892250e9)
Update test result status for Solaris 11.

All cf-serverd tests are passing now, yey! Also remove freebsd, since
we don't test it in Jenkins, and the mentioned Redmine ticket is not
for that platform.
(cherry picked from commit daee0e3c72654c4a754eed3b073ae6be07bf29f8)
Redmine #6687: Keep promise result value when linking files.

Previously it was thrown away, which would give the correct class
outcome (thanks to cfPS), but the wrong compliance outcome, because it
uses the value of the promise result.
(cherry picked from commit a201ddd25e3895287e335af4b767313996e41b8b)
Redmine #6766: Work around bug in system headers on HPUX 11.23 IA64.

The definition using mpinfou inside /usr/include/machine/sys/getppdp.h
is supposed to be protected by an "#ifdef KERNEL", but it's missing.
Since fixing it properly requires changing the system, we instead fix
it by defining a dummy structure. Since it is a kernel structure it
will never actually be used anywhere.
(cherry picked from commit 18601fd55a1b3dd4c361c3b6b6c28a0db72b1801)
Merge branch '3.6.2.x-hpux' into 3.6.x
Add negative bounds checks for string_head and string_tail

(cherry picked from commit d4560179b5d3c301e9ef501948f6f110deeaac0d)
Fail when read_file is called with a negative size

(cherry picked from commit 3d41d8dcbdeb4d75fba5ba8e3ccf3243fbc5885a)
readfile and textxform functions do not rely on 4k limit anymore

(cherry picked from commit 308ca23030566030edf0d17f73c34c2f4f6856eb)
Added text_xform tests for large sizes

(cherry picked from commit ace639a82c99bc984de556a0a627f2b2804ddac7)
CF_INFINITY is not a limit for buffer size, it's just an indication that policy has the parameter 'inf'.

(cherry picked from commit 616c51993547a178b258bcc4143948d5293f4e04)
Comment for clarity.

(cherry picked from commit 2b7e9d3bae469d842cf5f349207fbf5a05c53689)
Merge remote-tracking branch 'upstream/3.6.x' into 3.6.x_surfsara