Merged all cf-serverd changes from master to 3.6.x.
Enterprise leak-fix: clean up its report-book filters before exit.

Purely to calm valgrind down; it's a one-off leak, so not a problem
during normal running.

Empty commit to indicate that commit
11c90fe9d9af442bb4739bdc4a02d34784660671 has already been cherry-picked.
Leak-fix in CheckFileChanges().

Previously neglected to clear allowuserlist of ServerAccess.
The connectionlist member should be clear already, in this code.

Empty commit to indicate that
463c6939a40f6535bd5325060887e71984453880 has already been cherry-picked.
Close listening socket before exiting.

Empty commit to indicate that
6fc65e686cfce81e92279ddb3328c2027c6b30e7 has already been cherry-picked.
Redmine #5874: Do not compile users promises if pw functions not found

This is needed for NetBSD, which has PAM, but not fgetpwent and
friends.

(cherry picked from commit 1c4370cc84f61e66fad0336bcc627012601632aa)
Redmine #5874: Add --without-pam option to turn off compiling with PAM

(cherry picked from commit 20044078d0edc78ea5ed39d35c71630ca5985d85)
Leak-fix: destroy policy that fails partial check.

When LoadPolicyFile() loads a policy, it PolicyCheckPartial()s it;
if this failed, it leaked the policy while returning NULL.

(cherry picked from commit 58f1d20f0926d6c1ea02a36623dabdbb5e90de9e)
Leak-fix: close the signal pipe on exit().

(cherry picked from commit 1708fd1bd302d1a04ffec4b900e79d1001edad38)
Leak-fix (FD): close socket when aborting on failure to lock.

That's in cf-serverd's StartServer().  Also avoid using an invalid
socket; if OpenReceiverChannel() fails to bind, it closes the socket
it just tried to use, so we should reset the socket variable to -1 so
we don't try to re-use the socket we just closed.  Split a long line.

(cherry picked from commit 4e5da992257e254daa42f71ce672e6b6e6002d56)

(empty commit intentional)
Refined .gitignore; stamp-h1 can land all over the place.

It would seem the autotools create random files called stamp-h1 in
random places.  Ignore all of them !

(cherry picked from commit 163079c00e610a83f1e1815b8e47eea6d8a96f4f)
Suppress some acceptance tests on solaris 10

(cherry picked from commit a2e56cb4f866890cf466e5d6d26d91a6cdf64667)
Redmine#5209: string_downcase the eval result for AIX and Solaris

(cherry picked from commit b86b54a8cc6f055f21f29bf5da8cbede20414cce)
Redmine#6220: on Solaris 10 acceptance tests, use a Perl sort to enable 10_files/02_maintain/changes_depth_search.cf

(cherry picked from commit c95775ffae980ba47f0d8cd5df26a139aadbefd7)
A bit doc.

(cherry picked from commit 24e41d355021d5c7c6555293d37a7c727555859e)
Rename process_finish() to process_replace().

(cherry picked from commit 71a3b6cd79ec7bbcab449dcd999d785e2ea99147)
cf-upgrade shouldn't include from lmdb, postgres etc.

(cherry picked from commit c853a07e8427045cabf803f58c2f75e6393fda59)
Preserve environment through exec.

For example dpkg requires PATH environment variable.

(cherry picked from commit 7884fd5c51044defb31a53464285b6eaaaaaf536)
Windows version needs to be renamed as well.

(cherry picked from commit 116af8064f3b176ffc4bd0ec41dc0aedaeef9c1c)