Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 23 May 2001 18:47:49 +0300
From:      Ruslan Ermilov <ru@FreeBSD.org>
To:        audit@FreeBSD.org
Cc:        dg@FreeBSD.org
Subject:   last(1) patch
Message-ID:  <20010523184749.A30464@sunbay.com>

next in thread | raw e-mail | index | archive | help

--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




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20010523184749.A30464>