$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 #include #include +#include #include #include #include @@ -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) ?