pidgin: 1e183bf3: More leaks of fds to client processes.

datallah at pidgin.im datallah at pidgin.im
Tue Aug 12 19:41:05 EDT 2008


-----------------------------------------------------------------
Revision: 1e183bf34c7e53875e2aded3b5187b1839a2887a
Ancestor: 4afa45644550a37af63bc3c1be176f9b72aedb75
Author: datallah at pidgin.im
Date: 2008-08-12T23:35:02
Branch: im.pidgin.pidgin
URL: http://d.pidgin.im/viewmtn/revision/info/1e183bf34c7e53875e2aded3b5187b1839a2887a

Modified files:
        libpurple/network.c libpurple/protocols/msn/directconn.c
        libpurple/protocols/msn/servconn.c
        libpurple/protocols/msnp9/directconn.c
        libpurple/protocols/msnp9/servconn.c
        libpurple/protocols/qq/qq_network.c

ChangeLog: 

More leaks of fds to client processes.

-------------- next part --------------
============================================================
--- libpurple/network.c	9e14534d108bdb718f02bb05f2eeada3ba75d18e
+++ libpurple/network.c	8d2a2ab174e53917f6c8d2c3beed44667a7edb4f
@@ -351,7 +351,9 @@ purple_network_do_listen(unsigned short 
 	}
 	flags = fcntl(listenfd, F_GETFL);
 	fcntl(listenfd, F_SETFL, flags | O_NONBLOCK);
-
+#ifndef _WIN32
+	fcntl(listenfd, F_SETFD, FD_CLOEXEC);
+#endif
 	actual_port = purple_network_get_port_from_fd(listenfd);
 
 	purple_debug_info("network", "Listening on port: %hu\n", actual_port);
============================================================
--- libpurple/protocols/msn/directconn.c	0bca9a757b01ce4b827f36fbe1564a0b90baad89
+++ libpurple/protocols/msn/directconn.c	909b1cb3f8d778c5ff2e7c7d45eaf39e8fafc50c
@@ -158,6 +158,9 @@ create_listener(int port)
 
 	flags = fcntl(fd, F_GETFL);
 	fcntl(fd, F_SETFL, flags | O_NONBLOCK);
+#ifndef _WIN32
+	fcntl(fd, F_SETFD, FD_CLOEXEC);
+#endif
 
 	return fd;
 }
============================================================
--- libpurple/protocols/msn/servconn.c	aa9fa21a6e2d84dc3b0fd1bdea72217cee6a51cc
+++ libpurple/protocols/msn/servconn.c	323d0972e7f6841756afea42b4d023528ce3e404
@@ -557,6 +557,9 @@ create_listener(int port)
 
 	flags = fcntl(fd, F_GETFL);
 	fcntl(fd, F_SETFL, flags | O_NONBLOCK);
+#ifndef _WIN32
+	fcntl(fd, F_SETFD, FD_CLOEXEC);
+#endif
 
 	return fd;
 }
============================================================
--- libpurple/protocols/msnp9/directconn.c	e65ab6ce18b5e4f7aa0866945767254d343f5358
+++ libpurple/protocols/msnp9/directconn.c	0971eebe47f76c7b74fc738a291a4e3061ef17c0
@@ -159,6 +159,9 @@ create_listener(int port)
 
 	flags = fcntl(fd, F_GETFL);
 	fcntl(fd, F_SETFL, flags | O_NONBLOCK);
+#ifndef _WIN32
+	fcntl(fd, F_SETFD, FD_CLOEXEC);
+#endif
 
 	return fd;
 }
============================================================
--- libpurple/protocols/msnp9/servconn.c	b7dc6c6f54973c18cfac1e7d360b298aeaf946ba
+++ libpurple/protocols/msnp9/servconn.c	517f4c4b60a6f35d4673d64f4b656e594b317b0d
@@ -547,6 +547,9 @@ create_listener(int port)
 
 	flags = fcntl(fd, F_GETFL);
 	fcntl(fd, F_SETFL, flags | O_NONBLOCK);
+#ifndef _WIN32
+	fcntl(fd, F_SETFD, FD_CLOEXEC);
+#endif
 
 	return fd;
 }
============================================================
--- libpurple/protocols/qq/qq_network.c	a7ce5c867d6fa1cc30b1f50a11ba2b7652496b19
+++ libpurple/protocols/qq/qq_network.c	4364dbec36ac54db6ce17b68698173e582d596de
@@ -743,6 +743,9 @@ static void udp_host_resolved(GSList *ho
 	/* we use non-blocking mode to speed up connection */
 	flags = fcntl(fd, F_GETFL);
 	fcntl(fd, F_SETFL, flags | O_NONBLOCK);
+#ifndef _WIN32
+	fcntl(fd, F_SETFD, FD_CLOEXEC);
+#endif
 
 	/* From Unix-socket-FAQ: http://www.faqs.org/faqs/unix-faq/socket/
 	 *


More information about the Commits mailing list