(*): make sure to always call time, ctime, and gmtime with `time_t's.

there were some types (like in lastlog) that we believed to always be
time_t.  this has proven wrong on Solaris 8 in 64-bit mode, where they
are stored as 32-bit quantities but time_t has gone up to 64 bits


git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@8068 ec53bebd-3082-4978-b11e-865c3cabbd6b
This commit is contained in:
Assar Westerlund
2000-03-26 19:48:27 +00:00
parent c4c623ae05
commit 34406dd27b

View File

@@ -1154,7 +1154,7 @@ startslave(char *host, int autologin, char *autoname)
/*
* Create utmp entry for child
*/
time(&wtmp.ut_time);
wtmp.ut_time = time(NULL);
wtmp.ut_type = LOGIN_PROCESS;
wtmp.ut_pid = pid;
strncpy(wtmp.ut_user, "LOGIN", sizeof(wtmp.ut_user));
@@ -1423,7 +1423,7 @@ rmut(void)
#ifdef HAVE_STRUCT_UTMP_UT_HOST
strncpy(wtmp.ut_host, "", sizeof(wtmp.ut_host));
#endif
time(&wtmp.ut_time);
wtmp.ut_time = time(NULL);
write(f, &wtmp, sizeof(wtmp));
close(f);
}
@@ -1467,7 +1467,7 @@ rmut(void)
#ifdef HAVE_STRUCT_UTMP_UT_HOST
strncpy(u->ut_host, "", sizeof(u->ut_host));
#endif
time(&u->ut_time);
u->ut_time = time(NULL);
write(f, u, sizeof(wtmp));
found++;
}
@@ -1482,7 +1482,7 @@ rmut(void)
#ifdef HAVE_STRUCT_UTMP_UT_HOST
strncpy(wtmp.ut_host, "", sizeof(wtmp.ut_host));
#endif
time(&wtmp.ut_time);
wtmp.ut_time = time(NULL);
write(f, &wtmp, sizeof(wtmp));
close(f);
}