[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
Re: db(3) removal and lastlogx
On Mon, Jun 11, 2012 at 06:21:23PM +0200, Manuel Bouyer wrote:
> On Thu, Jun 07, 2012 at 08:36:36AM +0200, Joerg Sonnenberger wrote:
> > Hi all,
> > there is a bit mechnical work left to remove db(3) dependencies e.g. for
> > the password database, but that's mostly that. The last real consume of
> > the db(3) API in libc is the lastlogx handling in utmpx. Basically, this
> > logs a record in a file indexed by uid. I can think of three different
> > approaches for dealing with this:
> > (1) Just use a sparse file. This requires by far the least amount of
> > code, just some verification logic for a file header and writing to "uid
> > * size of entry". Writes should be short enough to ensure atomic writes
> > even on NFS. Same for reads. No manual locking needed.
> With 32bit uids, this will be very large files. We should avoid this.
Only if you carefully choose your UID space relative to the file
system block size to maximize the amount of unused space that must
nonetheless be materialized. That is foolish.
Unless you expect to have a billion users...?
David A. Holland
Main Index |
Thread Index |