Fix getspnam() failure in NIS/NSS setup.

getspnam() will return remote user information if NIS or NSS is
configured as the primary user DB, but we want it to return local user
information. Fix by opening /etc/shadow manually and using
fgetspent().

This work follows from 3e8b6898fd and 39e7699840.
(cherry picked from commit c60230226fa4ef4f5e3d28576ee0a74fa04d45f6)
Redmine #6051: Add shadow password support for AIX.
(cherry picked from commit 4550e9247024a9c0f9f24011543b16fab5a17a4d)
Redmine #6051: Fix incorrect return code handling calling fgetgrent().

POSIX is ambiguous on the subject, so the return codes are simply a
result of experimentation.
(cherry picked from commit 34142045d321cf0f2c72887f99308cf39ab39546)
Redmine #6051: Fix pwdadm being called only when changing password hash.

We need to call it when the plaintext password is changed as well.
(cherry picked from commit ed39a29a843e6d01c462b4c9e150ab7ec31b09b5)
Redmine #6051: Fix AIX errors about invalid password hash.

AIX doesn't allow a completely empty password hash (although when you
create the user it is initially empty), so use an 'x' instead.
(cherry picked from commit f7c42387cfbf29952b5174228b915154ba006eb0)
Redmine #6051: Fix administration tool detection for setuid binaries.
(cherry picked from commit 3c7ed32447c6bac1ea398ccac315ebeb86b3e06b)
Redmine #6051: Add password hash capabilities to tests on AIX.
(cherry picked from commit a4600b301794a010ca8db19986563f30b1ae7fea)
Redmine #6051: Fix shell and home directory entries in tests on AIX.

AIX only approves of home directories whose parent directory exists,
and only approves of certain shells.
(cherry picked from commit 88e87df3d17191dd0cb8cc38f9249e8fd4c04b86)
Redmine #6051: Tolerate AIX forcing user's secondary group to be primary.
(cherry picked from commit 0915c549e30284862b26552b7df377f8154e2fd0)
Redmine #6051: Use correct group removal tool in AIX tests.
(cherry picked from commit c4002201e51834c64b26a1f84af849bc5be93937)
Redmine #6051: Add testing of password administration flags on AIX.
(cherry picked from commit c8133dabffcf6060b8f5d8bc4f98bbe53826f2c2)
Redmine #6285: Skip known bug on AIX.
(cherry picked from commit 395fec519a54a92ecdc4518eb3c1bc4129817847)
Redmine #6051: Test a password hash that is usable on all Unices.

The ones that start with dollar are new formats, not supported by AIX.
(cherry picked from commit 62b49c4d2ace93e85f5407e80f03cce86f243502)
Redmine #6051: Work around AIX not allowing long usernames.
(cherry picked from commit 945d78e3a05775c6e60461647b3dd1d452058991)
Redmine #6051,6289: Test a password hash that is usable on all Unices.

The ones that start with dollar are new formats, not supported by AIX
and Solaris 9.
(cherry picked from commit 5043210ed6b2369bc0e05177a781d94b31ba1cad)
Redmine #6289: Disable account expiration on Solaris.

Solaris doesn't support setting an expiration date in the past, hence
we cannot rely on that method to lock an account.

Also work around an egrep bug on Solaris (doesn't accept empty
alternative expressions).
(cherry picked from commit 1a1db35f16e7a1d68f44ed4f3d3b47d137337d7a)

Conflicts:

	tests/acceptance/17_users/unsafe/user_queries.cf.sub
Merge pull request #1818 from kacfengine/users_promise_fixes_3.6.x

[3.6.x] Users promise fixes 3.6.x
Merge remote-tracking branch 'upstream/3.6.x' into 3.6.x