summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authored <ed@FreeBSD.org>2010-01-13 17:58:49 +0000
committered <ed@FreeBSD.org>2010-01-13 17:58:49 +0000
commit6998c5b40b0c1ba61deeb3a2b475536f7f47c7d7 (patch)
tree7ea888f572b39bd76f68a122880443ab7e09ee75
parent41d3ef12588da7a97389a26cf928312aac1f68eb (diff)
downloadFreeBSD-src-6998c5b40b0c1ba61deeb3a2b475536f7f47c7d7.zip
FreeBSD-src-6998c5b40b0c1ba61deeb3a2b475536f7f47c7d7.tar.gz
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.
-rw-r--r--sbin/init/Makefile4
-rw-r--r--sbin/init/init.c9
2 files changed, 8 insertions, 5 deletions
diff --git a/sbin/init/Makefile b/sbin/init/Makefile
index 7778c71..7497a4b 100644
--- a/sbin/init/Makefile
+++ b/sbin/init/Makefile
@@ -6,8 +6,8 @@ MAN= init.8
PRECIOUSPROG=
INSTALLFLAGS=-b -B.bak
CFLAGS+=-DDEBUGSHELL -DSECURE -DLOGIN_CAP -DCOMPAT_SYSV_INIT
-DPADD= ${LIBUTIL} ${LIBULOG} ${LIBCRYPT}
-LDADD= -lutil -lulog -lcrypt
+DPADD= ${LIBUTIL} ${LIBCRYPT}
+LDADD= -lutil -lcrypt
NO_SHARED?= YES
diff --git a/sbin/init/init.c b/sbin/init/init.c
index 58e6739..e808f19 100644
--- a/sbin/init/init.c
+++ b/sbin/init/init.c
@@ -65,9 +65,9 @@ static const char rcsid[] =
#include <syslog.h>
#include <time.h>
#include <ttyent.h>
-#define _ULOG_POSIX_NAMES
#include <ulog.h>
#include <unistd.h>
+#include <utmpx.h>
#include <sys/reboot.h>
#include <err.h>
@@ -569,10 +569,13 @@ transition(state_t s)
* NB: should send a message to the session logger to avoid blocking.
*/
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?
+ */
}
/*
OpenPOWER on IntegriCloud