summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorSam Hartman <hartmans@mit.edu>1996-03-24 20:31:55 +0000
committerSam Hartman <hartmans@mit.edu>1996-03-24 20:31:55 +0000
commitbd33f7e0f21f90956c686d1a0d7d4cee1afad7bd (patch)
tree1088b0d2c65395a924804164905cb35534b53cf6 /src
parent01519a9849fcb64989e80e5bdf498d6e41b97dac (diff)
Implement _getpty handling for the SGI
git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@7707 dc483132-0cff-0310-8789-dd5450dbe970
Diffstat (limited to 'src')
-rw-r--r--src/util/pty/ChangeLog12
-rw-r--r--src/util/pty/configure.in20
-rw-r--r--src/util/pty/getpty.c33
-rw-r--r--src/util/pty/pty-int.h1
4 files changed, 42 insertions, 24 deletions
diff --git a/src/util/pty/ChangeLog b/src/util/pty/ChangeLog
index 78e8c8f6d..fb88e790b 100644
--- a/src/util/pty/ChangeLog
+++ b/src/util/pty/ChangeLog
@@ -1,3 +1,15 @@
+Sat Mar 23 15:24:38 1996 Sam Hartman <hartmans@tertius.mit.edu>
+
+ * configure.in : Remove shadow passwords check because nothing in
+ libpty cares about the result; remove use of libkrb5, libkrb4,
+ libkadm; Check for _getpty
+
+ * getpty.c (pty_getpty): Support _getpty for Irix; Irix has
+ /dev/ptmx, but it doesn't work correctly at all. Also, Irix,
+ tends to create device nodes on the fly.
+
+ * pty-int.h: No need to include sys/socket.h
+
Sat Feb 24 21:34:58 1996 Theodore Y. Ts'o <tytso@dcl>
* vhangup.c (ptyint_vhangup): Don't do call vhangup() if system
diff --git a/src/util/pty/configure.in b/src/util/pty/configure.in
index 32fae2552..3d5a649aa 100644
--- a/src/util/pty/configure.in
+++ b/src/util/pty/configure.in
@@ -6,8 +6,8 @@ LinkFileDir([$](TOPLIBD)/libpty.a,libpty.a,../util/pty)
AC_PROG_INSTALL
AC_PROG_ARCHIVE
AC_PROG_RANLIB
-AC_CHECK_FUNCS(fchmod fchown revoke vhangup killpg)
-dnl dbm libs for use of an_to_ln
+AC_CHECK_FUNCS(fchmod fchown revoke vhangup killpg _getpty)
+dnl
LOGINLIBS=
dnl
dnl Make our operating system-specific security checks and definitions for
@@ -125,25 +125,9 @@ AC_DEFINE(SETPGRP_TWOARG)
fi
dnl
dnl
-AC_MSG_CHECKING([shadow password support])
-AC_CACHE_VAL(krb5_cv_shadow_pwd,
-[AC_TRY_LINK(
-[#include <sys/types.h>
-#include <pwd.h>
-#include <shadow.h>],
-[struct spwd *sp = getspnam("root")],
-krb5_cv_shadow_pwd=yes, krb5_cv_shadow_pwd=no)])
-AC_MSG_RESULT($krb5_cv_shadow_pwd)
-if test $krb5_cv_shadow_pwd = yes; then
-AC_DEFINE(HAVE_SHADOW)
-fi
-dnl
dnl
ADD_DEF(-DKERBEROS)
AC_CONST
-USE_KADM_LIBRARY
-USE_KRB4_LIBRARY
-KRB5_LIBRARIES
V5_USE_SHARED_LIB
SubdirLibraryRule([$(LIBOBJS)])
V5_AC_OUTPUT_MAKEFILE
diff --git a/src/util/pty/getpty.c b/src/util/pty/getpty.c
index 867cbdf7f..dd86aa6cf 100644
--- a/src/util/pty/getpty.c
+++ b/src/util/pty/getpty.c
@@ -1,7 +1,7 @@
/*
* pty_getpty: open a PTY master.
*
- * Copyright 1995 by the Massachusetts Institute of Technology.
+ * Copyright 1995, 1996 by the Massachusetts Institute of Technology.
*
*
* Permission to use, copy, modify, and distribute this software and
@@ -30,7 +30,9 @@ long pty_getpty (fd, slave, slavelength)
int i,ptynum;
struct stat stb;
char slavebuf[1024];
-
+#ifdef HAVE__GETPTY
+char *slaveret; /*Temporary to hold pointer to slave*/
+#endif /*HAVE__GETPTY*/
#ifdef HAVE_OPENPTY
int slavefd;
@@ -39,9 +41,29 @@ char slavebuf[1024];
(struct winsize *) 0)) return 1;
close(slavefd);
return 0;
-#else
-
- *fd = open("/dev/ptmx", O_RDWR|O_NDELAY); /* Solaris, IRIX */
+#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,
+ * 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
+ * paths.
+ */
+ if ((slaveret = _getpty(fd, O_RDWR|O_NDELAY, 0600, 0)) == 0) {
+ *fd = -1;
+ return PTY_GETPTY_NOPTY;
+ }
+ if (strlen(slaveret) > slavelength) {
+ close(*fd);
+ *fd = -1;
+ return PTY_GETPTY_SLAVE_TOOLONG;
+ }
+ else strcpy(slave, slaveret);
+ return 0;
+#else /*HAVE__GETPTY*/
+
+ *fd = open("/dev/ptmx", O_RDWR|O_NDELAY); /* Solaris*/
if (*fd < 0) *fd = open("/dev/ptc", O_RDWR|O_NDELAY); /* AIX */
if (*fd < 0) *fd = open("/dev/pty", O_RDWR|O_NDELAY); /* sysvimp */
@@ -113,6 +135,7 @@ return PTY_GETPTY_SLAVE_TOOLONG;
}
return PTY_GETPTY_NOPTY;
}
+#endif /*HAVE__GETPTY*/
#endif /* HAVE_OPENPTY */
}
diff --git a/src/util/pty/pty-int.h b/src/util/pty/pty-int.h
index 489072654..4b6d1570d 100644
--- a/src/util/pty/pty-int.h
+++ b/src/util/pty/pty-int.h
@@ -22,7 +22,6 @@
#include <stdio.h>
#include <sys/stat.h>
-#include <sys/socket.h>
#include <sys/ioctl.h>
#include <sys/wait.h>
#include <sys/file.h>