diff options
context:
space:
mode:
Diffstat (limited to 'source/cache.c')
-rw-r--r--source/cache.c3
1 file changed, 3 insertions, 0 deletions
diff --git a/source/cache.c b/source/cache.c
index 28558b1..8123e5e 100644
--- a/source/cache.c
+++ b/source/cache.c
@@ -314,6 +314,9 @@ static int fill_slot(struct cache_slot *slot)
slot->saved_stdout = dup(STDOUT_FILENO);
if (slot->saved_stdout == -1)
return errno;
+ // A filter program that outlives the request must not hold the client
+ // connection open.
+ fcntl(slot->saved_stdout, F_SETFD, FD_CLOEXEC);
if (dup2(slot->lock_fd, STDOUT_FILENO) == -1)
return errno;