0.74: please submit patches for this section with actual code/doc
patches!
+* improved portability of pam_unix by eliminating Linux-specific utmp
+ defines in PAM_getlogin() (Bug 125704 - vorlon)
* removed static variables from pam_tally (Bug 117434 - agmorgan)
* added copyright message to pam_access module from original logdaemon
sources (Bug 125022 - agmorgan)
}
/*
- * Beacause getlogin() is fucked in a weird way, and
- * sometimes it just don't work, we reimplement it here.
+ * Beacause getlogin() is braindead and sometimes it just
+ * doesn't work, we reimplement it here.
*/
char *PAM_getlogin(void)
{
struct utmp *ut, line;
char *curr_tty, *retval;
- static char curr_user[UT_NAMESIZE + 4];
+ static char curr_user[sizeof(ut->ut_user) + 4];
retval = NULL;
setutent();
strncpy(line.ut_line, curr_tty, sizeof line.ut_line);
if ((ut = getutline(&line)) != NULL) {
- strncpy(curr_user, ut->ut_user, UT_NAMESIZE);
+ strncpy(curr_user, ut->ut_user, sizeof(ut->ut_user));
retval = curr_user;
}
endutent();