Merge pull request #1111 from kacfengine/master

Remove leftover header.
Transitioning to a new Call Collect mode.

Currently we were copying code from cf-hub into cf-serverd to do the
query. This led to some problems regarding both synchronization and
code understandability.
The new approach is to share the connection received by cf-serverd with
cf-hub and let cf-hub add the connection to its internal queue. That way
cf-hub will take ownership of the connection and query the agent at its own
convenience.
Merge pull request #1110 from cduclos/call-collect-agent

Transitioning to a new Call Collect mode.
Compilare necessus est.
Log new function result cache entries and hits

Remove FnCallShow, use existing FnCallWrite
01_vars/02_functions/execresult_multiples.cf: fix test for new logging
evalfunction.c: give FNCALL_OPTION_CACHED to more functions
Implemented safe_open() in order to avoid symlink race conditions.

It makes sure that we do not follow unsafe symlinks, that is a link
that belongs to a user, but has a target owned by a different user.
It does this in a way that avoids race conditions (between testing if
a file is a link, and opening that file, there is a small window of
opportunity).

Also implements safe_chdir(), to also safeguard chdir() operations.

Fixes issue #3693.
Merge pull request #1115 from kacfengine/safe_open

Implemented safe_open() in order to avoid symlink race conditions.
Work around fdopendir() missing on some platforms.
Merge pull request #1117 from kacfengine/safe_open

Work around fdopendir() missing on some platforms.
Add missing header.
Merge pull request #1121 from kacfengine/safe_open

Add missing header.
Don't use O_DIRECTORY flag, which is Linux specific.

Directories will fail when we try to chdir into them anyway, so all
we lose is the early warning.
Switch back to test folder after each test.

Otherwise the test framework may try to write into the wrong
directory.
Merge pull request #1123 from kacfengine/safe_open

Some fixes to the safe_open() function.
Add missing platform header for HP-UX.

The code compiles without it, but gets the wrong definition of stat
on HP-UX