Commit
635da189dccef6516d490c228407b9987986c578 fixed a problem where
a stray file descriptor leaked into a subshell.
Explicitly close the file descriptor at the outermost possible point
rather than relying on fakessh() to do it.
Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
fakessh ()
{
- CTDB_SOCKET="$1" sh -c "$2" 3>/dev/null
+ CTDB_SOCKET="$1" sh -c "$2"
}
stdout_filter ()
{
exec 3>&1
{
- $ssh_cmd "$n" "$command" |
+ $ssh_cmd "$n" "$command" 3>&- |
stdout_filter >&3
} 2>&1 | stderr_filter
} &
{
exec 3>&1
{
- $ssh_cmd "$n" "$command" |
+ $ssh_cmd "$n" "$command" 3>&- |
stdout_filter >&3
} 2>&1 | stderr_filter
} || retcode=$?