mirror of
https://github.com/rclone/rclone.git
synced 2025-11-29 05:47:23 +02:00
Before this fix using --sftp-ssh with the sftp backend could leave zombie processes. This patch fixes the problem that sshClientExternal.session was never assigned, so Wait() always returned nil without waiting for the SSH process to exit. This caused zombie processes because the process was never reaped. It also ensures that Wait() is only called once on each process. I gave this issue to Copilot to fix as an experiment. It went off in the wrong direction to start with and fixed something which wasn't the problem but still needed fixing. With a bit of a nudge it fixed the correct problem too. Co-authored-by: Nick Craig-Wood <nick@craig-wood.com>