1
0
Fork 0
mirror of git://git.code.sf.net/p/zsh/code synced 2025-11-11 21:50:57 +01:00

32171: close pipe descriptor in parent when left side is a shell construct to

prevent deadlock

Also clean up ChangeLog entry that attributed 32119 to 32114
This commit is contained in:
Barton E. Schaefer 2013-12-20 23:03:46 -08:00
parent 58614f1669
commit 9887fc3d7b
2 changed files with 15 additions and 3 deletions

View file

@ -1,3 +1,9 @@
2013-12-20 Barton E. Schaefer <schaefer@zsh.org>
* 32171: Src/exec.c: fix leaked pipe descriptor that could
deadlock a pipeline from a complex shell construct or function
into an external command
2013-12-20 Peter Stephenson <p.w.stephenson@ntlworld.com>
* unposted: Config/version.mk, Etc/FAQ.yo, README: release 5.0.4.
@ -31,10 +37,12 @@
* unposted: NEWS: add ZLE_PROMPT_INDENT.
* 32119: Src/Zle/zle_tricky.c: left square bracket completed in
command position is not part of a subscript expression
* Patrick Oscity + pws: 32114: Doc/Zsh/params.yo,
Src/Zle/zle_refresh.c, Src/Zle/zle_tricky.c: ZLE_RPROMPT_INDENT
allows you to make the right prompt flush if your terminal
supports it.
Src/Zle/zle_refresh.c: ZLE_RPROMPT_INDENT allows you to make the
right prompt flush if your terminal supports it.
2013-12-16 Barton E. Schaefer <schaefer@zsh.org>

View file

@ -1691,6 +1691,7 @@ execpline2(Estate state, wordcode pcode,
execcmd(state, input, output, how, last1 ? 1 : 2);
else {
int old_list_pipe = list_pipe;
int subsh_close = -1;
Wordcode next = state->pc + (*state->pc), pc;
wordcode code;
@ -1738,6 +1739,7 @@ execpline2(Estate state, wordcode pcode,
} else {
/* otherwise just do the pipeline normally. */
addfilelist(NULL, pipes[0]);
subsh_close = pipes[0];
execcmd(state, input, pipes[1], how, 0);
}
zclose(pipes[1]);
@ -1750,6 +1752,8 @@ execpline2(Estate state, wordcode pcode,
execpline2(state, *state->pc++, how, pipes[0], output, last1);
list_pipe = old_list_pipe;
cmdpop();
if (subsh_close != pipes[0])
zclose(pipes[0]);
}
}