2
2
mirror of https://github.com/octoleo/restic.git synced 2024-11-26 06:46:34 +00:00
restic/internal/backend/rclone
Michael Eischer 8554332894 rclone: Close rclone side of stdio_conn pipes
restic did not notice when the rclone subprocess exited unexpectedly.

restic manually created pipes for stdin and stdout and used these for the
connection to the rclone subprocess. The process creating a pipe gets
file descriptors for the sender and receiver side of a pipe and passes
them on to the subprocess. The expected behavior would be that reads or
writes in the parent process fail / return once the child process dies
as a pipe would now just have a reader or writer but not both.

However, this never happened as restic kept the reader and writer
file descriptors of the pipes. `cmd.StdinPipe` and `cmd.StdoutPipe`
close the subprocess side of pipes once the child process was started
and close the parent process side of pipes once wait has finished. We
can't use these functions as we need access to the raw `os.File` so just
replicate that behavior.
2020-07-26 00:29:25 +02:00
..
backend_test.go rclone: Respect bandwith limits 2018-05-22 20:48:17 +02:00
backend.go rclone: Close rclone side of stdio_conn pipes 2020-07-26 00:29:25 +02:00
config_test.go rclone: Rework backend option parsing 2019-03-02 10:36:42 +01:00
config.go rclone: Rework backend option parsing 2019-03-02 10:36:42 +01:00
stdio_conn.go Remove all workarounds for Go < 1.11 2020-02-26 20:35:13 +01:00