Skip to content

Commit

Permalink
Translate EACCES to PERMISSION_DENIED.
Browse files Browse the repository at this point in the history
This is returned by (POSIX) open(2) if there is a permission issue,
e.g. opening a read-only file for writing.
  • Loading branch information
tommie committed Oct 30, 2021
1 parent 858320b commit 20a9511
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion stat_posix.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
//go:build !plan9
// +build !plan9

package sftp
Expand All @@ -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
}

Expand Down

0 comments on commit 20a9511

Please sign in to comment.