pam: Use POSIX getpwnam_r on Solaris
[openafs.git] / src / pam / afs_password.c
index 3bd471a..1350164 100644 (file)
@@ -7,26 +7,22 @@
  * directory or online at http://www.openafs.org/dl/license10.html
  */
 
-#include <syslog.h>
-#include <stdlib.h>
-#include <string.h>
-#include <pwd.h>
-#include <unistd.h>
 #include <afsconfig.h>
 #include <afs/param.h>
 
+#include <roken.h>
+
+#ifdef HAVE_SYS_WAIT_H
+#include <sys/wait.h>
+#endif
+
 #include <security/pam_appl.h>
 #include <security/pam_modules.h>
 
-
-#include <sys/param.h>
 #include <afs/kautils.h>
 #include "afs_message.h"
 #include "afs_util.h"
 #include "afs_pam_msg.h"
-#include <signal.h>
-#include <sys/wait.h>
-#include <errno.h>
 
 #define RET(x) { retcode = (x); goto out; }
 
@@ -119,8 +115,8 @@ pam_sm_chauthtok(pam_handle_t * pamh, int flags, int argc, const char **argv)
      * and its uid==0, and "ignore_root" was given in pam.conf,
      * ignore the user.
      */
-#if    defined(AFS_HPUX_ENV) || defined(AFS_DARWIN100_ENV)
-#if     defined(AFS_HPUX110_ENV) || defined(AFS_DARWIN100_ENV)
+#if    defined(AFS_HPUX_ENV) || defined(AFS_DARWIN100_ENV) || defined(AFS_SUN58_ENV)
+#if     defined(AFS_HPUX110_ENV) || defined(AFS_DARWIN100_ENV) || defined(AFS_SUN58_ENV)
     i = getpwnam_r(user, &unix_pwd, upwd_buf, sizeof(upwd_buf), &upwd);
 #else /* AFS_HPUX110_ENV */
     i = getpwnam_r(user, &unix_pwd, upwd_buf, sizeof(upwd_buf));