home: hub: mkinitfs

Download patch

ref: f4fd3b71100121ae065ccaa5b58bee684c87718e
parent: 4a17e1047dc06977dd63efa984b0692ff54329ea
author: Natanael Copa <ncopa@alpinelinux.org>
date: Tue Jan 10 09:42:31 CST 2017

nlplug-findfs: make sure we dont leak fd when execute lvm

--- a/nlplug-findfs.c
+++ b/nlplug-findfs.c
@@ -732,7 +732,7 @@
 	if (!recurse_push(opts, &oldlen, "uevent"))
 		return;
 
-	fd = open(opts->path, O_WRONLY);
+	fd = open(opts->path, O_WRONLY | O_CLOEXEC);
 	if (fd >= 0) {
 		write(fd, "add", 3);
 		close(fd);
@@ -799,7 +799,7 @@
 {
 	int fd;
 	if (outfile == 0) return;
-	fd = open(outfile, O_WRONLY | O_CREAT | O_APPEND);
+	fd = open(outfile, O_WRONLY | O_CREAT | O_APPEND | O_CLOEXEC);
 	if (fd == -1)
 		err(1, "%s", outfile);
 	write(fd, data, strlen(data));