From: Frank Cusack Date: Mon, 24 Feb 2003 11:26:57 +0000 (+0000) Subject: device_script(): dont leak the dup'd in&out fds to scripts. X-Git-Tag: ppp-2.4.7~329 X-Git-Url: http://git.ozlabs.org/?a=commitdiff_plain;h=a870eea56e6587ed50714ee06a5469b45869b168;p=ppp.git device_script(): dont leak the dup'd in&out fds to scripts. --- 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 {