From a870eea56e6587ed50714ee06a5469b45869b168 Mon Sep 17 00:00:00 2001 From: Frank Cusack Date: Mon, 24 Feb 2003 11:26:57 +0000 Subject: [PATCH] device_script(): dont leak the dup'd in&out fds to scripts. --- pppd/main.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/pppd/main.c b/pppd/main.c index 2c2b8a2..2c261e7 100644 --- a/pppd/main.c +++ b/pppd/main.c @@ -40,7 +40,7 @@ * OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ -#define RCSID "$Id: main.c,v 1.120 2002/12/04 23:03:32 paulus Exp $" +#define RCSID "$Id: main.c,v 1.121 2003/02/24 11:26:57 fcusack Exp $" #include #include @@ -1455,8 +1455,12 @@ device_script(program, in, out, dont_wait) } /* dup in and out to fds > 2 */ + fd = in; in = dup(in); + close(fd); + fd = out; out = dup(out); + close(fd); if (log_to_fd >= 0) { errfd = dup(log_to_fd); } else { -- 2.39.2