PR/17999: FUKAUMI Naoki: Support wtmpx entries.

This commit is contained in:
christos 2002-08-20 13:12:00 +00:00
parent 88122ef746
commit 6c99012e39
4 changed files with 20 additions and 8 deletions

View File

@ -1,4 +1,4 @@
# $NetBSD: Makefile,v 1.8 2000/01/31 14:20:13 itojun Exp $
# $NetBSD: Makefile,v 1.9 2002/08/20 13:14:41 christos Exp $
# from: @(#)Makefile 8.1 (Berkeley) 6/4/93
PROG= rlogind
@ -6,6 +6,6 @@ MAN= rlogind.8
DPADD= ${LIBUTIL}
LDADD= -lutil
CPPFLAGS+= -DINET6
CPPFLAGS+= -DINET6 -DSUPPORT_UTMP -DSUPPORT_UTMPX
.include <bsd.prog.mk>

View File

@ -1,4 +1,4 @@
/* $NetBSD: rlogind.c,v 1.25 2002/08/01 18:52:06 christos Exp $ */
/* $NetBSD: rlogind.c,v 1.26 2002/08/20 13:14:41 christos Exp $ */
/*
* Copyright (C) 1998 WIDE Project.
@ -73,7 +73,7 @@ __COPYRIGHT("@(#) Copyright (c) 1983, 1988, 1989, 1993\n\
#if 0
static char sccsid[] = "@(#)rlogind.c 8.2 (Berkeley) 4/28/95";
#else
__RCSID("$NetBSD: rlogind.c,v 1.25 2002/08/01 18:52:06 christos Exp $");
__RCSID("$NetBSD: rlogind.c,v 1.26 2002/08/20 13:14:41 christos Exp $");
#endif
#endif /* not lint */
@ -605,8 +605,14 @@ cleanup(signo)
char *p, c;
p = line + sizeof(_PATH_DEV) - 1;
#ifdef SUPPORT_UTMP
if (logout(p))
logwtmp(p, "", "");
#endif
#ifdef SUPPORT_UTMPX
if (logoutx(p, 0, DEAD_PROCESS))
logwtmpx(p, "", "", 0, DEAD_PROCESS);
#endif
(void)chmod(line, 0666);
(void)chown(line, 0, 0);
c = *p; *p = 'p';

View File

@ -1,4 +1,4 @@
# $NetBSD: Makefile,v 1.32 2002/08/19 13:54:37 lukem Exp $
# $NetBSD: Makefile,v 1.33 2002/08/20 13:12:00 christos Exp $
# from: @(#)Makefile 8.2 (Berkeley) 12/15/93
.include <bsd.own.mk>
@ -9,7 +9,7 @@ CPPFLAGS+=-DINET6
PROG= telnetd
CPPFLAGS+=-DLINEMODE -DKLUDGELINEMODE -DUSE_TERMIO -DDIAGNOSTICS -DOPENPTY_PTY
CPPFLAGS+=-DOLD_ENVIRON -DENV_HACK -DSECURELOGIN
CPPFLAGS+=-DOLD_ENVIRON -DENV_HACK -DSECURELOGIN -DSUPPORT_UTMP -DSUPPORT_UTMPX
SRCS= authenc.c global.c slc.c state.c sys_term.c telnetd.c \
termstat.c utility.c
DPADD= ${LIBUTIL} ${LIBTERMCAP} ${LIBTELNET}

View File

@ -1,4 +1,4 @@
/* $NetBSD: sys_term.c,v 1.31 2001/09/02 18:32:35 wiz Exp $ */
/* $NetBSD: sys_term.c,v 1.32 2002/08/20 13:12:00 christos Exp $ */
/*
* Copyright (c) 1989, 1993
@ -38,7 +38,7 @@
#if 0
static char sccsid[] = "@(#)sys_term.c 8.4+1 (Berkeley) 5/30/95";
#else
__RCSID("$NetBSD: sys_term.c,v 1.31 2001/09/02 18:32:35 wiz Exp $");
__RCSID("$NetBSD: sys_term.c,v 1.32 2002/08/20 13:12:00 christos Exp $");
#endif
#endif /* not lint */
@ -1787,8 +1787,14 @@ cleanup(sig)
char *p, c;
p = line + sizeof("/dev/") - 1;
#ifdef SUPPORT_UTMP
if (logout(p))
logwtmp(p, "", "");
#endif
#ifdef SUPPORT_UTMPX
if (logoutx(p, 0, DEAD_PROCESS))
logwtmpx(p, "", "", 0, DEAD_PROCESS);
#endif
(void)chmod(line, 0666);
(void)chown(line, 0, 0);
c = *p; *p = 'p';