Commit 4a55b231883da25896fe302c04b11284bad0e125

Stefan Sperling 2021-12-09T16:10:25

ignore the return value of closefrom(2); patch by Anna a.k.a. CyberTailor millert@ suggests that this check is not needed, and that ideally we should be using close-on-exec instead. I will look into this, but in the meantime this change will help -portable: https://bugs.gentoo.org/828003

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
diff --git a/lib/privsep.c b/lib/privsep.c
index 990151b..6cf7e9a 100644
--- a/lib/privsep.c
+++ b/lib/privsep.c
@@ -2767,10 +2767,8 @@ got_privsep_exec_child(int imsg_fds[2], const char *path, const char *repo_path)
 		fprintf(stderr, "%s: %s\n", getprogname(), strerror(errno));
 		_exit(1);
 	}
-	if (closefrom(GOT_IMSG_FD_CHILD + 1) == -1) {
-		fprintf(stderr, "%s: %s\n", getprogname(), strerror(errno));
-		_exit(1);
-	}
+
+	closefrom(GOT_IMSG_FD_CHILD + 1);
 
 	if (execl(path, path, repo_path, (char *)NULL) == -1) {
 		fprintf(stderr, "%s: %s: %s\n", getprogname(), path,