summaryrefslogtreecommitdiff
path: root/modules/pam_lastlog/pam_lastlog.c
diff options
context:
space:
mode:
authorThorsten Kukuk <kukuk@thkukuk.de>2003-11-25 09:00:06 +0000
committerThorsten Kukuk <kukuk@thkukuk.de>2003-11-25 09:00:06 +0000
commit18e6fba994dd532827d3dda91d290ff4c73fa318 (patch)
treebdf9527034c8cf37c7f758301bd84a75630714cb /modules/pam_lastlog/pam_lastlog.c
parent133dfdf24686821d5c716a711c26ee141bd96843 (diff)
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.
Diffstat (limited to 'modules/pam_lastlog/pam_lastlog.c')
-rw-r--r--modules/pam_lastlog/pam_lastlog.c8
1 files changed, 6 insertions, 2 deletions
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);