From d69decdafe1d0a20013e4e70c4c8d5403835fb14 Mon Sep 17 00:00:00 2001 From: Roman Perekhod Date: Wed, 3 May 2023 16:38:36 +0200 Subject: [PATCH 1/3] fix Graph delete request leaks existence of space #5031 --- changelog/unreleased/fix-leaks-existence.md | 6 ++++++ go.mod | 3 +++ go.sum | 2 ++ services/graph/pkg/service/v0/drives.go | 12 ++++++++---- .../features/apiSpaces/changeSpaces.feature | 2 +- .../apiSpaces/disableAndDeleteSpaces.feature | 2 +- .../features/apiSpaces/spaceManagement.feature | 2 +- 7 files changed, 22 insertions(+), 7 deletions(-) create mode 100644 changelog/unreleased/fix-leaks-existence.md diff --git a/changelog/unreleased/fix-leaks-existence.md b/changelog/unreleased/fix-leaks-existence.md new file mode 100644 index 0000000000..71b0bf1bf7 --- /dev/null +++ b/changelog/unreleased/fix-leaks-existence.md @@ -0,0 +1,6 @@ +Bugfix: Hide the existence of space when deleting/updating + +The "code": "notAllowed" changed to "code": "itemNotFound" + +https://github.com/owncloud/ocis/issues/5031 +https://github.com/owncloud/ocis/pull/6220 diff --git a/go.mod b/go.mod index a6dea5ae8f..f469a22a28 100644 --- a/go.mod +++ b/go.mod @@ -321,3 +321,6 @@ require ( ) replace github.com/cs3org/go-cs3apis => github.com/c0rby/go-cs3apis v0.0.0-20230110100311-5b424f1baa35 + +// TODO The temporal replacement +replace github.com/cs3org/reva/v2 => github.com/2403905/reva/v2 v2.0.0-20230504205508-69238ad9d885 diff --git a/go.sum b/go.sum index 494b046e34..764143b000 100644 --- a/go.sum +++ b/go.sum @@ -388,6 +388,8 @@ contrib.go.opencensus.io/exporter/ocagent v0.4.12/go.mod h1:450APlNTSR6FrvC3CTRq contrib.go.opencensus.io/exporter/prometheus v0.4.2 h1:sqfsYl5GIY/L570iT+l93ehxaWJs2/OwXtiWwew3oAg= contrib.go.opencensus.io/exporter/prometheus v0.4.2/go.mod h1:dvEHbiKmgvbr5pjaF9fpw1KeYcjrnC1J8B+JKjsZyRQ= dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9/go.mod h1:H6x//7gZCb22OMCxBHrMx7a5I7Hp++hsVxbQ4BYO7hU= +github.com/2403905/reva/v2 v2.0.0-20230504205508-69238ad9d885 h1:kXk+da30WxZIg87Uo86MLWUnCTgBDt0Qqj9/YFODvjk= +github.com/2403905/reva/v2 v2.0.0-20230504205508-69238ad9d885/go.mod h1:VxBmpOvIKlgKLPOsHun+fABopzX+3ZELPAp3N5bQMsM= github.com/Azure/azure-pipeline-go v0.2.3/go.mod h1:x841ezTBIMG6O3lAcl8ATHnsOPVl2bqk7S3ta6S6u4k= github.com/Azure/azure-sdk-for-go v32.4.0+incompatible/go.mod h1:9XXNKU+eRnpl9moKnB4QOLf1HestfXbmab5FXxiDBjc= github.com/Azure/azure-storage-blob-go v0.14.0/go.mod h1:SMqIBi+SuiQH32bvyjngEewEeXoPfKMgWlBDaYf6fck= diff --git a/services/graph/pkg/service/v0/drives.go b/services/graph/pkg/service/v0/drives.go index f3df77b44c..bb77f93bcf 100644 --- a/services/graph/pkg/service/v0/drives.go +++ b/services/graph/pkg/service/v0/drives.go @@ -468,11 +468,11 @@ func (g Graph) UpdateDrive(w http.ResponseWriter, r *http.Request) { switch resp.Status.GetCode() { case cs3rpc.Code_CODE_NOT_FOUND: logger.Debug().Interface("id", rid).Msg("could not update drive: drive not found") - errorcode.ItemNotFound.Render(w, r, http.StatusNotFound, resp.GetStatus().GetMessage()) + errorcode.ItemNotFound.Render(w, r, http.StatusNotFound, "drive not found") return case cs3rpc.Code_CODE_PERMISSION_DENIED: logger.Debug().Interface("id", rid).Msg("could not update drive, permission denied") - errorcode.NotAllowed.Render(w, r, http.StatusForbidden, resp.GetStatus().GetMessage()) + errorcode.ItemNotFound.Render(w, r, http.StatusNotFound, "drive not found") return case cs3rpc.Code_CODE_INVALID_ARGUMENT: logger.Debug().Interface("id", rid).Msg("could not update drive, invalid argument") @@ -480,7 +480,7 @@ func (g Graph) UpdateDrive(w http.ResponseWriter, r *http.Request) { return default: logger.Debug().Interface("id", rid).Str("grpc", resp.GetStatus().GetMessage()).Msg("could not update drive: grpc error") - errorcode.GeneralException.Render(w, r, http.StatusInternalServerError, resp.GetStatus().GetMessage()) + errorcode.GeneralException.Render(w, r, http.StatusInternalServerError, "grpc error") return } } @@ -1054,7 +1054,11 @@ func (g Graph) DeleteDrive(w http.ResponseWriter, r *http.Request) { return case cs3rpc.Code_CODE_PERMISSION_DENIED: logger.Debug().Interface("id", rid).Msg("could not delete drive: permission denied") - errorcode.NotAllowed.Render(w, r, http.StatusForbidden, "permission denied to delete drive") + errorcode.ItemNotFound.Render(w, r, http.StatusNotFound, "drive not found") + return + case cs3rpc.Code_CODE_NOT_FOUND: + logger.Debug().Interface("id", rid).Msg("could not delete drive: drive not found") + errorcode.ItemNotFound.Render(w, r, http.StatusNotFound, "drive not found") return // don't expose internal error codes to the outside world default: diff --git a/tests/acceptance/features/apiSpaces/changeSpaces.feature b/tests/acceptance/features/apiSpaces/changeSpaces.feature index ec8b860c8d..1e0f1884dd 100644 --- a/tests/acceptance/features/apiSpaces/changeSpaces.feature +++ b/tests/acceptance/features/apiSpaces/changeSpaces.feature @@ -1,4 +1,4 @@ -@api +@api Feature: Change data of space As a user with space admin rights I want to be able to change the meta-data of a created space (increase the quota, change name, etc.) diff --git a/tests/acceptance/features/apiSpaces/disableAndDeleteSpaces.feature b/tests/acceptance/features/apiSpaces/disableAndDeleteSpaces.feature index e362da82a2..d5727ac82a 100644 --- a/tests/acceptance/features/apiSpaces/disableAndDeleteSpaces.feature +++ b/tests/acceptance/features/apiSpaces/disableAndDeleteSpaces.feature @@ -1,4 +1,4 @@ -@api +@api Feature: Disabling and deleting space As a manager of space I want to be able to disable the space first, then delete it. diff --git a/tests/acceptance/features/apiSpaces/spaceManagement.feature b/tests/acceptance/features/apiSpaces/spaceManagement.feature index 628efb8b92..e8f4048cf0 100644 --- a/tests/acceptance/features/apiSpaces/spaceManagement.feature +++ b/tests/acceptance/features/apiSpaces/spaceManagement.feature @@ -1,4 +1,4 @@ -@api +@api Feature: Space management As a user with space admin permission I want to be able to manage all existing project spaces From 5fbee63f091e3634d8a657fee599eba086d5247e Mon Sep 17 00:00:00 2001 From: Roman Perekhod Date: Fri, 5 May 2023 12:39:25 +0200 Subject: [PATCH 2/3] fix tests --- go.sum | 2 -- .../acceptance/features/apiSpaces/changeSpaces.feature | 6 +++--- .../features/apiSpaces/disableAndDeleteSpaces.feature | 4 ++-- .../features/apiSpaces/spaceManagement.feature | 10 +++++----- .../grpc/services/storageprovider/storageprovider.go | 7 ++++++- vendor/modules.txt | 3 ++- 6 files changed, 18 insertions(+), 14 deletions(-) diff --git a/go.sum b/go.sum index 764143b000..aae053d263 100644 --- a/go.sum +++ b/go.sum @@ -629,8 +629,6 @@ github.com/crewjam/httperr v0.2.0 h1:b2BfXR8U3AlIHwNeFFvZ+BV1LFvKLlzMjzaTnZMybNo github.com/crewjam/httperr v0.2.0/go.mod h1:Jlz+Sg/XqBQhyMjdDiC+GNNRzZTD7x39Gu3pglZ5oH4= github.com/crewjam/saml v0.4.13 h1:TYHggH/hwP7eArqiXSJUvtOPNzQDyQ7vwmwEqlFWhMc= github.com/crewjam/saml v0.4.13/go.mod h1:igEejV+fihTIlHXYP8zOec3V5A8y3lws5bQBFsTm4gA= -github.com/cs3org/reva/v2 v2.13.2-0.20230504093557-756a84314af0 h1:KJHTdnQpEB3hcOSNXtMFedAvplpNRepo3RPArWFiSYo= -github.com/cs3org/reva/v2 v2.13.2-0.20230504093557-756a84314af0/go.mod h1:VxBmpOvIKlgKLPOsHun+fABopzX+3ZELPAp3N5bQMsM= github.com/cubewise-code/go-mime v0.0.0-20200519001935-8c5762b177d8 h1:Z9lwXumT5ACSmJ7WGnFl+OMLLjpz5uR2fyz7dC255FI= github.com/cubewise-code/go-mime v0.0.0-20200519001935-8c5762b177d8/go.mod h1:4abs/jPXcmJzYoYGF91JF9Uq9s/KL5n1jvFDix8KcqY= github.com/cyberdelia/templates v0.0.0-20141128023046-ca7fffd4298c/go.mod h1:GyV+0YP4qX0UQ7r2MoYZ+AvYDp12OF5yg4q8rGnyNh4= diff --git a/tests/acceptance/features/apiSpaces/changeSpaces.feature b/tests/acceptance/features/apiSpaces/changeSpaces.feature index 1e0f1884dd..4ad095a0af 100644 --- a/tests/acceptance/features/apiSpaces/changeSpaces.feature +++ b/tests/acceptance/features/apiSpaces/changeSpaces.feature @@ -51,7 +51,7 @@ Feature: Change data of space Scenario Outline: user other than space manager role can't change the name of a Space via the Graph API When user "" changes the name of the "Project Jupiter" space to "Project Jupiter" - Then the HTTP status code should be "403" + Then the HTTP status code should be "404" Examples: | user | | Brian | @@ -90,7 +90,7 @@ Feature: Change data of space Scenario Outline: viewer and editor cannot change the description(subtitle) of a space via the Graph API When user "" changes the description of the "Project Jupiter" space to "The Death Star is a fictional mobile space station" - Then the HTTP status code should be "403" + Then the HTTP status code should be "404" Examples: | user | | Brian | @@ -334,7 +334,7 @@ Feature: Change data of space Given user "Alice" has created a folder ".space" in space "Project Jupiter" And user "Alice" has uploaded a file inside space "Project Jupiter" with content "" to ".space/someImageFile.jpg" When user "Bob" sets the file ".space/someImageFile.jpg" as a space image in a special section of the "Project Jupiter" space - Then the HTTP status code should be "403" + Then the HTTP status code should be "404" Scenario Outline: user set new readme file as description of the space via the graph API diff --git a/tests/acceptance/features/apiSpaces/disableAndDeleteSpaces.feature b/tests/acceptance/features/apiSpaces/disableAndDeleteSpaces.feature index d5727ac82a..d6fa1c900c 100644 --- a/tests/acceptance/features/apiSpaces/disableAndDeleteSpaces.feature +++ b/tests/acceptance/features/apiSpaces/disableAndDeleteSpaces.feature @@ -41,7 +41,7 @@ Feature: Disabling and deleting space Scenario Outline: user with role user and guest cannot disable other space via the Graph API Given the administrator has given "Carol" the role "" using the settings api When user "Carol" tries to disable a space "Project Moon" owned by user "Alice" - Then the HTTP status code should be "403" + Then the HTTP status code should be "404" And the user "Brian" should have a space called "Project Moon" And the user "Bob" should have a space called "Project Moon" Examples: @@ -115,7 +115,7 @@ Feature: Disabling and deleting space Given the administrator has given "Carol" the role "" using the settings api And user "Alice" has disabled a space "Project Moon" When user "Carol" tries to delete a space "Project Moon" owned by user "Alice" - Then the HTTP status code should be "403" + Then the HTTP status code should be "404" Examples: | role | | User | diff --git a/tests/acceptance/features/apiSpaces/spaceManagement.feature b/tests/acceptance/features/apiSpaces/spaceManagement.feature index e8f4048cf0..9f81eb449a 100644 --- a/tests/acceptance/features/apiSpaces/spaceManagement.feature +++ b/tests/acceptance/features/apiSpaces/spaceManagement.feature @@ -113,7 +113,7 @@ Feature: Space management Scenario: user without space admin permission tries to change the name of the project space When user "Carol" tries to change the name of the "Project" space to "New Name" owned by user "Alice" - Then the HTTP status code should be "403" + Then the HTTP status code should be "404" And the user "Alice" should have a space called "Project" @skipOnStable2.0 @@ -140,7 +140,7 @@ Feature: Space management Scenario: user without space admin permission tries to change the description of the project space Given user "Alice" has changed the description of the "Project" space to "old description" When user "Carol" tries to change the description of the "Project" space to "New description" owned by user "Alice" - Then the HTTP status code should be "403" + Then the HTTP status code should be "404" @skipOnStable2.0 Scenario: space admin user disables the project space @@ -151,12 +151,12 @@ Feature: Space management Scenario: user without space admin permission tries to disable the project space When user "Carol" tries to disable a space "Project" owned by user "Alice" - Then the HTTP status code should be "403" + Then the HTTP status code should be "404" Scenario Outline: space admin user tries to disable the personal space When user "" disables a space "Alice Hansen" owned by user "Alice" - Then the HTTP status code should be "403" + Then the HTTP status code should be "404" Examples: | user | | Brian | @@ -173,7 +173,7 @@ Feature: Space management Scenario: user without space admin permission tries to delete the project space Given user "Alice" has disabled a space "Project" When user "Carol" tries to delete a space "Project" owned by user "Alice" - Then the HTTP status code should be "403" + Then the HTTP status code should be "404" @skipOnStable2.0 Scenario: space admin user enables the project space diff --git a/vendor/github.com/cs3org/reva/v2/internal/grpc/services/storageprovider/storageprovider.go b/vendor/github.com/cs3org/reva/v2/internal/grpc/services/storageprovider/storageprovider.go index ce81eae99a..2980077f2c 100644 --- a/vendor/github.com/cs3org/reva/v2/internal/grpc/services/storageprovider/storageprovider.go +++ b/vendor/github.com/cs3org/reva/v2/internal/grpc/services/storageprovider/storageprovider.go @@ -599,13 +599,18 @@ func (s *service) DeleteStorageSpace(ctx context.Context, req *provider.DeleteSt if err != nil || len(spaces) != 1 { var st *rpc.Status switch err.(type) { - case errtypes.IsNotFound, errtypes.PermissionDenied: + case errtypes.IsNotFound: + st = status.NewNotFound(ctx, "not found when deleting space") + case errtypes.PermissionDenied: st = status.NewPermissionDenied(ctx, err, "permission denied") case errtypes.BadRequest: st = status.NewInvalid(ctx, err.Error()) default: st = status.NewInternal(ctx, "error deleting space: "+req.Id.String()) } + if len(spaces) == 0 { + st = status.NewNotFound(ctx, "not found when deleting space") + } return &provider.DeleteStorageSpaceResponse{ Status: st, }, nil diff --git a/vendor/modules.txt b/vendor/modules.txt index f4c43537f1..6e5cd72fe3 100644 --- a/vendor/modules.txt +++ b/vendor/modules.txt @@ -349,7 +349,7 @@ github.com/cs3org/go-cs3apis/cs3/storage/provider/v1beta1 github.com/cs3org/go-cs3apis/cs3/storage/registry/v1beta1 github.com/cs3org/go-cs3apis/cs3/tx/v1beta1 github.com/cs3org/go-cs3apis/cs3/types/v1beta1 -# github.com/cs3org/reva/v2 v2.13.2-0.20230504093557-756a84314af0 +# github.com/cs3org/reva/v2 v2.13.2-0.20230504093557-756a84314af0 => github.com/2403905/reva/v2 v2.0.0-20230504205508-69238ad9d885 ## explicit; go 1.19 github.com/cs3org/reva/v2/cmd/revad/internal/grace github.com/cs3org/reva/v2/cmd/revad/runtime @@ -2124,3 +2124,4 @@ stash.kopano.io/kgol/oidc-go ## explicit; go 1.13 stash.kopano.io/kgol/rndm # github.com/cs3org/go-cs3apis => github.com/c0rby/go-cs3apis v0.0.0-20230110100311-5b424f1baa35 +# github.com/cs3org/reva/v2 => github.com/2403905/reva/v2 v2.0.0-20230504205508-69238ad9d885 From 8bbf4ababe91223fb28fd560cbc847fa89c80a6e Mon Sep 17 00:00:00 2001 From: Roman Perekhod Date: Mon, 8 May 2023 16:20:02 +0200 Subject: [PATCH 3/3] bump the reva version --- .gitignore | 1 + go.mod | 5 +---- go.sum | 4 ++-- .../services/storageprovider/storageprovider.go | 13 +++++++------ .../storage/utils/decomposedfs/node/permissions.go | 8 +++++++- vendor/modules.txt | 3 +-- 6 files changed, 19 insertions(+), 15 deletions(-) diff --git a/.gitignore b/.gitignore index 46dfd9735a..0902237f4a 100644 --- a/.gitignore +++ b/.gitignore @@ -50,5 +50,6 @@ protogen/buf.sha1.lock # misc go.work +go.work.sum .env .envrc diff --git a/go.mod b/go.mod index f469a22a28..feb1cd1c24 100644 --- a/go.mod +++ b/go.mod @@ -13,7 +13,7 @@ require ( github.com/coreos/go-oidc v2.2.1+incompatible github.com/coreos/go-oidc/v3 v3.4.0 github.com/cs3org/go-cs3apis v0.0.0-20221012090518-ef2996678965 - github.com/cs3org/reva/v2 v2.13.2-0.20230504093557-756a84314af0 + github.com/cs3org/reva/v2 v2.13.2-0.20230508134639-beefb0242916 github.com/disintegration/imaging v1.6.2 github.com/dutchcoders/go-clamd v0.0.0-20170520113014-b970184f4d9e github.com/egirna/icap-client v0.1.1 @@ -321,6 +321,3 @@ require ( ) replace github.com/cs3org/go-cs3apis => github.com/c0rby/go-cs3apis v0.0.0-20230110100311-5b424f1baa35 - -// TODO The temporal replacement -replace github.com/cs3org/reva/v2 => github.com/2403905/reva/v2 v2.0.0-20230504205508-69238ad9d885 diff --git a/go.sum b/go.sum index aae053d263..fd7fda5406 100644 --- a/go.sum +++ b/go.sum @@ -388,8 +388,6 @@ contrib.go.opencensus.io/exporter/ocagent v0.4.12/go.mod h1:450APlNTSR6FrvC3CTRq contrib.go.opencensus.io/exporter/prometheus v0.4.2 h1:sqfsYl5GIY/L570iT+l93ehxaWJs2/OwXtiWwew3oAg= contrib.go.opencensus.io/exporter/prometheus v0.4.2/go.mod h1:dvEHbiKmgvbr5pjaF9fpw1KeYcjrnC1J8B+JKjsZyRQ= dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9/go.mod h1:H6x//7gZCb22OMCxBHrMx7a5I7Hp++hsVxbQ4BYO7hU= -github.com/2403905/reva/v2 v2.0.0-20230504205508-69238ad9d885 h1:kXk+da30WxZIg87Uo86MLWUnCTgBDt0Qqj9/YFODvjk= -github.com/2403905/reva/v2 v2.0.0-20230504205508-69238ad9d885/go.mod h1:VxBmpOvIKlgKLPOsHun+fABopzX+3ZELPAp3N5bQMsM= github.com/Azure/azure-pipeline-go v0.2.3/go.mod h1:x841ezTBIMG6O3lAcl8ATHnsOPVl2bqk7S3ta6S6u4k= github.com/Azure/azure-sdk-for-go v32.4.0+incompatible/go.mod h1:9XXNKU+eRnpl9moKnB4QOLf1HestfXbmab5FXxiDBjc= github.com/Azure/azure-storage-blob-go v0.14.0/go.mod h1:SMqIBi+SuiQH32bvyjngEewEeXoPfKMgWlBDaYf6fck= @@ -629,6 +627,8 @@ github.com/crewjam/httperr v0.2.0 h1:b2BfXR8U3AlIHwNeFFvZ+BV1LFvKLlzMjzaTnZMybNo github.com/crewjam/httperr v0.2.0/go.mod h1:Jlz+Sg/XqBQhyMjdDiC+GNNRzZTD7x39Gu3pglZ5oH4= github.com/crewjam/saml v0.4.13 h1:TYHggH/hwP7eArqiXSJUvtOPNzQDyQ7vwmwEqlFWhMc= github.com/crewjam/saml v0.4.13/go.mod h1:igEejV+fihTIlHXYP8zOec3V5A8y3lws5bQBFsTm4gA= +github.com/cs3org/reva/v2 v2.13.2-0.20230508134639-beefb0242916 h1:ouFQ/dE5UyHN3kAzL12JnGZmzF0P1LfeByUyXVYKb/A= +github.com/cs3org/reva/v2 v2.13.2-0.20230508134639-beefb0242916/go.mod h1:VxBmpOvIKlgKLPOsHun+fABopzX+3ZELPAp3N5bQMsM= github.com/cubewise-code/go-mime v0.0.0-20200519001935-8c5762b177d8 h1:Z9lwXumT5ACSmJ7WGnFl+OMLLjpz5uR2fyz7dC255FI= github.com/cubewise-code/go-mime v0.0.0-20200519001935-8c5762b177d8/go.mod h1:4abs/jPXcmJzYoYGF91JF9Uq9s/KL5n1jvFDix8KcqY= github.com/cyberdelia/templates v0.0.0-20141128023046-ca7fffd4298c/go.mod h1:GyV+0YP4qX0UQ7r2MoYZ+AvYDp12OF5yg4q8rGnyNh4= diff --git a/vendor/github.com/cs3org/reva/v2/internal/grpc/services/storageprovider/storageprovider.go b/vendor/github.com/cs3org/reva/v2/internal/grpc/services/storageprovider/storageprovider.go index 2980077f2c..eccb45ad32 100644 --- a/vendor/github.com/cs3org/reva/v2/internal/grpc/services/storageprovider/storageprovider.go +++ b/vendor/github.com/cs3org/reva/v2/internal/grpc/services/storageprovider/storageprovider.go @@ -596,11 +596,11 @@ func (s *service) DeleteStorageSpace(ctx context.Context, req *provider.DeleteSt id := &provider.StorageSpaceId{OpaqueId: storagespace.FormatResourceID(idraw)} spaces, err := s.storage.ListStorageSpaces(ctx, []*provider.ListStorageSpacesRequest_Filter{{Type: provider.ListStorageSpacesRequest_Filter_TYPE_ID, Term: &provider.ListStorageSpacesRequest_Filter_Id{Id: id}}}, true) - if err != nil || len(spaces) != 1 { + if err != nil { var st *rpc.Status switch err.(type) { case errtypes.IsNotFound: - st = status.NewNotFound(ctx, "not found when deleting space") + st = status.NewNotFound(ctx, "space not found") case errtypes.PermissionDenied: st = status.NewPermissionDenied(ctx, err, "permission denied") case errtypes.BadRequest: @@ -608,19 +608,20 @@ func (s *service) DeleteStorageSpace(ctx context.Context, req *provider.DeleteSt default: st = status.NewInternal(ctx, "error deleting space: "+req.Id.String()) } - if len(spaces) == 0 { - st = status.NewNotFound(ctx, "not found when deleting space") - } return &provider.DeleteStorageSpaceResponse{ Status: st, }, nil + } else if len(spaces) != 1 { + return &provider.DeleteStorageSpaceResponse{ + Status: status.NewNotFound(ctx, "space not found"), + }, nil } if err := s.storage.DeleteStorageSpace(ctx, req); err != nil { var st *rpc.Status switch err.(type) { case errtypes.IsNotFound: - st = status.NewNotFound(ctx, "not found when deleting space") + st = status.NewNotFound(ctx, "space not found") case errtypes.PermissionDenied: st = status.NewPermissionDenied(ctx, err, "permission denied") case errtypes.BadRequest: diff --git a/vendor/github.com/cs3org/reva/v2/pkg/storage/utils/decomposedfs/node/permissions.go b/vendor/github.com/cs3org/reva/v2/pkg/storage/utils/decomposedfs/node/permissions.go index 0703a913cd..0899ba2c69 100644 --- a/vendor/github.com/cs3org/reva/v2/pkg/storage/utils/decomposedfs/node/permissions.go +++ b/vendor/github.com/cs3org/reva/v2/pkg/storage/utils/decomposedfs/node/permissions.go @@ -145,8 +145,14 @@ func (p *Permissions) AssemblePermissions(ctx context.Context, n *Node) (ap prov appctx.GetLogger(ctx).Error().Err(err).Interface("node", cn.ID).Msg("error reading permissions") // continue with next segment } + if cn, err = cn.Parent(); err != nil { - return ap, errors.Wrap(err, "Decomposedfs: error getting parent for node "+cn.ID) + // We get an error but get a parent, but can not read it from disk (eg. it has been deleted already) + if cn != nil { + return ap, errors.Wrap(err, "Decomposedfs: error getting parent for node "+cn.ID) + } + // We do not have a parent, so we assume the next valid parent is the spaceRoot (which must always exist) + cn = n.SpaceRoot } } diff --git a/vendor/modules.txt b/vendor/modules.txt index 6e5cd72fe3..2f5717534c 100644 --- a/vendor/modules.txt +++ b/vendor/modules.txt @@ -349,7 +349,7 @@ github.com/cs3org/go-cs3apis/cs3/storage/provider/v1beta1 github.com/cs3org/go-cs3apis/cs3/storage/registry/v1beta1 github.com/cs3org/go-cs3apis/cs3/tx/v1beta1 github.com/cs3org/go-cs3apis/cs3/types/v1beta1 -# github.com/cs3org/reva/v2 v2.13.2-0.20230504093557-756a84314af0 => github.com/2403905/reva/v2 v2.0.0-20230504205508-69238ad9d885 +# github.com/cs3org/reva/v2 v2.13.2-0.20230508134639-beefb0242916 ## explicit; go 1.19 github.com/cs3org/reva/v2/cmd/revad/internal/grace github.com/cs3org/reva/v2/cmd/revad/runtime @@ -2124,4 +2124,3 @@ stash.kopano.io/kgol/oidc-go ## explicit; go 1.13 stash.kopano.io/kgol/rndm # github.com/cs3org/go-cs3apis => github.com/c0rby/go-cs3apis v0.0.0-20230110100311-5b424f1baa35 -# github.com/cs3org/reva/v2 => github.com/2403905/reva/v2 v2.0.0-20230504205508-69238ad9d885