From babf9292df849e2f57bee9eadad04f8b9d66183f Mon Sep 17 00:00:00 2001 From: "Todd C. Miller" Date: Fri, 16 Oct 2009 00:07:11 +0000 Subject: [PATCH] Push ptem and ldterm for STERAMS-based systems when allocating a pty. --- config.h.in | 3 +++ configure | 3 ++- configure.in | 2 +- script.c | 7 +++++++ 4 files changed, 13 insertions(+), 2 deletions(-) diff --git a/config.h.in b/config.h.in index b40c24765..838ddc8c6 100644 --- a/config.h.in +++ b/config.h.in @@ -491,6 +491,9 @@ /* Define to 1 if you have the header file. */ #undef HAVE_SYS_STAT_H +/* Define to 1 if you have the header file. */ +#undef HAVE_SYS_STROPTS_H + /* Define to 1 if you have the header file. */ #undef HAVE_SYS_TYPES_H diff --git a/configure b/configure index 1afae21e4..634e90ef2 100755 --- a/configure +++ b/configure @@ -13989,7 +13989,8 @@ fi -for ac_header in malloc.h paths.h utime.h netgroup.h sys/sockio.h sys/bsdtypes.h sys/select.h + +for ac_header in malloc.h paths.h utime.h netgroup.h sys/sockio.h sys/bsdtypes.h sys/select.h sys/stropts.h do as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then diff --git a/configure.in b/configure.in index ace66a2b4..414cbb059 100644 --- a/configure.in +++ b/configure.in @@ -1787,7 +1787,7 @@ dnl AC_HEADER_STDC AC_HEADER_DIRENT AC_HEADER_TIME -AC_CHECK_HEADERS(malloc.h paths.h utime.h netgroup.h sys/sockio.h sys/bsdtypes.h sys/select.h) +AC_CHECK_HEADERS(malloc.h paths.h utime.h netgroup.h sys/sockio.h sys/bsdtypes.h sys/select.h sys/stropts.h) dnl ultrix termio/termios are broken if test "$OS" != "ultrix"; then AC_SYS_POSIX_TERMIOS diff --git a/script.c b/script.c index 574a22405..b42984b44 100644 --- a/script.c +++ b/script.c @@ -22,6 +22,9 @@ #include #include #include +#ifdef HAVE_SYS_STROPTS_H +#include +#endif /* HAVE_SYS_STROPTS_H */ #ifdef HAVE_SYS_SELECT_H #include #endif /* HAVE_SYS_SELECT_H */ @@ -884,6 +887,10 @@ get_pty(master, slave) close(*master); return(0); } +#ifdef I_PUSH + ioctl(*slave, I_PUSH, "ptem"); /* pseudo tty emulation module */ + ioctl(*slave, I_PUSH, "ldterm"); /* line discipline module */ +#endif (void) chown(slavename, runas_pw->pw_uid, -1); return(1); } -- 2.40.0