From 347ed3cc833b7d119f51f82c78aafe9e420073af Mon Sep 17 00:00:00 2001 From: Sam Hartman Date: Sat, 13 Jan 1996 05:45:13 +0000 Subject: [PATCH] Work around apparent Solaris kernel bug. If you open the pty and close it, you get a sigHUP on the master git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@7311 dc483132-0cff-0310-8789-dd5450dbe970 --- src/util/pty/ChangeLog | 24 +++++++++++++++++------- src/util/pty/open_slave.c | 33 ++++++++++----------------------- 2 files changed, 27 insertions(+), 30 deletions(-) diff --git a/src/util/pty/ChangeLog b/src/util/pty/ChangeLog index ad92d0aca..fca11b79f 100644 --- a/src/util/pty/ChangeLog +++ b/src/util/pty/ChangeLog @@ -1,9 +1,21 @@ +Fri Jan 12 16:33:37 1996 Sam Hartman + + * open_slave.c (pty_open_slave): Don't use fchmod or fchown; they + don't buy much security unless /dev is world-writable and may + prevent Solaris lossage. + +Thu Dec 21 00:12:58 1995 Sam Hartman + + * open_slave.c (pty_open_slave): Open with no delay. + + Wed Jan 10 22:20:04 1996 Theodore Y. Ts'o * open_slave.c (pty_open_slave): Added hack by Doug Engbert to get util/pty to work under Solaris. We should double check to make sure this is a correct fix. + Sun Nov 12 12:44:33 1995 Sam Hartman * open_ctty.c (pty_open_ctty): Remove redundant Ultrix calls to setpgrp() @@ -34,16 +46,14 @@ Mon Oct 16 17:41:45 1995 Sam Hartman Sat Oct 14 20:49:40 1995 Sam Hartman Fri Aug 11 17:49:36 1995 Samuel D Hartman (hartmans@vorlon) ->>>>>>> 1.24 -<<<<<<< ChangeLog + Fri Sep 29 14:18:03 1995 Theodore Y. Ts'o -======= * update_wtmp.c (ptyint_update_wtmp): If EMPTY not defined as a utmp type, use DEAD_PROCESS. ->>>>>>> 1.24 -<<<<<<< ChangeLog + + * configure.in: * Makefile.in: Use the SubdirLibraryRule defined in aclocal.m4 to create the DONE file (and to properly clean it up). @@ -68,8 +78,8 @@ Tue Aug 15 21:42:16 1995 * update_wtmp.c (ptyint_update_wtmp): If EMPTY is not defined, then set ut.ut_type to 0 instead. -======= ->>>>>>> 1.24 + + Fri Aug 11 15:49:30 1995 Sam Hartman * Makefile.in (CFILES): Rename initialize_slave.c to init_slave.c diff --git a/src/util/pty/open_slave.c b/src/util/pty/open_slave.c index 2f8d3bf17..b34f5c4bb 100644 --- a/src/util/pty/open_slave.c +++ b/src/util/pty/open_slave.c @@ -27,7 +27,7 @@ long pty_open_slave ( slave, fd) int *fd; { int vfd; -long retval; + long retval; #ifdef POSIX_SIGNALS struct sigaction sa; /* Initialize "sa" structure. */ @@ -36,10 +36,6 @@ long retval; #endif - /* XXX added by Doug Engbert to get things to work under Solaris. */ -#ifdef HAVE_SETSID - (void) setsid(); -#endif /* First, chmod and chown the slave*/ /* @@ -53,33 +49,22 @@ long retval; #ifdef VHANG_FIRST if (( retval = pty_open_ctty ( slave, &vfd )) != 0 ) return retval; -#else /*VHANG_FIRST*/ - if ( (vfd = open(slave, O_RDWR)) < 0 ) - return errno; -#endif - if (vfd < 0) return PTY_OPEN_SLAVE_OPENFAIL; -#ifndef HAVE_FCHMOD - if (chmod(line, 0)) +#endif + + + if (chmod(slave, 0)) return PTY_OPEN_SLAVE_CHMODFAIL; -#else - if (fchmod(vfd, 0)) -return PTY_OPEN_SLAVE_CHMODFAIL; -#endif /*HAVE_FCHMOD*/ -#ifdef HAVE_FCHOWN - if ( fchown(vfd, 0, 0 ) == -1 ) -#else if ( chown(slave, 0, 0 ) == -1 ) -#endif /* HAVE_FCHOWN*/ - return PTY_OPEN_SLAVE_CHOWNFAIL; + return PTY_OPEN_SLAVE_CHOWNFAIL; #ifdef VHANG_FIRST ptyint_vhangup(); -#endif - (void) close(vfd); +#endif + if ( (retval = ptyint_void_association()) != 0) return retval; @@ -95,3 +80,5 @@ return PTY_OPEN_SLAVE_CHMODFAIL; } return pty_initialize_slave (*fd); } + + -- 2.26.2