From 1fbd42b09dd7c055bc497e655e451b98fc5b6fb0 Mon Sep 17 00:00:00 2001 From: ed Date: Sun, 27 Dec 2009 22:26:29 +0000 Subject: Parse DEAD_PROCESS entries properly. The TTY line name should always be set for DEAD_PROCESS entries right now. When we parse a clean utmp entry, we don't want to interpret it as a DEAD_PROCESS entry if the TTY has never been used yet. --- lib/libulog/ulog_getutxent.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'lib/libulog') diff --git a/lib/libulog/ulog_getutxent.c b/lib/libulog/ulog_getutxent.c index bcfab48..c606ac9 100644 --- a/lib/libulog/ulog_getutxent.c +++ b/lib/libulog/ulog_getutxent.c @@ -71,7 +71,7 @@ ulog_futmp_to_utmpx(const struct futmp *ut, struct ulog_utmpx *utx) utx->ut_type = NEW_TIME; else if (MATCH(user, "shutdown") && MATCH(line, "~")) utx->ut_type = SHUTDOWN_TIME; - else if (MATCH(user, "") && MATCH(host, "")) { + else if (MATCH(user, "") && MATCH(host, "") && !MATCH(line, "")) { utx->ut_type = DEAD_PROCESS; /* XXX: ut_id and ut_pid missing. ut_line not needed. */ COPY_STRING(line); -- cgit v1.1