summaryrefslogtreecommitdiffstats
path: root/usr.sbin/ppp/chat.c
diff options
context:
space:
mode:
authorbrian <brian@FreeBSD.org>1998-05-28 23:17:51 +0000
committerbrian <brian@FreeBSD.org>1998-05-28 23:17:51 +0000
commite0d8cc391d650e6b69d5d77af50a002041522151 (patch)
treee3cc3229d89e0fd28c03dea90790a87b1f1bcfe6 /usr.sbin/ppp/chat.c
parentf320a1dcb71e3195a3a9ab924dd4f60db4c3ac53 (diff)
downloadFreeBSD-src-e0d8cc391d650e6b69d5d77af50a002041522151.zip
FreeBSD-src-e0d8cc391d650e6b69d5d77af50a002041522151.tar.gz
o #define the name "tun" in defs.h against the future possibility
of supporting architectures with different device names. o Close /dev/tunX when destroying the bundle. o Don't forget to close the parent end of the pipe in the child process when exec'ing a program from a chat script. o If we close our controlling terminal, ditch the current session with it, allowing getty(8) (or whatever) to regain control. o After transferring our controlling terminal descriptor to another ppp instance, we now fork a new ppp to continue where we left off, transferring ownership of all uucp locks and the /var/run/tunX.pid file. Meanwhile the parent closes all file descriptors, defaults all signals and does a pause() to wait for a HUP after the transferred descriptor is finally closed. We don't run /bin/cat any more (again!). Suggested by: bde TODO: It seems clocal devices need their pause()d session leader to be given a manual HUP, as closing the last open descriptor doesn't do the job.
Diffstat (limited to 'usr.sbin/ppp/chat.c')
-rw-r--r--usr.sbin/ppp/chat.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/usr.sbin/ppp/chat.c b/usr.sbin/ppp/chat.c
index c9e099f..db7356f 100644
--- a/usr.sbin/ppp/chat.c
+++ b/usr.sbin/ppp/chat.c
@@ -23,7 +23,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $Id: chat.c,v 1.45 1998/05/21 21:44:37 brian Exp $
+ * $Id: chat.c,v 1.46 1998/05/23 22:24:32 brian Exp $
*/
#include <sys/types.h>
@@ -727,8 +727,8 @@ ExecStr(struct physical *physical, char *command, char *out, int olen)
return;
}
if ((pid = fork()) == 0) {
+ close(fids[0]);
timer_TermService();
-
fids[1] = fcntl(fids[1], F_DUPFD, 4);
dup2(physical_GetFD(physical), STDIN_FILENO);
dup2(STDIN_FILENO, STDOUT_FILENO);
OpenPOWER on IntegriCloud