Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 28 Feb 1998 23:21:08 +0000 (GMT)
From:      Terry Lambert <tlambert@primenet.com>
To:        1193016@student.unpar.ac.id (Thomas Wahyudi)
Cc:        freebsd-hackers@FreeBSD.ORG
Subject:   Re: lastlog data not change during adduser
Message-ID:  <199802282321.QAA09889@usr08.primenet.com>
In-Reply-To: <Pine.BSF.3.96.980228195357.1583B-100000@student.unpar.ac.id> from "Thomas Wahyudi" at Feb 28, 98 07:58:17 pm

next in thread | previous in thread | raw e-mail | index | archive | help
> Hi, I wonder, why when I remove user A uid X  and add user B,
> user B uid become X. Then I finger user B, hmm the lastlog show that
> last login user B is same with user A.

Accounting in /var/log/lastlog is done by uid.

> Should, lastlog initialize data if user A is removed ?

You should probably monotonically increase user ID's to avoid the
reuse, if possible.  This gets into "wrap regions", etc., for
complicated user setups.

The problem is that you really do *not* want to destroy the
accounting information for the previous user.

One possible fix is a generation count.  Another possible fix is
"user reset" lastlog entry.  One way to implement this would be to
write a 0 valued time_t for the user to lastlog when a user is
deleted, and use this as a flag.  You would have to inform all
utilities about this, and include the possibility of displaying
different generations of users (ie: if you saw three such records,
then you would report the current user's accounting records  as
"fourth generation", and there would need to be some generation
selector to things like last, which only applied when a specific
user id was specified (ie: for UID 1075, a numberic id should be
used, as in 1075:1 for the first instance of 1075's records).

Ie: it's a lot easier to just use monotonically increasing UID's
and expect that the lastlog will be rolled (aging the old ID out)
before it ever becomes an issue.


					Terry Lambert
					terry@lambert.org
---
Any opinions in this posting are my own and not those of my present
or previous employers.

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-hackers" in the body of the message



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