[OpenWrt-Devel] [PATCH] procd sysupgrade: close input side of pipe before reading

Dustin Lundquist D.Lundquist at temperednetworks.com
Thu Oct 3 12:24:22 EDT 2019


When /usr/libexec/validate_firmware_image is not present on the system
procd will hang indefinitely on the read() since the input side of the
pipe is still open.

Signed-off-by: Dustin Lundquist <d.lundquist at temperednetworks.com>
---
system.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/system.c b/system.c
index 751a016..a7ada13 100644
--- a/system.c
+++ b/system.c
@@ -425,6 +425,7 @@ static int validate_firmware_image_call(const char *file)
	}

	/* Parent process */
+	close(fds[1]);

	tok = json_tokener_new();
	if (!tok) {
@@ -447,7 +448,6 @@ static int validate_firmware_image_call(const char *file)
	}

	close(fds[0]);
-	close(fds[1]);

	err = -ENOENT;
	if (jsobj) {
-- 
2.11.0


_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/mailman/listinfo/openwrt-devel



More information about the openwrt-devel mailing list