summaryrefslogtreecommitdiffstats
path: root/bin/sh/eval.c
diff options
context:
space:
mode:
authorcracauer <cracauer@FreeBSD.org>1999-11-05 12:06:30 +0000
committercracauer <cracauer@FreeBSD.org>1999-11-05 12:06:30 +0000
commitfffcf922ea6e1fdb420b6b23be008ed43c644bb2 (patch)
tree9b17f045927c696a6041d34ca1dd3f8a3b3be1d0 /bin/sh/eval.c
parent3ebec0e7c82a2cef65af67bba6017cbffb993d96 (diff)
downloadFreeBSD-src-fffcf922ea6e1fdb420b6b23be008ed43c644bb2.zip
FreeBSD-src-fffcf922ea6e1fdb420b6b23be008ed43c644bb2.tar.gz
When a backquote command inside a here-document had a pipe with more
than two processes (got that? :-), the stdin fd of the middle processes that has just been set up was accidetially closed. Don't do this. PR: bin/14527
Diffstat (limited to 'bin/sh/eval.c')
-rw-r--r--bin/sh/eval.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/bin/sh/eval.c b/bin/sh/eval.c
index a3c8fcd..701f018 100644
--- a/bin/sh/eval.c
+++ b/bin/sh/eval.c
@@ -499,7 +499,8 @@ evalpipe(n)
close(prevfd);
}
if (pip[1] >= 0) {
- close(pip[0]);
+ if (!prevfd > 0)
+ close(pip[0]);
if (pip[1] != 1) {
close(1);
copyfd(pip[1], 1);
OpenPOWER on IntegriCloud