summaryrefslogtreecommitdiff
path: root/auth-passwd.c
diff options
context:
space:
mode:
authorDamien Miller <djm@mindrot.org>2000-05-20 15:02:59 +1000
committerDamien Miller <djm@mindrot.org>2000-05-20 15:02:59 +1000
commitdfc83f42eba83d6dd127ce36fb33a490163c32de (patch)
tree8da6dce300467bc31e4fea7c4bda0c3181d24bbb /auth-passwd.c
parentad1bc5f986ac31ea3f429d2c49d7f34bd78e32fc (diff)
- SunOS 4.x support from Todd C. Miller <Todd.Miller@courtesan.com>
Diffstat (limited to 'auth-passwd.c')
-rw-r--r--auth-passwd.c20
1 files changed, 19 insertions, 1 deletions
diff --git a/auth-passwd.c b/auth-passwd.c
index e64e65682..b27c5bae8 100644
--- a/auth-passwd.c
+++ b/auth-passwd.c
@@ -11,7 +11,7 @@
11 11
12#ifndef USE_PAM 12#ifndef USE_PAM
13 13
14RCSID("$Id: auth-passwd.c,v 1.19 2000/04/29 14:47:29 damien Exp $"); 14RCSID("$Id: auth-passwd.c,v 1.20 2000/05/20 05:03:00 damien Exp $");
15 15
16#include "packet.h" 16#include "packet.h"
17#include "ssh.h" 17#include "ssh.h"
@@ -28,6 +28,11 @@ RCSID("$Id: auth-passwd.c,v 1.19 2000/04/29 14:47:29 damien Exp $");
28#ifdef HAVE_SHADOW_H 28#ifdef HAVE_SHADOW_H
29# include <shadow.h> 29# include <shadow.h>
30#endif 30#endif
31#ifdef HAVE_GETPWANAM
32# include <sys/label.h>
33# include <sys/audit.h>
34# include <pwdadj.h>
35#endif
31#if defined(HAVE_MD5_PASSWORDS) && !defined(HAVE_MD5_CRYPT) 36#if defined(HAVE_MD5_PASSWORDS) && !defined(HAVE_MD5_CRYPT)
32# include "md5crypt.h" 37# include "md5crypt.h"
33#endif /* defined(HAVE_MD5_PASSWORDS) && !defined(HAVE_MD5_CRYPT) */ 38#endif /* defined(HAVE_MD5_PASSWORDS) && !defined(HAVE_MD5_CRYPT) */
@@ -46,6 +51,9 @@ auth_password(struct passwd * pw, const char *password)
46#ifdef HAVE_SHADOW_H 51#ifdef HAVE_SHADOW_H
47 struct spwd *spw; 52 struct spwd *spw;
48#endif 53#endif
54#ifdef HAVE_GETPWANAM
55 struct passwd_adjunct *spw;
56#endif
49#ifdef WITH_AIXAUTHENTICATE 57#ifdef WITH_AIXAUTHENTICATE
50 char *authmsg; 58 char *authmsg;
51 char *loginmsg; 59 char *loginmsg;
@@ -99,6 +107,16 @@ auth_password(struct passwd * pw, const char *password)
99 pw_password = spw->sp_pwdp; 107 pw_password = spw->sp_pwdp;
100 } 108 }
101#endif /* defined(HAVE_SHADOW_H) && !defined(DISABLE_SHADOW) */ 109#endif /* defined(HAVE_SHADOW_H) && !defined(DISABLE_SHADOW) */
110#if defined(HAVE_GETPWANAM) && !defined(DISABLE_SHADOW)
111 if (issecure() && (spw = getpwanam(pw->pw_name)) != NULL)
112 {
113 /* Check for users with no password. */
114 if (strcmp(password, "") == 0 && strcmp(spw->pwa_passwd, "") == 0)
115 return 1;
116
117 pw_password = spw->pwa_passwd;
118 }
119#endif /* defined(HAVE_GETPWANAM) && !defined(DISABLE_SHADOW) */
102 120
103 if (pw_password[0] != '\0') 121 if (pw_password[0] != '\0')
104 salt = pw_password; 122 salt = pw_password;