summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorSam Hartman <hartmans@mit.edu>1995-08-07 23:59:39 +0000
committerSam Hartman <hartmans@mit.edu>1995-08-07 23:59:39 +0000
commit4428823783d62496b6df8b59251fc5da6841c25c (patch)
tree16beeeedebb9c64839b78d60dfea79499bb9c998 /src
parent086beadfebe7c157f8c3f53c3c07a92d9624e38b (diff)
* Include utmp.h in krlogind.c; libpty.h doesn't any more and it needs them to find size of ut_name.
* Use new interface to pty_update_utmp. git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@6454 dc483132-0cff-0310-8789-dd5450dbe970
Diffstat (limited to 'src')
-rw-r--r--src/appl/bsd/ChangeLog13
-rw-r--r--src/appl/bsd/krlogind.c13
-rw-r--r--src/appl/bsd/login.c8
3 files changed, 20 insertions, 14 deletions
diff --git a/src/appl/bsd/ChangeLog b/src/appl/bsd/ChangeLog
index 0210206da..a95e13e5b 100644
--- a/src/appl/bsd/ChangeLog
+++ b/src/appl/bsd/ChangeLog
@@ -1,7 +1,14 @@
+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>
diff --git a/src/appl/bsd/krlogind.c b/src/appl/bsd/krlogind.c
index 4b5f612aa..a4de216ca 100644
--- a/src/appl/bsd/krlogind.c
+++ b/src/appl/bsd/krlogind.c
@@ -210,6 +210,9 @@ struct winsize {
#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 */
@@ -611,7 +614,7 @@ int syncpipe[2];
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);
}
@@ -699,11 +702,8 @@ int syncpipe[2];
#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
@@ -727,6 +727,7 @@ int syncpipe[2];
** The master blocks here until it reads a byte.
*/
+(void) close(syncpipe[1]);
if (read(syncpipe[0], &c, 1) != 1) {
/*
* Problems read failed ...
@@ -735,7 +736,7 @@ int syncpipe[2];
fatalperror(p,buferror);
}
close(syncpipe[0]);
- close(syncpipe[1]);
+
#if defined(KERBEROS)
if (do_encrypt) {
diff --git a/src/appl/bsd/login.c b/src/appl/bsd/login.c
index dceecc0fb..a1f87b76c 100644
--- a/src/appl/bsd/login.c
+++ b/src/appl/bsd/login.c
@@ -45,6 +45,8 @@ char copyright[] =
* only one of: -r -h -k -K
*/
+#include <libpty.h>
+
#ifdef HAVE_UNISTD_H
#include <unistd.h>
#endif
@@ -782,12 +784,8 @@ bad_login:
{
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");
}