summaryrefslogtreecommitdiffstats
path: root/src/util
diff options
context:
space:
mode:
authorSam Hartman <hartmans@mit.edu>1996-06-24 04:16:28 +0000
committerSam Hartman <hartmans@mit.edu>1996-06-24 04:16:28 +0000
commit8ae68ea766f44aaeab6178f993fad74d2ff3fa1a (patch)
treed92748ffc9f2c58181cadd604efde40fea8e7211 /src/util
parente72a4cc2b1985be1867b5bfb448a17967cc3b7f7 (diff)
downloadkrb5-8ae68ea766f44aaeab6178f993fad74d2ff3fa1a.tar.gz
krb5-8ae68ea766f44aaeab6178f993fad74d2ff3fa1a.tar.xz
krb5-8ae68ea766f44aaeab6178f993fad74d2ff3fa1a.zip
Fix bug pointed out by jhawk; we weren't looking for all ptys
on SunOS or NetBSD. Also fix Hpux 10 bug with regard to utmpx. git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@8544 dc483132-0cff-0310-8789-dd5450dbe970
Diffstat (limited to 'src/util')
-rw-r--r--src/util/pty/ChangeLog12
-rw-r--r--src/util/pty/configure.in2
-rw-r--r--src/util/pty/getpty.c8
-rw-r--r--src/util/pty/init_slave.c2
-rw-r--r--src/util/pty/update_wtmp.c6
5 files changed, 21 insertions, 9 deletions
diff --git a/src/util/pty/ChangeLog b/src/util/pty/ChangeLog
index 104d3a6482..87250edf35 100644
--- a/src/util/pty/ChangeLog
+++ b/src/util/pty/ChangeLog
@@ -1,7 +1,19 @@
+
Thu Jun 13 22:14:24 1996 Tom Yu <tlyu@voltage-multiplier.mit.edu>
* configure.in: remove ref to ET_RULES
+
+Thu Jun 13 14:12:16 1996 Sam Hartman <hartmans@mit.edu>
+
+ * update_wtmp.c (ptyint_update_wtmp): Only update wtmpx if we have
+ updwtmpx. This probably should be more general, but I'm not
+ really sure of HP caviats.
+
+ * configure.in : check for updwtmpx
+
+ * getpty.c (pty_getpty): Actually check for 256 ptys on SunOS and
+ other old-style systems.
Tue Apr 16 22:06:36 1996 Ken Raeburn <raeburn@cygnus.com>
* dump-utmp.c: New file. Not automatically used by anything, but
diff --git a/src/util/pty/configure.in b/src/util/pty/configure.in
index 7260b6526c..f645681397 100644
--- a/src/util/pty/configure.in
+++ b/src/util/pty/configure.in
@@ -63,7 +63,7 @@ AC_FUNC_CHECK(openpty,AC_DEFINE(HAVE_OPENPTY))
AC_FUNC_CHECK(logwtmp,AC_DEFINE(HAVE_LOGWTMP))
AC_CHECK_HEADERS(unistd.h stdlib.h string.h utmpx.h utmp.h sys/filio.h sys/sockio.h sys/label.h sys/tty.h ttyent.h lastlog.h sys/select.h sys/ptyvar.h)
AC_CHECK_HEADERS(sys/wait.h)
-AC_CHECK_FUNCS(waitpid)
+AC_CHECK_FUNCS(waitpid updwtmpx)
DECLARE_SYS_ERRLIST
KRB5_SIGTYPE
CHECK_SIGNALS
diff --git a/src/util/pty/getpty.c b/src/util/pty/getpty.c
index 0084225574..1185f2c6f2 100644
--- a/src/util/pty/getpty.c
+++ b/src/util/pty/getpty.c
@@ -25,7 +25,7 @@ long pty_getpty (fd, slave, slavelength)
int slavelength;
int *fd; char *slave;
{
- char c;
+ char *cp;
char *p;
int i,ptynum;
struct stat stb;
@@ -44,7 +44,7 @@ close(slavefd);
#else /*HAVE_OPENPTY*/
#ifdef HAVE__GETPTY
/* This code is included for Irix; as of version 5.3, Irix has /dev/ptmx,
- * but it fails to work properly; even cafter calling unlockpt,
+ * but it fails to work properly; even after calling unlockpt,
* root gets permission denied opening the pty.
* The code to support _getpty should be removed if Irix gets working
* streams ptys in favor of maintaining the least needed code
@@ -113,9 +113,9 @@ close(slavefd);
} else {
- for (c = 'p'; c <= 's'; c++) {
+ for (cp = "pqrstuvwxyzPQRST";*cp; cp++) {
sprintf(slavebuf,"/dev/ptyXX");
- slavebuf[strlen("/dev/pty")] = c;
+ slavebuf[strlen("/dev/pty")] = *cp;
slavebuf[strlen("/dev/ptyp")] = '0';
if (stat(slavebuf, &stb) < 0)
break;
diff --git a/src/util/pty/init_slave.c b/src/util/pty/init_slave.c
index 09efc8d9a7..74564763b2 100644
--- a/src/util/pty/init_slave.c
+++ b/src/util/pty/init_slave.c
@@ -1,5 +1,5 @@
/*
- * pty_open_slave: open slave side of terminal, clearing for use.
+ * pty_init_slave: open slave side of terminal, clearing for use.
*
* Copyright 1995, 1996 by the Massachusetts Institute of Technology.
*
diff --git a/src/util/pty/update_wtmp.c b/src/util/pty/update_wtmp.c
index 8017b1100c..c2f9461ec1 100644
--- a/src/util/pty/update_wtmp.c
+++ b/src/util/pty/update_wtmp.c
@@ -40,7 +40,7 @@ long ptyint_update_wtmp (ent , host, user)
struct utmp ut;
struct stat statb;
int fd;
-#ifdef HAVE_SETUTXENT
+#ifdef HAVE_UPDWTMPX
struct utmpx utx;
getutmpx(ent, &utx);
@@ -54,10 +54,10 @@ long ptyint_update_wtmp (ent , host, user)
#endif
#ifdef HAVE_UPDWTMP
-#ifndef HAVE_SETUTXENT
+#ifndef HAVE_UPDWTMPX
/* This is already performed byupdwtmpx if present.*/
updwtmp(WTMP_FILE, ent);
-#endif /* HAVE_SETUTXENT*/
+#endif /* HAVE_UPDWTMPX*/
#else /* HAVE_UPDWTMP */
if ((fd = open(WTMP_FILE, O_WRONLY|O_APPEND, 0)) >= 0) {