Commit 6b933111 authored by Poul-Henning Kamp's avatar Poul-Henning Kamp

Dup(2) stderr before calling VCLS on -I argument.

Fixes: #2782
parent e476f9f6
......@@ -278,6 +278,8 @@ mgt_launch_child(struct cli *cli)
/* Open pipe for mgt->child CLI */
AZ(pipe(cp));
heritage.cli_in = cp[0];
assert(cp[0] > STDERR_FILENO); // See #2782
assert(cp[1] > STDERR_FILENO);
MCH_Fd_Inherit(heritage.cli_in, "cli_in");
child_cli_out = cp[1];
......
......@@ -861,7 +861,8 @@ main(int argc, char * const *argv)
if (I_fd >= 0) {
fprintf(stderr, "BEGIN of -I file processing\n");
mgt_cli_setup(I_fd, 2, 1, "-I file", mgt_I_close, stderr);
/* We must dup stderr, because VCLS closes the output fd */
mgt_cli_setup(I_fd, dup(2), 1, "-I file", mgt_I_close, stderr);
while (I_fd >= 0) {
o = VEV_Once(mgt_evb);
if (o != 1)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment