From: Wayne Davison Date: Sun, 21 Jun 2020 18:13:01 +0000 (-0700) Subject: Close STDIN for early exec script. X-Git-Tag: v3.2.1pre1~10 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=2e1b46db3912cc3542a6ef0d7507c60ab282deaf;p=thirdparty%2Frsync.git Close STDIN for early exec script. --- diff --git a/NEWS.md b/NEWS.md index 95016fe4..8b3e2ed0 100644 --- a/NEWS.md +++ b/NEWS.md @@ -19,6 +19,8 @@ Protocol: 31 (unchanged) - Fix an issue with the md2man code when building in an external dir. + - Make sure "early exec" gets no stdin. + ### ENHANCEMENTS: - Added "atimes" to the capabilities list that `--version` outputs. diff --git a/clientserver.c b/clientserver.c index b9325186..819e9f24 100644 --- a/clientserver.c +++ b/clientserver.c @@ -434,11 +434,12 @@ static pid_t start_pre_exec(const char *cmd, int *arg_fd_ptr, int *error_fd_ptr) } if (error_fd_ptr) { - close(STDIN_FILENO); dup2(error_fds[1], STDOUT_FILENO); close(error_fds[1]); } + close(STDIN_FILENO); + status = shell_exec(cmd); if (!WIFEXITED(status))