osbase/net/sshtakeover: fix upload cancelation
This updates sftp to the latest version, which has various improvements.
The previous method of canceling uploads doesn't work anymore, because
Close tries to take a lock already held by ReadFromWithConcurrency.
Even with the previous version of sftp, this wasn't a correct way to
cancel an upload, because it just sent a message to the server to close
the handle, while continuing the upload in the other goroutine.
There is a work in progress v2 of sftp where Close actually can be used
to cancel an upload: https://github.com/pkg/sftp/issues/603
For now, I think the best way to cancel an upload is to make the reader
return an error.
Change-Id: Id70ea7d35526a2a98295168de26469e28fd127dd
Reviewed-on: https://review.monogon.dev/c/monogon/+/4048
Tested-by: Jenkins CI
Reviewed-by: Tim Windelschmidt <tim@monogon.tech>
diff --git a/go.mod b/go.mod
index 6c3213c..71c1751 100644
--- a/go.mod
+++ b/go.mod
@@ -100,7 +100,7 @@
github.com/opencontainers/runc v1.2.2
github.com/packethost/packngo v0.29.0
github.com/pkg/errors v0.9.1
- github.com/pkg/sftp v1.13.1
+ github.com/pkg/sftp v1.13.8
github.com/prometheus/client_golang v1.21.0
github.com/prometheus/node_exporter v1.9.0
github.com/rivo/uniseg v0.4.7