[Bug 1817] New: lastlog is not recorded with the big uid

bugzilla-daemon at bugzilla.mindrot.org bugzilla-daemon at bugzilla.mindrot.org
Mon Sep 13 21:07:31 EST 2010


https://bugzilla.mindrot.org/show_bug.cgi?id=1817

           Summary: lastlog is not recorded with the big uid
           Product: Portable OpenSSH
           Version: 5.6p1
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: normal
          Priority: P2
         Component: sshd
        AssignedTo: unassigned-bugs at mindrot.org
        ReportedBy: jchadima at redhat.com


Description of problem:
lastlog is not recorded with the big uid (>2147483647).


   1569 /* open the file (using filemode) and seek to the login entry
*/
   1570 static int
   1571 lastlog_openseek(struct logininfo *li, int *fd, int filemode)
   1572 {
            ...
   1600         if (type == LL_FILE) {
   1601                 /* find this uid's offset in the lastlog file
*/
   1602                 offset = (off_t) ((long)li->uid * sizeof(struct
lastlog));
   1603 
   1604                 if (lseek(*fd, offset, SEEK_SET) != offset) {
   1605                         logit("%s: %s->lseek(): %s", __func__,
   1606                             lastlog_file, strerror(errno));
   1607                         return (0);
   1608                 }

When uid is 2147483648, offset is 18446743446644326400 at line 1602.

uid       = 2147483648 (0x80000000)
(long)uid = 18446744071562067968 (0xFFFFFFFF80000000)

As a result, offset becomes so big value, lseek fails, and lastlog is
not
recorded. 

  lseek(9, 18446743446644326400, SEEK_SET) = -1 EINVAL (Invalid
argument)

-- 
Configure bugmail: https://bugzilla.mindrot.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are watching the assignee of the bug.


More information about the openssh-bugs mailing list