-#if defined(HAVE_SHADOW_H) && !defined(DISABLE_SHADOW)
- spw = getspnam(pw->pw_name);
- if (spw != NULL)
- pw_password = spw->sp_pwdp;
-#endif /* defined(HAVE_SHADOW_H) && !defined(DISABLE_SHADOW) */
-
-#ifdef HAVE_SCO_PROTECTED_PW
- spw = getprpwnam(pw->pw_name);
- if (spw != NULL)
- pw_password = spw->ufld.fd_encrypt;
-#endif /* HAVE_SCO_PROTECTED_PW */
-
-#if defined(HAVE_GETPWANAM) && !defined(DISABLE_SHADOW)
- if (issecure() && (spw = getpwanam(pw->pw_name)) != NULL)
- pw_password = spw->pwa_passwd;
-#endif /* defined(HAVE_GETPWANAM) && !defined(DISABLE_SHADOW) */
-
-#if defined(__hpux)
- if (iscomsec() && (spw = getprpwnam(pw->pw_name)) != NULL)
- pw_password = spw->ufld.fd_encrypt;
-#endif /* defined(__hpux) */
-
- /* Check for users with no password. */
- if ((password[0] == '\0') && (pw_password[0] == '\0'))
- return 1;
-
- if (pw_password[0] != '\0')
- salt = pw_password;
- else
- salt = "xx";
-
-#ifdef HAVE_MD5_PASSWORDS
- if (is_md5_salt(salt))
- encrypted_password = md5_crypt(password, salt);
- else
- encrypted_password = crypt(password, salt);
-#else /* HAVE_MD5_PASSWORDS */
-# ifdef __hpux
- if (iscomsec())
- encrypted_password = bigcrypt(password, salt);
- else
- encrypted_password = crypt(password, salt);
-# else
- encrypted_password = crypt(password, salt);
-# endif /* __hpux */
-#endif /* HAVE_MD5_PASSWORDS */
-
- /* Authentication is accepted if the encrypted passwords are identical. */