X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?a=blobdiff_plain;f=slip.c;h=7d060c371881cfeb8c9e28ac78fe0c0476bc2a9c;hb=6a06198cde5b96686304a9814dd7aa241adcb448;hp=17a9099215f9ae8d3cdc236fe9c83a3d8c8cbfaa;hpb=56fd04e41e9985260b8c1660e299cfe051d3f260;p=secnet.git diff --git a/slip.c b/slip.c index 17a9099..7d060c3 100644 --- a/slip.c +++ b/slip.c @@ -262,7 +262,6 @@ static void userv_entry(void *sst) dup2(st->in,0); dup2(st->out,1); - /* XXX close all other fds */ setsid(); /* XXX We really should strdup() all of argv[] but because we'll just exit anyway if execvp() fails it doesn't seem worth bothering. */ @@ -326,12 +325,8 @@ static void userv_invoke_userv(struct userv *st) st->slip.pending_esc=False; /* Invoke userv */ - if (pipe(c_stdin)!=0) { - fatal_perror("userv_invoke_userv: pipe(c_stdin)"); - } - if (pipe(c_stdout)!=0) { - fatal_perror("userv_invoke_userv: pipe(c_stdout)"); - } + pipe_cloexec(c_stdin); + pipe_cloexec(c_stdout); st->txfd=c_stdin[1]; st->rxfd=c_stdout[0];