Skip to content

"rsync for cloud storage" - Google Drive, S3, Dropbox, Backblaze B2, One Drive, Swift, Hubic, Wasabi, Google Cloud Storage, Azure Blob, Azure Files, Yandex Files

serve sftp: fix checksum detection - Fixes #6351

Nick Craig-Wood98fd00a655ca
diff --git a/cmd/serve/sftp/connection.go b/cmd/serve/sftp/connection.go
index d8be2bce5..d9eaf855d 100644
--- a/cmd/serve/sftp/connection.go
+++ b/cmd/serve/sftp/connection.go
@@ -101,6 +101,9 @@ func (c *conn) execCommand(ctx context.Context, out io.Writer, command string) (
if binary == "sha1sum" {
ht = hash.SHA1
}
+ if !c.vfs.Fs().Hashes().Contains(ht) {
+ return fmt.Errorf("%v hash not supported", ht)
+ }
var hashSum string
if args == "" {
// empty hash for no input