diff options
Diffstat (limited to 'security/PAM/patches/patch-al')
-rw-r--r-- | security/PAM/patches/patch-al | 37 |
1 files changed, 37 insertions, 0 deletions
diff --git a/security/PAM/patches/patch-al b/security/PAM/patches/patch-al new file mode 100644 index 00000000000..e0cf473674d --- /dev/null +++ b/security/PAM/patches/patch-al @@ -0,0 +1,37 @@ +$NetBSD: patch-al,v 1.1.1.1 2000/10/21 18:41:54 rh Exp $ + +--- modules/pam_issue/pam_issue.c.orig Sat Oct 21 11:56:30 2000 ++++ 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> +@@ -214,12 +215,24 @@ + 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) ? |