pkgsrc/security/PAM/patches/patch-am
jlam 3530f6ba5c Update security/PAM to 0.77. Changes from version 0.75 include:
* Numerous bug fixes for most of the PAM modules, including several
  string length checks and fixes (update recommended!).

* fix for legacy behavior of pam_setcred and pam_close_session in
  the case that pam_authenticate and pam_open_session hadn't been
  called

* pam_unix:
	- don't zero out password strings during password changing function
* pam_wheel:
	- feature: can use the module to provide wheel access to non-root
	  accounts.
* pam_limits:
	- added '%' domain for maxlogins limiting, now '*' and @group
	  have the old meaning (every) and '%' the new one (all)
	- handle negative priority limits (which can apply to the
	  superuser too).
* pam_userdb:
	- require that all of typed password matches that in database
* pam_access:
	- added the 'fieldsep=' argument, made a PAM_RHOST of ""
	  equivalent to NULL

Incidentally, cups-1.1.18 will once again do PAM authentication using
pam_unix.so if built against PAM-0.77.
2002-12-23 21:23:56 +00:00

37 lines
938 B
Text

$NetBSD: patch-am,v 1.4 2002/12/23 21:23:59 jlam Exp $
--- modules/pam_issue/pam_issue.c.orig Sun Nov 11 21:23:29 2001
+++ modules/pam_issue/pam_issue.c
@@ -21,6 +21,7 @@
#include <stdio.h>
#include <stdlib.h>
#include <sys/types.h>
+#include <sys/param.h>
#include <sys/stat.h>
#include <fcntl.h>
#include <string.h>
@@ -244,12 +245,24 @@ char *do_prompt(FILE *fd)
case 'U':
{
int users = 0;
+#if (defined(BSD) && BSD >= 199306)
+ struct utmp ut;
+ FILE *uf;
+
+ if ((uf == fopen(_PATH_UTMP, "r")) != NULL) {
+ while (fread(&ut, sizeof(ut), 1, uf) > 0)
+ if (ut.ut_name[0] != '\0')
+ ++users;
+ (void) fclose(uf);
+ }
+#else
struct utmp *ut;
setutent();
while ((ut = getutent()))
if (ut->ut_type == USER_PROCESS)
users++;
endutent();
+#endif
printf ("%d ", users);
if (c == 'U')
snprintf (buf, 1024, "%s", (users == 1) ?