]> andersk Git - openssh.git/blobdiff - loginrec.c
- (djm) Don't seek in directory based lastlogs
[openssh.git] / loginrec.c
index 48ab29c7cc852ba5f7dcf3607a3d8c2c94ea80f4..c233a028cdfcd5b4b45eec0c4cdf88873d8ce45f 100644 (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;
 }
 
This page took 0.032201 seconds and 4 git commands to generate.