summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog1
-rw-r--r--login.c10
2 files changed, 6 insertions, 5 deletions
diff --git a/ChangeLog b/ChangeLog
index 74b20e8d6..6f9542086 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -4,6 +4,7 @@
4 getsockname() requires initialized tolen; andy@guildsoftware.com 4 getsockname() requires initialized tolen; andy@guildsoftware.com
5 - AIX patch from Matt Richards <v2matt@btv.ibm.com> and David Rankin 5 - AIX patch from Matt Richards <v2matt@btv.ibm.com> and David Rankin
6 <drankin@bohemians.lexington.ky.us> 6 <drankin@bohemians.lexington.ky.us>
7 - Fix lastlog support, patch from Andre Lucas <andre.lucas@dial.pipex.com>
7 8
820000122 920000122
9 - Fix compilation of bsd-snprintf.c on Solaris, fix from Ben Taylor 10 - Fix compilation of bsd-snprintf.c on Solaris, fix from Ben Taylor
diff --git a/login.c b/login.c
index f95cbcee8..29259f511 100644
--- a/login.c
+++ b/login.c
@@ -18,7 +18,7 @@
18 */ 18 */
19 19
20#include "includes.h" 20#include "includes.h"
21RCSID("$Id: login.c,v 1.18 2000/01/14 04:45:50 damien Exp $"); 21RCSID("$Id: login.c,v 1.19 2000/01/23 09:18:36 damien Exp $");
22 22
23#if defined(HAVE_UTMPX_H) && defined(USE_UTMPX) 23#if defined(HAVE_UTMPX_H) && defined(USE_UTMPX)
24# include <utmpx.h> 24# include <utmpx.h>
@@ -58,20 +58,20 @@ get_last_login_time(uid_t uid, const char *logname,
58 char *lastlog; 58 char *lastlog;
59 int fd; 59 int fd;
60#ifdef LASTLOG_IS_DIR 60#ifdef LASTLOG_IS_DIR
61 char buf[1024]; 61 char lbuf[1024];
62#endif /* LASTLOG_IS_DIR */ 62#endif /* LASTLOG_IS_DIR */
63 63
64 lastlog = _PATH_LASTLOG; 64 lastlog = _PATH_LASTLOG;
65 buf[0] = '\0'; 65 buf[0] = '\0';
66 66
67#ifdef LASTLOG_IS_DIR 67#ifndef LASTLOG_IS_DIR
68 fd = open(lastlog, O_RDONLY); 68 fd = open(lastlog, O_RDONLY);
69 if (fd < 0) 69 if (fd < 0)
70 return 0; 70 return 0;
71 lseek(fd, (off_t) ((long) uid * sizeof(ll)), SEEK_SET); 71 lseek(fd, (off_t) ((long) uid * sizeof(ll)), SEEK_SET);
72#else /* LASTLOG_IS_DIR */ 72#else /* LASTLOG_IS_DIR */
73 snprintf(buf, sizeof(buf), "%s/%s", lastlog, logname); 73 snprintf(lbuf, sizeof(buf), "%s/%s", lastlog, logname);
74 fd = open(buf, O_RDONLY); 74 fd = open(lbuf, O_RDONLY);
75 if (fd < 0) 75 if (fd < 0)
76 return 0; 76 return 0;
77#endif /* LASTLOG_IS_DIR */ 77#endif /* LASTLOG_IS_DIR */