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