summaryrefslogtreecommitdiff
path: root/auth-passwd.c
diff options
context:
space:
mode:
authorKevin Steves <stevesk@pobox.com>2002-04-25 18:17:04 +0000
committerKevin Steves <stevesk@pobox.com>2002-04-25 18:17:04 +0000
commit0ea1d9d1f26cf2aa9871fd2050037d5f6407a6b9 (patch)
tree1278b9ccbe128d740e2c652fc2f3df3d04e93095 /auth-passwd.c
parent30e494fbca1714ace893b80258af85839f99bc4d (diff)
- (stevesk) [acconfig.h auth-passwd.c configure.ac sshd.c] HP-UX 10.26
support. bug #184. most from dcole@keysoftsys.com.
Diffstat (limited to 'auth-passwd.c')
-rw-r--r--auth-passwd.c34
1 files changed, 15 insertions, 19 deletions
diff --git a/auth-passwd.c b/auth-passwd.c
index 7f3073839..58c113649 100644
--- a/auth-passwd.c
+++ b/auth-passwd.c
@@ -55,11 +55,11 @@ RCSID("$OpenBSD: auth-passwd.c,v 1.24 2002/03/04 12:43:06 markus Exp $");
55# include <hpsecurity.h> 55# include <hpsecurity.h>
56# include <prot.h> 56# include <prot.h>
57# endif 57# endif
58# ifdef HAVE_SCO_PROTECTED_PW 58# ifdef HAVE_SECUREWARE
59# include <sys/security.h> 59# include <sys/security.h>
60# include <sys/audit.h> 60# include <sys/audit.h>
61# include <prot.h> 61# include <prot.h>
62# endif /* HAVE_SCO_PROTECTED_PW */ 62# endif /* HAVE_SECUREWARE */
63# if defined(HAVE_SHADOW_H) && !defined(DISABLE_SHADOW) 63# if defined(HAVE_SHADOW_H) && !defined(DISABLE_SHADOW)
64# include <shadow.h> 64# include <shadow.h>
65# endif 65# endif
@@ -102,12 +102,9 @@ auth_password(Authctxt *authctxt, const char *password)
102 char *encrypted_password; 102 char *encrypted_password;
103 char *pw_password; 103 char *pw_password;
104 char *salt; 104 char *salt;
105#ifdef __hpux 105#if defined(__hpux) || defined(HAVE_SECUREWARE)
106 struct pr_passwd *spw; 106 struct pr_passwd *spw;
107#endif 107#endif /* __hpux || HAVE_SECUREWARE */
108#ifdef HAVE_SCO_PROTECTED_PW
109 struct pr_passwd *spw;
110#endif /* HAVE_SCO_PROTECTED_PW */
111#if defined(HAVE_SHADOW_H) && !defined(DISABLE_SHADOW) 108#if defined(HAVE_SHADOW_H) && !defined(DISABLE_SHADOW)
112 struct spwd *spw; 109 struct spwd *spw;
113#endif 110#endif
@@ -183,21 +180,20 @@ auth_password(Authctxt *authctxt, const char *password)
183 pw_password = spw->sp_pwdp; 180 pw_password = spw->sp_pwdp;
184#endif /* defined(HAVE_SHADOW_H) && !defined(DISABLE_SHADOW) */ 181#endif /* defined(HAVE_SHADOW_H) && !defined(DISABLE_SHADOW) */
185 182
186#ifdef HAVE_SCO_PROTECTED_PW
187 spw = getprpwnam(pw->pw_name);
188 if (spw != NULL)
189 pw_password = spw->ufld.fd_encrypt;
190#endif /* HAVE_SCO_PROTECTED_PW */
191
192#if defined(HAVE_GETPWANAM) && !defined(DISABLE_SHADOW) 183#if defined(HAVE_GETPWANAM) && !defined(DISABLE_SHADOW)
193 if (issecure() && (spw = getpwanam(pw->pw_name)) != NULL) 184 if (issecure() && (spw = getpwanam(pw->pw_name)) != NULL)
194 pw_password = spw->pwa_passwd; 185 pw_password = spw->pwa_passwd;
195#endif /* defined(HAVE_GETPWANAM) && !defined(DISABLE_SHADOW) */ 186#endif /* defined(HAVE_GETPWANAM) && !defined(DISABLE_SHADOW) */
196 187
197#if defined(__hpux) 188#ifdef HAVE_SECUREWARE
189 if ((spw = getprpwnam(pw->pw_name)) != NULL)
190 pw_password = spw->ufld.fd_encrypt;
191#endif /* HAVE_SECUREWARE */
192
193#if defined(__hpux) && !defined(HAVE_SECUREWARE)
198 if (iscomsec() && (spw = getprpwnam(pw->pw_name)) != NULL) 194 if (iscomsec() && (spw = getprpwnam(pw->pw_name)) != NULL)
199 pw_password = spw->ufld.fd_encrypt; 195 pw_password = spw->ufld.fd_encrypt;
200#endif /* defined(__hpux) */ 196#endif /* defined(__hpux) && !defined(HAVE_SECUREWARE) */
201 197
202 /* Check for users with no password. */ 198 /* Check for users with no password. */
203 if ((password[0] == '\0') && (pw_password[0] == '\0')) 199 if ((password[0] == '\0') && (pw_password[0] == '\0'))
@@ -214,18 +210,18 @@ auth_password(Authctxt *authctxt, const char *password)
214 else 210 else
215 encrypted_password = crypt(password, salt); 211 encrypted_password = crypt(password, salt);
216#else /* HAVE_MD5_PASSWORDS */ 212#else /* HAVE_MD5_PASSWORDS */
217# ifdef __hpux 213# if defined(__hpux) && !defined(HAVE_SECUREWARE)
218 if (iscomsec()) 214 if (iscomsec())
219 encrypted_password = bigcrypt(password, salt); 215 encrypted_password = bigcrypt(password, salt);
220 else 216 else
221 encrypted_password = crypt(password, salt); 217 encrypted_password = crypt(password, salt);
222# else 218# else
223# ifdef HAVE_SCO_PROTECTED_PW 219# ifdef HAVE_SECUREWARE
224 encrypted_password = bigcrypt(password, salt); 220 encrypted_password = bigcrypt(password, salt);
225# else 221# else
226 encrypted_password = crypt(password, salt); 222 encrypted_password = crypt(password, salt);
227# endif /* HAVE_SCO_PROTECTED_PW */ 223# endif /* HAVE_SECUREWARE */
228# endif /* __hpux */ 224# endif /* __hpux && !defined(HAVE_SECUREWARE) */
229#endif /* HAVE_MD5_PASSWORDS */ 225#endif /* HAVE_MD5_PASSWORDS */
230 226
231 /* Authentication is accepted if the encrypted passwords are identical. */ 227 /* Authentication is accepted if the encrypted passwords are identical. */