]> granicus.if.org Git - sudo/commitdiff
Push ptem and ldterm for STERAMS-based systems when allocating a pty.
authorTodd C. Miller <Todd.Miller@courtesan.com>
Fri, 16 Oct 2009 00:07:11 +0000 (00:07 +0000)
committerTodd C. Miller <Todd.Miller@courtesan.com>
Fri, 16 Oct 2009 00:07:11 +0000 (00:07 +0000)
config.h.in
configure
configure.in
script.c

index b40c24765fc8d5a7dc6ee8f3489e90362cfe4ded..838ddc8c6ed7bcc0b965547e630f4026fd8b2bf6 100644 (file)
 /* Define to 1 if you have the <sys/stat.h> header file. */
 #undef HAVE_SYS_STAT_H
 
+/* Define to 1 if you have the <sys/stropts.h> header file. */
+#undef HAVE_SYS_STROPTS_H
+
 /* Define to 1 if you have the <sys/types.h> header file. */
 #undef HAVE_SYS_TYPES_H
 
index 1afae21e4bdd698adcb8dab33a7f0e4247b56bcf..634e90ef2a1dfa1761142022d9d389361bca8661 100755 (executable)
--- 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
index ace66a2b43cc9750e816468ae71f49af450c5979..414cbb059b36876fe3a174b61290eb8a6a9c4677 100644 (file)
@@ -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
index 574a224055a6eb75262c27ff79bd8c39c968b985..b42984b44516f21ce6590bd5bd37424e1760d051 100644 (file)
--- a/script.c
+++ b/script.c
@@ -22,6 +22,9 @@
 #include <sys/time.h>
 #include <sys/wait.h>
 #include <sys/ioctl.h>
+#ifdef HAVE_SYS_STROPTS_H
+#include <sys/stropts.h>
+#endif /* HAVE_SYS_STROPTS_H */
 #ifdef HAVE_SYS_SELECT_H
 #include <sys/select.h>
 #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);
 }