version 1.2, 1999/09/29 18:16:19 |
version 1.3, 1999/09/29 21:14:16 |
|
|
int fd; |
int fd; |
|
|
#ifdef _PATH_LASTLOG |
#ifdef _PATH_LASTLOG |
sprintf(lastlogfile, "%.200s/%.200s", _PATH_LASTLOG, name); |
snprintf(lastlogfile, sizeof lastlogfile, "%.200s/%.200s", |
|
_PATH_LASTLOG, name); |
#else |
#else |
#ifdef LASTLOG_FILE |
#ifdef LASTLOG_FILE |
sprintf(lastlogfile, "%.200s/%.200s", LASTLOG_FILE, name); |
snprintf(lastlogfile, sizeof lastlogfile, "%.200s/%.200s", |
|
LASTLOG_FILE, name); |
#else |
#else |
sprintf(lastlogfile, "%.200s/%.200s", SSH_LASTLOG, name); |
snprintf(lastlogfile, sizeof lastlogfile, "%.200s/%.200s", |
|
SSH_LASTLOG, name); |
#endif |
#endif |
#endif |
#endif |
|
|
strcpy(buf, ""); |
buf[0] = '\0'; |
|
|
fd = open(lastlogfile, O_RDONLY); |
fd = open(lastlogfile, O_RDONLY); |
if (fd < 0) |
if (fd < 0) |
|
|
#endif |
#endif |
#endif |
#endif |
|
|
strcpy(buf, ""); |
buf[0] = '\0'; |
|
|
fd = open(lastlog, O_RDONLY); |
fd = open(lastlog, O_RDONLY); |
if (fd < 0) |
if (fd < 0) |
|
|
strncpy(ll.ll_line, ttyname + 5, sizeof(ll.ll_line)); |
strncpy(ll.ll_line, ttyname + 5, sizeof(ll.ll_line)); |
strncpy(ll.ll_host, host, sizeof(ll.ll_host)); |
strncpy(ll.ll_host, host, sizeof(ll.ll_host)); |
#ifdef LASTLOG_IS_DIR |
#ifdef LASTLOG_IS_DIR |
sprintf(lastlogfile, "%.100s/%.100s", lastlog, user); |
snprintf(lastlogfile, sizeof lastlogfile, "%.100s/%.100s", |
|
lastlog, user); |
fd = open(lastlogfile, O_WRONLY | O_CREAT, 0644); |
fd = open(lastlogfile, O_WRONLY | O_CREAT, 0644); |
if (fd >= 0) |
if (fd >= 0) |
{ |
{ |