mirror of
https://github.com/Stichting-MINIX-Research-Foundation/pkgsrc-ng.git
synced 2025-08-04 02:08:49 -04:00
80 lines
1.9 KiB
Plaintext
80 lines
1.9 KiB
Plaintext
$NetBSD: patch-ar,v 1.4 2003/05/16 17:30:59 wiz Exp $
|
|
|
|
--- modules/pam_unix/support.c.orig Mon Sep 23 13:33:22 2002
|
|
+++ modules/pam_unix/support.c
|
|
@@ -6,13 +6,17 @@
|
|
|
|
#define _BSD_SOURCE
|
|
|
|
+#include "../../_pam_aconf.h"
|
|
+
|
|
#include <stdlib.h>
|
|
#include <unistd.h>
|
|
#include <stdarg.h>
|
|
#include <string.h>
|
|
#include <malloc.h>
|
|
#include <pwd.h>
|
|
+#ifdef HAVE_SHADOW_H
|
|
#include <shadow.h>
|
|
+#endif
|
|
#include <limits.h>
|
|
#include <utmp.h>
|
|
#include <errno.h>
|
|
@@ -113,6 +117,12 @@ int _make_remark(pam_handle_t * pamh, un
|
|
*/
|
|
char *PAM_getlogin(void)
|
|
{
|
|
+#ifdef USE_GETLOGIN
|
|
+ char *retval = NULL;
|
|
+ retval = getlogin();
|
|
+ D(("PAM_getlogin retval: %s", retval));
|
|
+ return retval;
|
|
+#else
|
|
struct utmp *ut, line;
|
|
char *curr_tty, *retval;
|
|
static char curr_user[sizeof(ut->ut_user) + 4];
|
|
@@ -135,6 +145,7 @@ char *PAM_getlogin(void)
|
|
D(("PAM_getlogin retval: %s", retval));
|
|
|
|
return retval;
|
|
+#endif
|
|
}
|
|
|
|
/*
|
|
@@ -358,6 +369,7 @@ int _unix_blankpasswd(unsigned int ctrl,
|
|
#endif
|
|
|
|
if (pwd != NULL) {
|
|
+#ifdef HAVE_GETSPNAM
|
|
if (strcmp( pwd->pw_passwd, "*NP*" ) == 0)
|
|
{ /* NIS+ */
|
|
uid_t save_euid, save_uid;
|
|
@@ -400,6 +412,9 @@ int _unix_blankpasswd(unsigned int ctrl,
|
|
salt = x_strdup(spwdent->sp_pwdp);
|
|
else
|
|
salt = x_strdup(pwd->pw_passwd);
|
|
+#else
|
|
+ salt = x_strdup(pwd->pw_passwd);
|
|
+#endif
|
|
}
|
|
/* Does this user have a password? */
|
|
if (salt == NULL) {
|
|
@@ -535,6 +550,7 @@ int _unix_verify_password(pam_handle_t *
|
|
pwd = getpwnam(name); /* Get password file entry... */
|
|
|
|
if (pwd != NULL) {
|
|
+#ifdef HAVE_GETSPNAM
|
|
if (strcmp( pwd->pw_passwd, "*NP*" ) == 0)
|
|
{ /* NIS+ */
|
|
uid_t save_euid, save_uid;
|
|
@@ -572,6 +588,9 @@ int _unix_verify_password(pam_handle_t *
|
|
salt = x_strdup(spwdent->sp_pwdp);
|
|
else
|
|
salt = x_strdup(pwd->pw_passwd);
|
|
+#else
|
|
+ salt = x_strdup(pwd->pw_passwd);
|
|
+#endif
|
|
}
|
|
|
|
data_name = (char *) malloc(sizeof(FAIL_PREFIX) + strlen(name));
|