[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Utmp/wtmp handling in glibc/libc6

Hi folks,

I noticed that Debian is "converting to GNU LIBC 6".  
Since I am working on the utmp/wtmp handling in the GNU C Library, and
considering the fact that there are compatibility problems with
respect to this between libc5 and libc6, please read on.

The GNU C Library will provide a daemon to make sure that both libc5
and libc6 programs will be able to function correctly and will be
provided with the same and the correct data.  Currently this daemon
only handles /var/run/utmp, but it will be extended to handle
/var/log/wtmp too.  Although it has not been widely tested, it appears
to be working fine.  People who are interested could take a look at
recent glibc developers snapshots.  In order to make this approach
work it is VERY important that programs linked against libc6 DO NOT
access /var/run/utmp and /var/log/wtmp directly.  Instead they should
use the functions provided in libc and libutil:

* utmpname()
  For accessing different databases than the standard /var/run/utmp.

* setutent()
  For opening the database.

* getutent(), getutid() and getutline()
  For reading entries from the database.

* pututline()
  For writing entries to utmp-like databases.

* endutent()
  For closing the database.

* updwtmp()
  For writing entries to wtmp-like databases.

For the prototypes of these functions, please refer to the <utmp.h>
header file.  Note that updwtmp() is provided in libutil in the
current release (2.0.4) but has been moved to libc in the development

Since login(), logout() and logwtmp() in libutil, are implemented by
calling the functions described above, so their use is OK too.

If you need/want more information abou this issue, don't hesitate to
ask me!

Mark Kettenis

PS I'm not on the debian-devel mailing list, so please CC me if you
reply to my message.

TO UNSUBSCRIBE FROM THIS MAILING LIST: e-mail the word "unsubscribe" to
debian-devel-request@lists.debian.org . 
Trouble?  e-mail to templin@bucknell.edu .

Reply to: