Redmine #5721: Fix getgrnam()/getgrgid() failure in NIS/NSS setup.

Following up on fix 3e8b6898fd141919, also for getgrnam/getgrgid.

Also add declaration for AIX5, which has the function, but lacks the
declaration.

(cherry picked from commit 39e76998404b15b1cb4477b5ca500e3956aee486)
Add GetPwEntry() comment to explain why getpwnam is not used.

(cherry picked from commit d1c75819cea297ebef0ab0e8bde52b48e4368666)
Redmine #5819: Fix /etc/shadow extra newline between each entry.

getline() includes the newline in the returned string, so switch to
CfReadLine() instead so we don't get a double newline between entries
when we edit /etc/shadow.

(cherry picked from commit fdeb76530c84ea7f8411ed24fe80b8575669acc7)
Redmine #4241: Depr. INTERRUPTED promise status that was never used.

There was some code for setting classes based on this promise status,
but it was never implemented in the syntax, so it was impossible to
set a class based on it. Since we don't really need to introduce any
more promise outcomes, we alias the INTERRUPTED status to the "failed"
classes attribute.

The actual status is however left intact since it has been available
in reporting.

(cherry picked from commit 5b999726163cbfc38604c5c63f664626c817f7bc)
Redmine #4241: Make sure failed status carries through to the edit end.

Before, we would happily assume that if number of edits were zero,
this would mean that the promise was kept, however it could also be
an error. Fixed by checking the promise status in FinishEditContext().

Note the 017.cf test case, which was testing the inverse condition of
what it claimed to test.

(cherry picked from commit 71ce9974c39a57070f864dc8a67721f62752d5db)
Redmine#4241: acceptance test for missing source template file

(cherry picked from commit dd9dc17fca134e951bf0c4fd5024149cc0d70b29)
Redmine #4241: Fix test after test framework fixes and core fixes.

Note that the file creation is not tested anymore, because the
documentation explicitly says that "create" will be honored first,
whether the file will be edited is a separate step.

(cherry picked from commit d5a4a19a6d663c9aba01609397bd621d60161300)
Increase precision of the final outcome report by 2 decimal places.

(cherry picked from commit d17a29149d639f30efe526c054fcca75e4506a63)
contrib/enterprise/report.pl: add utility host lister

(cherry picked from commit 24e0fb029eb4e2ecced8600d5b96b5de69faab42)
contrib/enterprise/report.pl: look at CFENGINE_MP_URL for the --url parameter default

(cherry picked from commit b8124b20ebe76967afb1b388492ba8f261d71a84)
contrib/enterprise/report.pl: add alias for host lister

(cherry picked from commit 887c9f253fd775dbe186a44ffecb4ba1dab85d9d)
examples/getvalues.cf: show data container too

(cherry picked from commit d505d890c6b2c8d25b5bd185ced63104f250f781)
Redmine#4203: test env parsing for package method

(cherry picked from commit 72325e3b2bd16c779aac52506d22b5055a68abdf)
Remove superflous include.

cf-key uses functions from lastseen, not the DB API directly.

(cherry picked from commit d12eb5206e6a8c4997bcf7a30b076d51d521071f)
libcfnet/tls_client.c: mention 3.5.x protocol incompatibility

(cherry picked from commit 8bd3a6c688be21f2ed33cf37873b124c1592f916)
10_files/02_maintain/backup_repository.cf: try enabling again

(cherry picked from commit 421705a4bc6d7640c727f1e4cebeb59a5ae4c202)
tests/acceptance/dcs.cf.sub: remove requirement of plucked.cf.sub

(cherry picked from commit d23b70d059a3112eb8d5609f5a59f0a1ac1e7691)
Redmine #5781: Do not require a TTY when running sudo in a test.

It will fail since our pipe execution is not a TTY.

(cherry picked from commit 9d30cb49a8c6fed72ffd625234e022dd05275ac8)
Make sure test dir is accessible to everyone when running unsafe tests

(cherry picked from commit 7806cbda33f0aabf29b67b8dd6942ea58c72c632)