* Use new interface to pty_update_utmp
authorSam Hartman <hartmans@mit.edu>
Tue, 8 Aug 1995 00:11:08 +0000 (00:11 +0000)
committerSam Hartman <hartmans@mit.edu>
Tue, 8 Aug 1995 00:11:08 +0000 (00:11 +0000)
git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@6455 dc483132-0cff-0310-8789-dd5450dbe970

src/appl/telnet/telnetd/ChangeLog
src/appl/telnet/telnetd/sys_term.c

index f157ca0350ae1d9b0ffbc3e2ac9e69972c3116a8..2c9c77e7c436f86c975d92271a94286e345005b8 100644 (file)
@@ -1,3 +1,8 @@
+Mon Aug  7 18:29:21 1995  Sam Hartman  <hartmans@tertius.mit.edu>
+
+       * 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
index 8b1e6cfcf3c0dd2588a3c5e55042435138d09bc9..739c05b65bdeb7fbfd2d9aace35b9facc91360de 100644 (file)
@@ -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.*/