login.c: #ifdef wrong?

Andre Lucas andre.lucas at dial.pipex.com
Sun Jan 23 11:18:23 EST 2000


In login.c, I think the #ifdef in line 67 should be an #ifndef.
Otherwise, the wrong lastlog mode is selected. Oops. I also changed the
char array name (for the dirmode filename) to lbuf, as buf shadows the
function parameter of the same name.

Patch follows.

Ta,
-Andre


--- openssh-1.2.1pre27/login.c	Fri Jan 14 04:45:50 2000
+++ openssh-1.2.1pre27.ll/login.c	Sun Jan 23 00:09:19 2000
@@ -58,20 +58,20 @@
 	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 */




-- 
Andre Lucas <andre.lucas at dial.pipex.com>
http://dspace.dial.pipex.com/andre.lucas/
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 232 bytes
Desc: not available
Url : http://lists.mindrot.org/pipermail/openssh-unix-dev/attachments/20000123/a71291c7/attachment.bin 


More information about the openssh-unix-dev mailing list