From 6b82e262019ee41ad0ecf175a3e2235aeb18c896 Mon Sep 17 00:00:00 2001 From: Sam Hartman Date: Tue, 8 Aug 1995 00:11:08 +0000 Subject: [PATCH] * Use new interface to pty_update_utmp git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@6455 dc483132-0cff-0310-8789-dd5450dbe970 --- src/appl/telnet/telnetd/ChangeLog | 5 +++++ src/appl/telnet/telnetd/sys_term.c | 24 ++++++------------------ 2 files changed, 11 insertions(+), 18 deletions(-) diff --git a/src/appl/telnet/telnetd/ChangeLog b/src/appl/telnet/telnetd/ChangeLog index f157ca035..2c9c77e7c 100644 --- a/src/appl/telnet/telnetd/ChangeLog +++ b/src/appl/telnet/telnetd/ChangeLog @@ -1,3 +1,8 @@ +Mon Aug 7 18:29:21 1995 Sam Hartman + + * sys_term.c: Use new interface to pty_update_utmp. + (getptyslave): Handle error return from pty_open_slave + Close syncpipe[1] before we read from it. Mon Aug 7 14:44:21 EDT 1995 Paul Park (pjpark@mit.edu) * configure.in, sys_term.c - Use utmpx.h if present, then check for diff --git a/src/appl/telnet/telnetd/sys_term.c b/src/appl/telnet/telnetd/sys_term.c index 8b1e6cfcf..739c05b65 100644 --- a/src/appl/telnet/telnetd/sys_term.c +++ b/src/appl/telnet/telnetd/sys_term.c @@ -958,10 +958,9 @@ getptyslave() waslm = tty_linemode(); # endif - if ( (retval = pty_open_slave (line, &t)) < 0 ) + if ( (retval = pty_open_slave (line, &t)) != 0 ) { - com_err(retval, "telnetd", "while opening slave terminal"); - fatalperror(net, line); + fatalperror(net, error_message(retval)); } #ifdef STREAMSPTY @@ -1126,25 +1125,14 @@ slavepid = i; /* So we can clean it up later */ #endif /* Wait for child before writing to parent side of pty.*/ +(void) close(syncpipe[1]); read(syncpipe[0], &c, 1); close(syncpipe[0]); - close(syncpipe[1]); + } else { - /* - * Create utmp entry for child - */ -#ifdef UTMPX - (void) time(&wtmp.ut_tv.tv_sec); - wtmp.ut_tv.tv_usec = 0; -#else /* UTMPX */ - (void) time(&wtmp.ut_time); -#endif /* UTMPX */ - wtmp.ut_type = LOGIN_PROCESS; - wtmp.ut_pid = getpid(); - - -pty_update_utmp (&wtmp, "LOGIN", line, host); + + pty_update_utmp (PTY_LOGIN_PROCESS, getpid(), "LOGIN", line, host); getptyslave(autologin); /* Notify our parent we're ready to continue.*/ -- 2.26.2