summaryrefslogtreecommitdiff
path: root/loginrec.c
diff options
context:
space:
mode:
authorDamien Miller <djm@mindrot.org>2000-08-15 10:21:17 +1000
committerDamien Miller <djm@mindrot.org>2000-08-15 10:21:17 +1000
commite477ef65294501de06096cfecb6cfcc923f634f5 (patch)
tree1d569c95095d2bac58a33aacc105b3c93dc42612 /loginrec.c
parentc83aa8378447861b1bc0a030fdb32f78783dc979 (diff)
downloadopenssh-git-e477ef65294501de06096cfecb6cfcc923f634f5.tar.gz
- (djm) Don't seek in directory based lastlogs
- (djm) Fix --with-ipaddr-display configure option test. Patch from Jarno Huuskonen <jhuuskon@messi.uku.fi>
Diffstat (limited to 'loginrec.c')
-rw-r--r--loginrec.c17
1 files changed, 10 insertions, 7 deletions
diff --git a/loginrec.c b/loginrec.c
index 798e966f..6b87ba32 100644
--- a/loginrec.c
+++ b/loginrec.c
@@ -160,7 +160,7 @@
#include "xmalloc.h"
#include "loginrec.h"
-RCSID("$Id: loginrec.c,v 1.19 2000/08/15 00:01:22 djm Exp $");
+RCSID("$Id: loginrec.c,v 1.20 2000/08/15 00:21:17 djm Exp $");
/**
** prototypes for helper functions in this file
@@ -1380,14 +1380,17 @@ lastlog_openseek(struct logininfo *li, int *fd, int filemode)
return 0;
}
- /* find this uid's offset in the lastlog file */
- offset = (off_t) ( (long)li->uid * sizeof(struct lastlog));
+ if (type == LL_FILE) {
+ /* find this uid's offset in the lastlog file */
+ offset = (off_t) ( (long)li->uid * sizeof(struct lastlog));
- if ( lseek(*fd, offset, SEEK_SET) != offset ) {
- log("lastlog_openseek: %s->lseek(): %s",
- lastlog_file, strerror(errno));
- return 0;
+ if ( lseek(*fd, offset, SEEK_SET) != offset ) {
+ log("lastlog_openseek: %s->lseek(): %s",
+ lastlog_file, strerror(errno));
+ return 0;
+ }
}
+
return 1;
}