"rsync for cloud storage" - Google Drive, S3, Dropbox, Backblaze B2, One Drive, Swift, Hubic, Wasabi, Google Cloud Storage, Azure Blob, Azure Files, Yandex Files
Go azure-blobazure-blob-storageazure-filesbackblaze-b2cloud-storagedropboxencryptionftpfuse-filesystemgogolanggoogle-cloud-storagegoogle-driveonedriveopenstack-swiftrclones3sftpsyncwebdav
vfs: add EPERM to errors
Nick Craig-Wood8184ec4b7048
diff --git a/cmd/cmount/fs.go b/cmd/cmount/fs.goindex 59d8bcd2b..bcf1c6e11 100644--- a/cmd/cmount/fs.go+++ b/cmd/cmount/fs.go@@ -640,6 +640,8 @@ func translateError(err error) (errc int) {return -fuse.EROFScase vfs.ENOSYS:return -fuse.ENOSYS+ case vfs.EPERM:+ return -fuse.EPERM}fs.Errorf(nil, "IO error: %v", err)return -fuse.EIOdiff --git a/cmd/mount/fs.go b/cmd/mount/fs.goindex 99bb55b5a..157e9f09a 100644--- a/cmd/mount/fs.go+++ b/cmd/mount/fs.go@@ -85,7 +85,9 @@ func translateError(err error) error {case vfs.EROFS:return fuse.Errno(syscall.EROFS)case vfs.ENOSYS:- return fuse.Errno(syscall.ENOSYS)+ return fuse.ENOSYS+ case vfs.EPERM:+ return fuse.EPERM}return err}diff --git a/vfs/dir.go b/vfs/dir.goindex b2f71eb77..6072821f4 100644--- a/vfs/dir.go+++ b/vfs/dir.go@@ -311,7 +311,7 @@ func (d *Dir) Open(flags int) (fd Handle, err error) {rdwrMode := flags & (os.O_RDONLY | os.O_WRONLY | os.O_RDWR)if rdwrMode != os.O_RDONLY {fs.Errorf(d, "Can only open directories read only")- return nil, os.ErrPermission+ return nil, EPERM}return newDirHandle(d), nil}diff --git a/vfs/errors.go b/vfs/errors.goindex 3d0813ebe..28e768682 100644--- a/vfs/errors.go+++ b/vfs/errors.go@@ -26,6 +26,7 @@ const (var (ENOENT = os.ErrNotExistEEXIST = os.ErrExist+ EPERM = os.ErrPermission)var errorNames = []string{diff --git a/vfs/file.go b/vfs/file.goindex d7043428e..2e26b3b6e 100644--- a/vfs/file.go+++ b/vfs/file.go@@ -298,10 +298,10 @@ func (f *File) Open(flags int) (fd Handle, err error) {read = falsecase rdwrMode == os.O_RDWR:fs.Errorf(f, "Can't open for Read and Write")- return nil, os.ErrPermission+ return nil, EPERMdefault:fs.Errorf(f, "Can't figure out how to open with flags: 0x%X", flags)- return nil, os.ErrPermission+ return nil, EPERM}if read {fd, err = f.OpenRead()