diff --git a/.github/workflows/development.yml b/.github/workflows/development.yml index 1c3f4d72..16dc6e15 100644 --- a/.github/workflows/development.yml +++ b/.github/workflows/development.yml @@ -16,7 +16,7 @@ jobs: upload-coverage: [true] include: - go: 1.17 - os: windows-latest + os: windows-2019 upload-coverage: false steps: diff --git a/openapi/openapi.yaml b/openapi/openapi.yaml index 63454257..e55495f6 100644 --- a/openapi/openapi.yaml +++ b/openapi/openapi.yaml @@ -23,7 +23,7 @@ info: SFTPGo also supports virtual folders, a virtual folder can use any of the supported storage backends. So you can have, for example, an S3 user that exposes a GCS bucket (or part of it) on a specified path and an encrypted local filesystem on another one. Virtual folders can be private or shared among multiple users, for shared virtual folders you can define different quota limits for each user. SFTPGo allows to create HTTP/S links to externally share files and folders securely, by setting limits to the number of downloads/uploads, protecting the share with a password, limiting access by source IP address, setting an automatic expiration date. - version: 2.2.2 + version: 2.2.2-dev contact: name: API support url: 'https://github.com/drakkan/sftpgo' diff --git a/version/version.go b/version/version.go index 23f20519..4ffb18d6 100644 --- a/version/version.go +++ b/version/version.go @@ -2,7 +2,7 @@ package version import "strings" -const version = "2.2.2" +const version = "2.2.2-dev" var ( commit = "" diff --git a/vfs/sftpfs.go b/vfs/sftpfs.go index ebf1da84..9c3800a5 100644 --- a/vfs/sftpfs.go +++ b/vfs/sftpfs.go @@ -324,6 +324,9 @@ func (fs *SFTPFs) Rename(source, target string) error { if err := fs.checkConnection(); err != nil { return err } + if _, ok := fs.sftpClient.HasExtension("posix-rename@openssh.com"); ok { + return fs.sftpClient.PosixRename(source, target) + } return fs.sftpClient.Rename(source, target) } @@ -332,6 +335,9 @@ func (fs *SFTPFs) Remove(name string, isDir bool) error { if err := fs.checkConnection(); err != nil { return err } + if isDir { + return fs.sftpClient.RemoveDirectory(name) + } return fs.sftpClient.Remove(name) }