Blob Blame History Raw
diff -up iptables-1.4.0/xtables.c.cloexec iptables-1.4.0/xtables.c
--- iptables-1.4.0/xtables.c.cloexec	2008-02-11 13:50:20.000000000 +0100
+++ iptables-1.4.0/xtables.c	2008-02-11 13:51:03.000000000 +0100
@@ -428,6 +428,12 @@ static int compatible_revision(const cha
 		exit(1);
 	}
 
+	if (fcntl(sockfd, F_SETFD, FD_CLOEXEC) == -1) {
+		fprintf(stderr, "Could not set close on exec: %s\n",
+			strerror(errno));
+		exit(1);
+	}
+
 	load_xtables_ko(modprobe, 1);
 
 	strcpy(rev.name, name);