--- xqf/src/utils.c	(revision 812)
+++ xqf/src/utils.c	(revision 813)
@@ -950,6 +950,8 @@
 	//    dup2 (pipefds[1], 2);
 	close (pipefds[1]);
 
+	close_fds(-1);
+
 	debug(3,"child about to exec %s", argv[0]);
 
 	execvp (argv[0], argv);
@@ -1194,3 +1196,13 @@
 }
 #endif	// ! RCON_STANDALONE
 
+void close_fds(int exclude)
+{
+  unsigned i;
+  int maxfd = sysconf(_SC_OPEN_MAX);
+  for (i = 3; i < maxfd; ++i)
+  {
+    if(i == exclude) continue;
+    close(i);
+  }
+}
--- xqf/src/utils.h	(revision 812)
+++ xqf/src/utils.h	(revision 813)
@@ -173,4 +173,6 @@
  */
 char* load_file_mem(const char* name, size_t* size);
 
+void close_fds(int exclude);
+
 #endif /* __UTILS_H__ */
--- xqf/src/launch.c	(revision 812)
+++ xqf/src/launch.c	(revision 813)
@@ -270,8 +270,9 @@
       client_attach (pid, pipefds[0], s);
     }
     else {	/* child */
-      close (pipefds[0]);
 
+      close_fds(pipefds[1]);
+
       if (dir && dir[0] != '\0') {
 	if (chdir (dir) != 0) {
 	  g_snprintf (msg, CLIENT_ERROR_BUFFER, "%schdir failed: %s", 
