Redmine #6370: Discard call collect connection.

Instead of sending "BAD: Unspecified server refusal
(see verbose server output)" message to the call collected client
which is not having access to call collect simply refuse connection.

Message sent to the client is interpreted as a call collect queue
length and client assumes that connection is valid.
Redmine #6434: Fix AIX missing a lot of log output.

It happens because we list a static library as a dependency for
libpromises, and then we list the same static library as a dependency
for a binary that depends on libpromises. Then the symbol will be
included both in the library and in the binary.

Exactly how the symbols are resolved appears to be platform dependent,
but what can happen is this: At any point, when you call a duplicate
symbol, depending on where you call it from, you will either call the
version in the binary or in the library. This is fine, since they both
contain exactly the same code. However, they do not refer to the same
global symbols. They each have their own set. This means that
something that was initialized in the binary may not be initialized in
the library, even though the symbol name is the same. This has weird
effects, like a symbol suddenly switching from a valid value to zero
when the stack trace crosses a library boundary.

The problem was observed on AIX, where the log level randomly switches
between verbose and non-verbose, depending on where the Log() function
was called from.
Merge pull request #1876 from pasinskim/ha

Redmine #6370: Discard call collect connection.
patch configure to correctly find libxml2
Redmine #4716: Lots of fixes to dirname(), esp. on Windows.

These problems were fixed:
* AddSlash() always adds Unix slash when argument is empty.
* DeleteSlash() removes root slash.
* DeleteSlash() does not handle repeated path separators.
* FirstFileSeparator() returns NULL on all relative Unix paths, even
  if it has a file separator.
* ChopLastNode() gives empty string when removing last directory
  component of a relative path. It should give '.'.
* ChopLastNode() does not handle Windows drive letters.
* ChopLastNode() does not handle repeated path separators.
* IsAbsoluteFileName() does not handle absolute paths on Windows that
  don't start with a drive letter. Both types are considered absolute
  paths.

This also fixes a Windows issue where creating a directory in policy
would lead to an error message about not being able to chdir into a
directory with the name ''. This was due to the final root slash not
being preserved.
Merge pull request #1877 from kacfengine/dirname_fixes

Redmine #4716: Lots of fixes to dirname(), esp. on Windows.
Merge pull request #1878 from MatthewCattell/mingw-libxml2-configure-fix

patch configure to correctly find libxml2
Switching to masterfiles inventory_os.description for attribute_name OS for portability
Revert "Remove uninitialized buffers as source of entropy."

This reverts commit 570724e752cf131132bb88e65a031f700b0ac424.

The reason is that in a chroot testing environment, there isn't enough
entropy available to satisfy OpenSSL, so it will bail out. Reverting
is not the correct fix for the problem, but right now we need tests to
pass, so postponing this for later.

Conflicts:

	libpromises/crypto.c
improve verbose message for package_list_command
Instead of only list arg[0] list while command, eg:
old: Reading package list from /usr/bin/env
new: Reading package list from '/usr/bin/env DEBIAN_FRONTEND=noninteractive LC_ALL=C PATH=/bin:/sbin/:/usr/bin:/usr/sbin /usr/bin/dpkg -l
see discussion in: https://groups.google.com/forum/#!topic/help-cfengine/nH6bR-n2x_c
also adjust message for old log format
Merge pull request #1885 from basvandervlies/improve_verbose_message_for_package_list_command

improve verbose message for package_list_command
Redmine #6441: Fix software_packages.csv being regenerated every time.

Do not allow '\r' to make it into the package string. If the package
manager puts '\r' at the end of the lines, it will cause later
comparisons to fail, so make sure to filter it out.
re-enable acceptance tests which now pass on solaris
redmine6476: Aborting on low entropy is too drastic.

Rather than reverting the whole commit involved, keep what we can of
it and Log() instead of UnexpectedError(), at least until Jimis can
invent some better way to respond to this.
Merge pull request #1888 from ediosyncratic/rand-fix

redmine6476: Aborting on low entropy is too drastic.

Failed automatic test, but Matthew says it's only expected failures.
Merge pull request #1889 from MatthewCattell/re-enable-solaris-acceptance-tests

Re-enable acceptance tests which now pass on Solaris.
Fix mis-guided fall-through on failure.

BusyWithClassicConnection() would wrongly report an unexpected
command, if we ever let it support call-collect, were it to fail.
Added a pertinent assertion.
Assert known constraints, log debug on any success.

ServerTLSPeek() would log the data it peeked, but only when deciding
it has TLS; I'd like to be able to see it also for classic.

As recv() definitely shouldn't return more than the buffer size it was
given, assert this, tweak the first check (any negative is failure,
not just -1, albeit only -1 should happen) and simplify the rest.  The
TLS case wasn't checking got == peek_size (as the CAUTH case did), but
can take this for granted (given the assertions) now.