]> git.ozlabs.org Git - ppp.git/commitdiff
Don't leak ppp_fd to scripts. Bug reported by Alexander Bergolth.
authorFrank Cusack <fcusack@fcusack.com>
Mon, 24 Feb 2003 12:07:26 +0000 (12:07 +0000)
committerFrank Cusack <fcusack@fcusack.com>
Mon, 24 Feb 2003 12:07:26 +0000 (12:07 +0000)
pppd/sys-linux.c

index 4a27cd51e006ba7891b6ddb7cd13b93d3db44901..099db535357fb8211928fd545143a4e2d68e1476 100644 (file)
@@ -485,6 +485,7 @@ int generic_establish_ppp (int fd)
            error("Couldn't reopen /dev/ppp: %m");
            goto err;
        }
+       (void) fcntl(fd, F_SETFD, FD_CLOEXEC);
        if (ioctl(fd, PPPIOCATTCHAN, &chindex) < 0) {
            error("Couldn't attach to channel %d: %m", chindex);
            goto err_close;