mirror of
https://github.com/freebsd/freebsd-src.git
synced 2024-11-28 09:02:44 +00:00
Migrate init(8) towards utmpx.
According to a comment, we cannot safely remove utmpx entries here anymore. This is because the libc routines may block on file locking. In an ideal world login(1) should just remove the entries, which is why I'm disabling this code for now. If it turns out we get lots of stale entries here, we should figure out a way to deal with that.
This commit is contained in:
parent
759dba8c5a
commit
bb6c761206
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=202194
@ -6,8 +6,8 @@ MAN= init.8
|
|||||||
PRECIOUSPROG=
|
PRECIOUSPROG=
|
||||||
INSTALLFLAGS=-b -B.bak
|
INSTALLFLAGS=-b -B.bak
|
||||||
CFLAGS+=-DDEBUGSHELL -DSECURE -DLOGIN_CAP -DCOMPAT_SYSV_INIT
|
CFLAGS+=-DDEBUGSHELL -DSECURE -DLOGIN_CAP -DCOMPAT_SYSV_INIT
|
||||||
DPADD= ${LIBUTIL} ${LIBULOG} ${LIBCRYPT}
|
DPADD= ${LIBUTIL} ${LIBCRYPT}
|
||||||
LDADD= -lutil -lulog -lcrypt
|
LDADD= -lutil -lcrypt
|
||||||
|
|
||||||
NO_SHARED?= YES
|
NO_SHARED?= YES
|
||||||
|
|
||||||
|
@ -65,9 +65,9 @@ static const char rcsid[] =
|
|||||||
#include <syslog.h>
|
#include <syslog.h>
|
||||||
#include <time.h>
|
#include <time.h>
|
||||||
#include <ttyent.h>
|
#include <ttyent.h>
|
||||||
#define _ULOG_POSIX_NAMES
|
|
||||||
#include <ulog.h>
|
#include <ulog.h>
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
|
#include <utmpx.h>
|
||||||
#include <sys/reboot.h>
|
#include <sys/reboot.h>
|
||||||
#include <err.h>
|
#include <err.h>
|
||||||
|
|
||||||
@ -569,10 +569,13 @@ transition(state_t s)
|
|||||||
* NB: should send a message to the session logger to avoid blocking.
|
* NB: should send a message to the session logger to avoid blocking.
|
||||||
*/
|
*/
|
||||||
static void
|
static void
|
||||||
clear_session_logs(session_t *sp)
|
clear_session_logs(session_t *sp __unused)
|
||||||
{
|
{
|
||||||
|
|
||||||
ulog_logout(sp->se_device);
|
/*
|
||||||
|
* XXX: Use getutxline() and call pututxline() for each entry.
|
||||||
|
* Is this safe to do this here? Is it really required anyway?
|
||||||
|
*/
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
Loading…
Reference in New Issue
Block a user