|
|
b10636 |
diff -up Linux-PAM-1.1.8/modules/pam_lastlog/pam_lastlog.c.uninitialized Linux-PAM-1.1.8/modules/pam_lastlog/pam_lastlog.c
|
|
|
b10636 |
--- Linux-PAM-1.1.8/modules/pam_lastlog/pam_lastlog.c.uninitialized 2013-06-18 16:11:21.000000000 +0200
|
|
|
b10636 |
+++ Linux-PAM-1.1.8/modules/pam_lastlog/pam_lastlog.c 2014-08-25 16:44:24.365174752 +0200
|
|
|
b10636 |
@@ -350,6 +350,8 @@ last_login_write(pam_handle_t *pamh, int
|
|
|
b10636 |
return PAM_SERVICE_ERR;
|
|
|
b10636 |
}
|
|
|
b10636 |
|
|
|
b10636 |
+ memset(&last_login, 0, sizeof(last_login));
|
|
|
b10636 |
+
|
|
|
b10636 |
/* set this login date */
|
|
|
b10636 |
D(("set the most recent login time"));
|
|
|
b10636 |
(void) time(&ll_time); /* set the time */
|
|
|
b10636 |
@@ -364,14 +366,12 @@ last_login_write(pam_handle_t *pamh, int
|
|
|
b10636 |
}
|
|
|
b10636 |
|
|
|
b10636 |
/* copy to last_login */
|
|
|
b10636 |
- last_login.ll_host[0] = '\0';
|
|
|
b10636 |
strncat(last_login.ll_host, remote_host, sizeof(last_login.ll_host)-1);
|
|
|
b10636 |
|
|
|
b10636 |
/* set the terminal line */
|
|
|
b10636 |
terminal_line = get_tty(pamh);
|
|
|
b10636 |
|
|
|
b10636 |
/* copy to last_login */
|
|
|
b10636 |
- last_login.ll_line[0] = '\0';
|
|
|
b10636 |
strncat(last_login.ll_line, terminal_line, sizeof(last_login.ll_line)-1);
|
|
|
b10636 |
terminal_line = NULL;
|
|
|
b10636 |
|
|
|
b10636 |
@@ -628,7 +628,8 @@ pam_sm_authenticate(pam_handle_t *pamh,
|
|
|
b10636 |
lltime = (time(NULL) - lltime) / (24*60*60);
|
|
|
b10636 |
|
|
|
b10636 |
if (lltime > inactive_days) {
|
|
|
b10636 |
- pam_syslog(pamh, LOG_INFO, "user %s inactive for %d days - denied", user, lltime);
|
|
|
b10636 |
+ pam_syslog(pamh, LOG_INFO, "user %s inactive for %ld days - denied",
|
|
|
b10636 |
+ user, (long) lltime);
|
|
|
b10636 |
return PAM_AUTH_ERR;
|
|
|
b10636 |
}
|
|
|
b10636 |
|