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.
Redmine #6051: Add shadow password support for AIX.
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.
Redmine #6051: Fix pwdadm being called only when changing password hash.

We need to call it when the plaintext password is changed as well.
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.
Redmine #6051: Fix administration tool detection for setuid binaries.
Redmine #6051: Add password hash capabilities to tests on AIX.
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.
Redmine #6051: Tolerate AIX forcing user's secondary group to be primary.
Redmine #6051: Use correct group removal tool in AIX tests.
Redmine #6051: Add testing of password administration flags on AIX.
Redmine #6285: Skip known bug on AIX.
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.
Redmine #6051: Work around AIX not allowing long usernames.
Fix strftime function (missing printf specifier).
Enable strftime '%F' hack on Solaris 9, which doesn't have it.
Suppress process test on Solaris 9.
Avoid malloc/free - use C99 to allocate variable-length array on stack.

Follow-up on commit a5d5ddccd2372e8e846844521181ad6fea6fbdcb
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.
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).