diff options
author | Damien Miller <djm@mindrot.org> | 2000-01-23 20:18:35 +1100 |
---|---|---|
committer | Damien Miller <djm@mindrot.org> | 2000-01-23 20:18:35 +1100 |
commit | def0dc9bcc68bf38170e073990873bb67a7079ad (patch) | |
tree | 12a5134f0a61dcad4a7503da0d416e63f27eb354 /login.c | |
parent | 641a63f7a34ce60420768c3cdb107055241df87a (diff) |
- Fix lastlog support, patch from Andre Lucas <andre.lucas@dial.pipex.com>
Diffstat (limited to 'login.c')
-rw-r--r-- | login.c | 10 |
1 files changed, 5 insertions, 5 deletions
@@ -18,7 +18,7 @@ */ #include "includes.h" -RCSID("$Id: login.c,v 1.18 2000/01/14 04:45:50 damien Exp $"); +RCSID("$Id: login.c,v 1.19 2000/01/23 09:18:36 damien Exp $"); #if defined(HAVE_UTMPX_H) && defined(USE_UTMPX) # include <utmpx.h> @@ -58,20 +58,20 @@ get_last_login_time(uid_t uid, const char *logname, char *lastlog; int fd; #ifdef LASTLOG_IS_DIR - char buf[1024]; + char lbuf[1024]; #endif /* LASTLOG_IS_DIR */ lastlog = _PATH_LASTLOG; buf[0] = '\0'; -#ifdef LASTLOG_IS_DIR +#ifndef LASTLOG_IS_DIR fd = open(lastlog, O_RDONLY); if (fd < 0) return 0; lseek(fd, (off_t) ((long) uid * sizeof(ll)), SEEK_SET); #else /* LASTLOG_IS_DIR */ - snprintf(buf, sizeof(buf), "%s/%s", lastlog, logname); - fd = open(buf, O_RDONLY); + snprintf(lbuf, sizeof(buf), "%s/%s", lastlog, logname); + fd = open(lbuf, O_RDONLY); if (fd < 0) return 0; #endif /* LASTLOG_IS_DIR */ |