From 5493612a11c0a4eedc7aaed53649d52bbdbbedd3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rn=20Friedrich=20Dreyer?= Date: Fri, 18 Sep 2020 11:49:01 +0200 Subject: [PATCH] Handle eos EPERM as permission denied MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Jörn Friedrich Dreyer --- changelog/unreleased/handle-eos-eperm.md | 5 +++++ pkg/eosclient/eosclient.go | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) create mode 100644 changelog/unreleased/handle-eos-eperm.md diff --git a/changelog/unreleased/handle-eos-eperm.md b/changelog/unreleased/handle-eos-eperm.md new file mode 100644 index 0000000000..96c4c90d04 --- /dev/null +++ b/changelog/unreleased/handle-eos-eperm.md @@ -0,0 +1,5 @@ +Bugfix: Handle eos EPERM as permission denied + +We now treat EPERM errors, which occur, eg. when acl checks fail and return a permission denied error. + +https://github.com/cs3org/reva/pull/1183 \ No newline at end of file diff --git a/pkg/eosclient/eosclient.go b/pkg/eosclient/eosclient.go index 2ea4891ef5..61770f1c77 100644 --- a/pkg/eosclient/eosclient.go +++ b/pkg/eosclient/eosclient.go @@ -247,7 +247,7 @@ func (c *Client) executeEOS(ctx context.Context, cmd *exec.Cmd) (string, string, err = nil case 2: err = errtypes.NotFound(errBuf.String()) - case 22: + case 1, 22: // eos reports back error code 22 when the user is not allowed to enter the instance err = errtypes.PermissionDenied(errBuf.String()) }