summaryrefslogtreecommitdiffstats
path: root/obsolete-buildroot/sources/openwrt/patches/ppp/close_devfd
blob: 987d964aaeff297a1d1b9d68b7928cc54508c1a0 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
Ensure that the fd returned by the connect method is closed before
running external programs.

http://article.gmane.org/gmane.linux.ppp/1371

diff -ruNp ppp.orig/pppd/main.c ppp/pppd/main.c
--- ppp.orig/pppd/main.c	2004-07-12 12:55:30.000000000 +0200
+++ ppp/pppd/main.c	2004-07-12 12:55:25.000000000 +0200
@@ -1662,6 +1662,8 @@ run_program(prog, args, must_exist, done
     closelog();
     if (the_channel->close)
 	(*the_channel->close)();
+    else
+	close(devfd);
 
     /* Don't pass handles to the PPP device, even by accident. */
     dup2(fd_devnull, 0);