summaryrefslogtreecommitdiff
path: root/security/PAM/patches/patch-as
blob: 2af7b25fe241aacf5f31688497429d9dc4bde51a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
$NetBSD: patch-as,v 1.3 2002/12/23 21:24:00 jlam Exp $

--- modules/pam_unix/unix_chkpwd.c.orig	Mon Sep 23 13:33:22 2002
+++ modules/pam_unix/unix_chkpwd.c
@@ -29,7 +29,9 @@
 #include <unistd.h>
 #include <sys/types.h>
 #include <pwd.h>
+#ifdef HAVE_SHADOW_H
 #include <shadow.h>
+#endif
 #include <signal.h>
 
 #define MAXPASS		200	/* the maximum length of a password */
@@ -101,6 +103,7 @@ static int _unix_verify_password(const c
 	pwd = getpwnam(name);	/* Get password file entry... */
 	endpwent();
 	if (pwd != NULL) {
+#ifdef HAVE_GETSPNAM
 		if (strcmp(pwd->pw_passwd, "x") == 0) {
 			/*
 			 * ...and shadow password file entry for this user,
@@ -127,6 +130,9 @@ static int _unix_verify_password(const c
 				salt = x_strdup(pwd->pw_passwd);
 			}
 		}
+#else
+		salt = x_strdup(pwd->pw_passwd);
+#endif
 	}
 	if (pwd == NULL || salt == NULL) {
 		_log_err(LOG_ALERT, "check pass; user unknown");