version 1.16, 2006/03/25 13:17:03 |
version 1.17, 2006/03/25 18:36:15 |
|
|
* information is not available. This must be called before record_login. |
* information is not available. This must be called before record_login. |
* The host the user logged in from will be returned in buf. |
* The host the user logged in from will be returned in buf. |
*/ |
*/ |
u_long |
time_t |
get_last_login_time(uid_t uid, const char *logname, |
get_last_login_time(uid_t uid, const char *logname, |
char *buf, u_int bufsize) |
char *buf, size_t bufsize) |
{ |
{ |
struct lastlog ll; |
struct lastlog ll; |
char *lastlog; |
char *lastlog; |
|
|
bufsize = sizeof(ll.ll_host) + 1; |
bufsize = sizeof(ll.ll_host) + 1; |
strncpy(buf, ll.ll_host, bufsize - 1); |
strncpy(buf, ll.ll_host, bufsize - 1); |
buf[bufsize - 1] = '\0'; |
buf[bufsize - 1] = '\0'; |
return ll.ll_time; |
return (time_t)ll.ll_time; |
} |
} |
|
|
/* |
/* |