- (djm) Don't seek in directory based lastlogs

- (djm) Fix --with-ipaddr-display configure option test. Patch from
   Jarno Huuskonen <jhuuskon@messi.uku.fi>
This commit is contained in:
Damien Miller 2000-08-15 10:21:17 +10:00
parent c83aa83784
commit e477ef6529
3 changed files with 14 additions and 8 deletions

View File

@ -2,6 +2,9 @@
- (djm) More SunOS 4.1.x fixes from Nate Itkin <nitkin@europa.com> - (djm) More SunOS 4.1.x fixes from Nate Itkin <nitkin@europa.com>
- (djm) Avoid failures on Irix when ssh is not setuid. Fix from - (djm) Avoid failures on Irix when ssh is not setuid. Fix from
Michael Stone <mstone@cs.loyola.edu> Michael Stone <mstone@cs.loyola.edu>
- (djm) Don't seek in directory based lastlogs
- (djm) Fix --with-ipaddr-display configure option test. Patch from
Jarno Huuskonen <jhuuskon@messi.uku.fi>
20000813 20000813
- (djm) Add $(srcdir) to includes when compiling (for VPATH). Report from - (djm) Add $(srcdir) to includes when compiling (for VPATH). Report from

View File

@ -1031,7 +1031,7 @@ DISPLAY_HACK_MSG="no"
AC_ARG_WITH(ipaddr-display, AC_ARG_WITH(ipaddr-display,
[ --with-ipaddr-display Use ip address instead of hostname in \$DISPLAY], [ --with-ipaddr-display Use ip address instead of hostname in \$DISPLAY],
[ [
if test "x$withval" = "xno" ; then if test "x$withval" != "xno" ; then
AC_DEFINE(IPADDR_IN_DISPLAY) AC_DEFINE(IPADDR_IN_DISPLAY)
DISPLAY_HACK_MSG="yes" DISPLAY_HACK_MSG="yes"
fi fi

View File

@ -160,7 +160,7 @@
#include "xmalloc.h" #include "xmalloc.h"
#include "loginrec.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 ** prototypes for helper functions in this file
@ -1380,14 +1380,17 @@ lastlog_openseek(struct logininfo *li, int *fd, int filemode)
return 0; return 0;
} }
/* find this uid's offset in the lastlog file */ if (type == LL_FILE) {
offset = (off_t) ( (long)li->uid * sizeof(struct lastlog)); /* 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 ) { if ( lseek(*fd, offset, SEEK_SET) != offset ) {
log("lastlog_openseek: %s->lseek(): %s", log("lastlog_openseek: %s->lseek(): %s",
lastlog_file, strerror(errno)); lastlog_file, strerror(errno));
return 0; return 0;
}
} }
return 1; return 1;
} }