mirror of
https://github.com/Stichting-MINIX-Research-Foundation/pkgsrc-ng.git
synced 2025-08-04 02:08:49 -04:00
33 lines
907 B
Plaintext
33 lines
907 B
Plaintext
$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");
|