lastlog_get_entry error on IRIX

Damien Miller djm at mindrot.org
Tue Aug 15 10:15:47 EST 2000


On Thu, 3 Aug 2000, Jan-Frode Myklebust wrote:

> Precedence: bulk
> 
> 
> Hi, 
> 
> I'm getting the error:
> 
> sshd[71835]: lastlog_get_entry: Error reading from /var/adm/lastlog: Error 0
> 
> from openssh 2.1.1p4 on IRIX (6.5.8m). Looks like there's some confusion 
> about /var/adm/lastlog being a directory and not a file on IRIX.

Part of the problem is the error message - it does not reflect the true
file that OpenSSH is trying to open (OpenSSH supports directory-based 
lastlogs).

There is a bug in there though, can you try this patch:

Index: loginrec.c
===================================================================
RCS file: /var/cvs/openssh/loginrec.c,v
retrieving revision 1.19
diff -u -r1.19 loginrec.c
--- loginrec.c	2000/08/15 00:01:22	1.19
+++ loginrec.c	2000/08/15 00:15:12
@@ -1380,14 +1380,17 @@
 		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;
 }


-- 
| "Bombay is 250ms from New York in the new world order" - Alan Cox
| Damien Miller - http://www.mindrot.org/
| Email: djm at mindrot.org (home) -or- djm at ibs.com.au (work)








More information about the openssh-unix-dev mailing list