From db39adeb3e135e5535b02e6abc5ecba29a26d2d9 Mon Sep 17 00:00:00 2001 From: Nick Craig-Wood Date: Mon, 2 Dec 2019 17:28:50 +0000 Subject: [PATCH] sftp: open files for update write only to fix AWS SFTP interop - fixes #3776 --- backend/sftp/sftp.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/backend/sftp/sftp.go b/backend/sftp/sftp.go index 9d0a1bcbd..ec98c1719 100644 --- a/backend/sftp/sftp.go +++ b/backend/sftp/sftp.go @@ -1215,7 +1215,7 @@ func (o *Object) Update(ctx context.Context, in io.Reader, src fs.ObjectInfo, op if err != nil { return errors.Wrap(err, "Update") } - file, err := c.sftpClient.Create(o.path()) + file, err := c.sftpClient.OpenFile(o.path(), os.O_WRONLY|os.O_CREATE|os.O_TRUNC) o.fs.putSftpConnection(&c, err) if err != nil { return errors.Wrap(err, "Update Create failed")