Port-vax archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

re: FD leak in dhcpcd?



Hi

Not subbed to this list so please reply to me directly if needed.
This patch should fix the issue, but it might need a little testing before I commit it incase it logs any erroneous warnings.

Roy

diff --git a/src/privsep.c b/src/privsep.c
index cfe54742..ecc517ec 100644
--- a/src/privsep.c
+++ b/src/privsep.c
@@ -412,7 +412,6 @@ ps_startprocess(struct ps_process *psp,
 		return pid;
 	}

-
 #ifdef PLUGIN_DEV
 	/* If we are not the root process, stop listening to devices. */
 	if (ctx->ps_root != psp)
@@ -541,11 +540,11 @@ ps_stopprocess(struct ps_process *psp)
 			err = -1;
 		}
 #endif
-		psp->psp_fd = -1;
 	}

 	/* Don't wait for the process as it may not respond to the shutdown
-	 * request. We'll reap the process on receipt of SIGCHLD. */
+	 * request. We'll reap the process on receipt of SIGCHLD where we
+	 * also close the fd. */
 	return err;
 }


Home | Main Index | Thread Index | Old Index