From owner-freebsd-audit Wed May 23 8:48: 2 2001 Delivered-To: freebsd-audit@freebsd.org Received: from whale.sunbay.crimea.ua (whale.sunbay.crimea.ua [212.110.138.65]) by hub.freebsd.org (Postfix) with ESMTP id 9D7A137B424; Wed, 23 May 2001 08:47:52 -0700 (PDT) (envelope-from ru@whale.sunbay.crimea.ua) Received: (from ru@localhost) by whale.sunbay.crimea.ua (8.11.2/8.11.2) id f4NFlnR31340; Wed, 23 May 2001 18:47:49 +0300 (EEST) (envelope-from ru) Date: Wed, 23 May 2001 18:47:49 +0300 From: Ruslan Ermilov To: audit@FreeBSD.org Cc: dg@FreeBSD.org Subject: last(1) patch Message-ID: <20010523184749.A30464@sunbay.com> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="k1lZvvs/B4yU6o8G" Content-Disposition: inline User-Agent: Mutt/1.2.5i Sender: owner-freebsd-audit@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG --k1lZvvs/B4yU6o8G Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Hi! The last(1) chokes if there are two successive "login" marks found in wtmp(5) (for the same tty) without in-between "logout" mark. This may be demonstrated by executing /usr/bin/login (not the built-in shell's ``login''), logging in, and watching the last(1) output for this tty. Then exit _twice_, and watch the last(1) output again. The patch merely takes the second "login" mark as the end for the first "login" mark, if there is no "logout" mark in-between. This restores the behavior of last.c, revision 1.2. Cheers, -- Ruslan Ermilov Oracle Developer/DBA, ru@sunbay.com Sunbay Software AG, ru@FreeBSD.org FreeBSD committer, +380.652.512.251 Simferopol, Ukraine http://www.FreeBSD.org The Power To Serve http://www.oracle.com Enabling The Information Age --k1lZvvs/B4yU6o8G Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=p Index: last.c =================================================================== RCS file: /home/ncvs/src/usr.bin/last/last.c,v retrieving revision 1.10.6.2 diff -u -p -r1.10.6.2 last.c --- last.c 2001/03/04 08:39:25 1.10.6.2 +++ last.c 2001/05/21 10:10:35 @@ -309,13 +309,10 @@ wtmp() delta / 86400, width, width, ct + 11); } } - LIST_REMOVE(tt, list); - free(tt); if (maxrec != -1 && !--maxrec) return; - } else { - tt->logout = bp->ut_time; } + tt->logout = bp->ut_time; } } } --k1lZvvs/B4yU6o8G-- To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-audit" in the body of the message