Mailing List Archive

login.c: #ifdef wrong?
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@dial.pipex.com>
http://dspace.dial.pipex.com/andre.lucas/