From defc5de3a9782cff698b5701f5415ed7fe28cd3c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9=20Duffeck?= Date: Thu, 25 Feb 2021 14:49:58 +0100 Subject: [PATCH] Return CODE_NOT_FOUND when listing the non-existent shared folder As defined in the protocol. --- pkg/storage/fs/owncloud/owncloud.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/pkg/storage/fs/owncloud/owncloud.go b/pkg/storage/fs/owncloud/owncloud.go index 19efc2f8a5e..9e8c617ae3a 100644 --- a/pkg/storage/fs/owncloud/owncloud.go +++ b/pkg/storage/fs/owncloud/owncloud.go @@ -1814,6 +1814,9 @@ func (fs *ocfs) listShareFolderRoot(ctx context.Context, sp string, mdKeys []str mds, err := ioutil.ReadDir(ip) if err != nil { + if os.IsNotExist(err) { + return nil, errtypes.NotFound(fs.toStoragePath(ctx, filepath.Dir(ip))) + } return nil, errors.Wrap(err, "ocfs: error listing shadow_files") }