You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
37 lines
1.4 KiB
37 lines
1.4 KiB
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 |
|
--- Linux-PAM-1.1.8/modules/pam_lastlog/pam_lastlog.c.uninitialized 2013-06-18 16:11:21.000000000 +0200 |
|
+++ Linux-PAM-1.1.8/modules/pam_lastlog/pam_lastlog.c 2014-08-25 16:44:24.365174752 +0200 |
|
@@ -350,6 +350,8 @@ last_login_write(pam_handle_t *pamh, int |
|
return PAM_SERVICE_ERR; |
|
} |
|
|
|
+ memset(&last_login, 0, sizeof(last_login)); |
|
+ |
|
/* set this login date */ |
|
D(("set the most recent login time")); |
|
(void) time(&ll_time); /* set the time */ |
|
@@ -364,14 +366,12 @@ last_login_write(pam_handle_t *pamh, int |
|
} |
|
|
|
/* copy to last_login */ |
|
- last_login.ll_host[0] = '\0'; |
|
strncat(last_login.ll_host, remote_host, sizeof(last_login.ll_host)-1); |
|
|
|
/* set the terminal line */ |
|
terminal_line = get_tty(pamh); |
|
|
|
/* copy to last_login */ |
|
- last_login.ll_line[0] = '\0'; |
|
strncat(last_login.ll_line, terminal_line, sizeof(last_login.ll_line)-1); |
|
terminal_line = NULL; |
|
|
|
@@ -628,7 +628,8 @@ pam_sm_authenticate(pam_handle_t *pamh, |
|
lltime = (time(NULL) - lltime) / (24*60*60); |
|
|
|
if (lltime > inactive_days) { |
|
- pam_syslog(pamh, LOG_INFO, "user %s inactive for %d days - denied", user, lltime); |
|
+ pam_syslog(pamh, LOG_INFO, "user %s inactive for %ld days - denied", |
|
+ user, (long) lltime); |
|
return PAM_AUTH_ERR; |
|
} |
|
|
|
|