From 20a9511799433c72ce3f092a3bf38a08a702e05c Mon Sep 17 00:00:00 2001 From: Tommie Gannert Date: Wed, 19 Jun 2019 20:48:39 +0200 Subject: [PATCH] Translate EACCES to PERMISSION_DENIED. This is returned by (POSIX) open(2) if there is a permission issue, e.g. opening a read-only file for writing. --- stat_posix.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/stat_posix.go b/stat_posix.go index 92f76e2f..5b870e23 100644 --- a/stat_posix.go +++ b/stat_posix.go @@ -1,3 +1,4 @@ +//go:build !plan9 // +build !plan9 package sftp @@ -23,7 +24,7 @@ func translateErrno(errno syscall.Errno) uint32 { return sshFxOk case syscall.ENOENT: return sshFxNoSuchFile - case syscall.EPERM: + case syscall.EACCES, syscall.EPERM: return sshFxPermissionDenied }