+Mon Aug 7 17:32:29 1995 Sam Hartman <hartmans@tertius.mit.edu>
-Mon Aug 7 11:26:46 EDT 1995 Paul Park (pjpark@mit.edu)
- * configure.in - Add checks for utmp[x].h so that the inclusion of
- libpty.h does the right thing.
+ * krlogind.c: Close the write side of the syncpipe in the parent
+ so we get SIGPIPE if child dies.
+
+ * login.c (main): Use new interface to pty_update_utmp
+
+ * configure.in (LOGINLIBS): Check for utmp.h and utmpx.h.
+
+ * krlogind.c (doit): Use new format for pty_update_utmp
+ * Include utmp.h because libpty.h no longer does.
Fri Aug 4 00:50:41 1995 Tom Yu <tlyu@dragons-lair.MIT.EDU>
#include "krb5.h"
#include <kerberosIV/krb.h>
#include <libpty.h>
+#ifdef HAVE_UTMP_H
+#include <utmp.h>
+#endif
int auth_sys = 0; /* Which version of Kerberos used to authenticate */
struct sgttyb b;
#endif /* POSIX_TERMIOS */
if ( retval = pty_open_slave(line, &t)) {
- com_err(progname,retval, "while opening slave");
+ fatal(f, error_message(retval));
exit(1);
}
#ifndef NO_UT_PID
{
- struct utmp ent;
- ent.ut_pid = getpid();
- ent.ut_type = LOGIN_PROCESS;
- pty_update_utmp(&ent, "rlogin", line, ""/*host*/);
+ pty_update_utmp(PTY_LOGIN_PROCESS, getpid(), "rlogin", line, ""/*host*/);
}
#endif
** The master blocks here until it reads a byte.
*/
+(void) close(syncpipe[1]);
if (read(syncpipe[0], &c, 1) != 1) {
/*
* Problems read failed ...
fatalperror(p,buferror);
}
close(syncpipe[0]);
- close(syncpipe[1]);
+
#if defined(KERBEROS)
if (do_encrypt) {
* only one of: -r -h -k -K
*/
+#include <libpty.h>
+
#ifdef HAVE_UNISTD_H
#include <unistd.h>
#endif
{
struct utmp utmp;
-#ifndef NO_UT_PID
- utmp.ut_type = USER_PROCESS;
- utmp.ut_pid = getppid();
-#endif
login_time = time(&utmp.ut_time);
- if ( (retval = pty_update_utmp(&utmp, username, ttyn, hostname)) < 0 )
+ if ( (retval = pty_update_utmp(PTY_USER_PROCESS, getpid(), username, ttyn, hostname)) < 0 )
com_err (argv[0], retval, "while updating utmp");
}