summaryrefslogtreecommitdiff
path: root/auth-passwd.c
diff options
context:
space:
mode:
authorKevin Steves <stevesk@pobox.com>2002-04-04 19:02:28 +0000
committerKevin Steves <stevesk@pobox.com>2002-04-04 19:02:28 +0000
commite683e7643997118ac51b18c073a6aba410c0cc3c (patch)
treef2a98c2979198a89e00eb5cdd3d6fbf0fb986377 /auth-passwd.c
parentaf40bc6a72013e9eec74ec99e21dab9342ac9880 (diff)
- (stevesk) [auth-pam.c auth-pam.h auth-passwd.c auth-sia.c auth-sia.h
auth1.c auth2.c] PAM, OSF_SIA password auth cleanup; from djm.
Diffstat (limited to 'auth-passwd.c')
-rw-r--r--auth-passwd.c83
1 files changed, 46 insertions, 37 deletions
diff --git a/auth-passwd.c b/auth-passwd.c
index 095b9ba27..7f3073839 100644
--- a/auth-passwd.c
+++ b/auth-passwd.c
@@ -38,47 +38,47 @@
38#include "includes.h" 38#include "includes.h"
39RCSID("$OpenBSD: auth-passwd.c,v 1.24 2002/03/04 12:43:06 markus Exp $"); 39RCSID("$OpenBSD: auth-passwd.c,v 1.24 2002/03/04 12:43:06 markus Exp $");
40 40
41#if !defined(USE_PAM) && !defined(HAVE_OSF_SIA)
42
43#include "packet.h" 41#include "packet.h"
44#include "log.h" 42#include "log.h"
45#include "servconf.h" 43#include "servconf.h"
46#include "auth.h" 44#include "auth.h"
47 45
48#ifdef HAVE_CRYPT_H 46#if !defined(USE_PAM) && !defined(HAVE_OSF_SIA)
49# include <crypt.h> 47/* Don't need any of these headers for the PAM or SIA cases */
50#endif 48# ifdef HAVE_CRYPT_H
51#ifdef WITH_AIXAUTHENTICATE 49# include <crypt.h>
52# include <login.h> 50# endif
53#endif 51# ifdef WITH_AIXAUTHENTICATE
54#ifdef __hpux 52# include <login.h>
55# include <hpsecurity.h> 53# endif
56# include <prot.h> 54# ifdef __hpux
57#endif 55# include <hpsecurity.h>
58#ifdef HAVE_SCO_PROTECTED_PW 56# include <prot.h>
59# include <sys/security.h> 57# endif
60# include <sys/audit.h> 58# ifdef HAVE_SCO_PROTECTED_PW
61# include <prot.h> 59# include <sys/security.h>
62#endif /* HAVE_SCO_PROTECTED_PW */ 60# include <sys/audit.h>
63#if defined(HAVE_SHADOW_H) && !defined(DISABLE_SHADOW) 61# include <prot.h>
64# include <shadow.h> 62# endif /* HAVE_SCO_PROTECTED_PW */
65#endif 63# if defined(HAVE_SHADOW_H) && !defined(DISABLE_SHADOW)
66#if defined(HAVE_GETPWANAM) && !defined(DISABLE_SHADOW) 64# include <shadow.h>
67# include <sys/label.h> 65# endif
68# include <sys/audit.h> 66# if defined(HAVE_GETPWANAM) && !defined(DISABLE_SHADOW)
69# include <pwdadj.h> 67# include <sys/label.h>
70#endif 68# include <sys/audit.h>
71#if defined(HAVE_MD5_PASSWORDS) && !defined(HAVE_MD5_CRYPT) 69# include <pwdadj.h>
72# include "md5crypt.h" 70# endif
73#endif /* defined(HAVE_MD5_PASSWORDS) && !defined(HAVE_MD5_CRYPT) */ 71# if defined(HAVE_MD5_PASSWORDS) && !defined(HAVE_MD5_CRYPT)
74 72# include "md5crypt.h"
75#ifdef HAVE_CYGWIN 73# endif /* defined(HAVE_MD5_PASSWORDS) && !defined(HAVE_MD5_CRYPT) */
76#undef ERROR 74
77#include <windows.h> 75# ifdef HAVE_CYGWIN
78#include <sys/cygwin.h> 76# undef ERROR
79#define is_winnt (GetVersion() < 0x80000000) 77# include <windows.h>
80#endif 78# include <sys/cygwin.h>
81 79# define is_winnt (GetVersion() < 0x80000000)
80# endif
81#endif /* !USE_PAM && !HAVE_OSF_SIA */
82 82
83extern ServerOptions options; 83extern ServerOptions options;
84 84
@@ -89,6 +89,15 @@ extern ServerOptions options;
89int 89int
90auth_password(Authctxt *authctxt, const char *password) 90auth_password(Authctxt *authctxt, const char *password)
91{ 91{
92#if defined(USE_PAM)
93 if (*password == '\0' && options.permit_empty_passwd == 0)
94 return 0;
95 return auth_pam_password(authctxt, password);
96#elif defined(HAVE_OSF_SIA)
97 if (*password == '\0' && options.permit_empty_passwd == 0)
98 return 0;
99 return auth_sia_password(authctxt, password);
100#else
92 struct passwd * pw = authctxt->pw; 101 struct passwd * pw = authctxt->pw;
93 char *encrypted_password; 102 char *encrypted_password;
94 char *pw_password; 103 char *pw_password;
@@ -221,5 +230,5 @@ auth_password(Authctxt *authctxt, const char *password)
221 230
222 /* Authentication is accepted if the encrypted passwords are identical. */ 231 /* Authentication is accepted if the encrypted passwords are identical. */
223 return (strcmp(encrypted_password, pw_password) == 0); 232 return (strcmp(encrypted_password, pw_password) == 0);
224}
225#endif /* !USE_PAM && !HAVE_OSF_SIA */ 233#endif /* !USE_PAM && !HAVE_OSF_SIA */
234}