Radish alpha
H
rad:z3QDZAW2FAfuLvihrhiyDC9fAD8G9
HardenedBSD Package Manager
Radicle
Git
scripts: do not try to close both ends of the pipe before running the scripts
Baptiste Daroussin committed 6 years ago
commit ffd3c8272e3db35c0fe3797c74cb07f94bb20a5f
parent 396fe6d
1 file changed +2 -1
modified libpkg/scripts.c
@@ -163,7 +163,8 @@ pkg_script_run(struct pkg * const pkg, pkg_script type, bool upgrade)
			 * close all unuseful fd up to there
			 */
			for (int i = 5; i <= cur_pipe[1]; i++) {
-
				posix_spawn_file_actions_addclose(&action, i);
+
				if (i != cur_pipe[0])
+
					posix_spawn_file_actions_addclose(&action, i);
			}
			if (utstring_len(script_cmd) > argmax) {
				if (pipe(stdin_pipe) < 0) {