From 18e6fba994dd532827d3dda91d290ff4c73fa318 Mon Sep 17 00:00:00 2001 From: Thorsten Kukuk Date: Tue, 25 Nov 2003 09:00:06 +0000 Subject: Relevant BUGIDs: 848325 Purpose of commit: bugfix Commit summary: --------------- Don't use ll_time from utmp struct as argument for ctime/time, this does not work on new 64bit architectures. Instead use a temporary copy. --- modules/pam_lastlog/pam_lastlog.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'modules/pam_lastlog/pam_lastlog.c') diff --git a/modules/pam_lastlog/pam_lastlog.c b/modules/pam_lastlog/pam_lastlog.c index c86becd8..f9a730bf 100644 --- a/modules/pam_lastlog/pam_lastlog.c +++ b/modules/pam_lastlog/pam_lastlog.c @@ -254,10 +254,12 @@ static int last_login_date(pam_handle_t *pamh, int announce, uid_t uid) if (!(announce & LASTLOG_QUIET)) { if (last_login.ll_time) { + time_t ll_time; char *the_time; char *remark; - the_time = ctime(&last_login.ll_time); + ll_time = last_login.ll_time; + the_time = ctime(&ll_time); the_time[-1+strlen(the_time)] = '\0'; /* delete '\n' */ remark = malloc(LASTLOG_MAXSIZE); @@ -319,13 +321,15 @@ static int last_login_date(pam_handle_t *pamh, int announce, uid_t uid) /* write latest value */ { + time_t ll_time; const char *remote_host=NULL , *terminal_line=DEFAULT_TERM; /* set this login date */ D(("set the most recent login time")); - (void) time(&last_login.ll_time); /* set the time */ + (void) time(&ll_time); /* set the time */ + last_login.ll_time = ll_time; /* set the remote host */ (void) pam_get_item(pamh, PAM_RHOST, (const void **)&remote_host); -- cgit v1.2.3