From 20667899174c8a6d6d5cde34c2fe7ff138ae607e Mon Sep 17 00:00:00 2001 From: David Christofas Date: Tue, 15 Jun 2021 13:30:39 +0200 Subject: [PATCH 1/5] check preconditions for ocdav trashbin restore requests --- changelog/unreleased/trashbin-restore.md | 7 ++ .../http/services/owncloud/ocdav/error.go | 14 +++- internal/http/services/owncloud/ocdav/put.go | 2 +- .../http/services/owncloud/ocdav/trashbin.go | 74 ++++++++++++++++++- 4 files changed, 90 insertions(+), 7 deletions(-) create mode 100644 changelog/unreleased/trashbin-restore.md diff --git a/changelog/unreleased/trashbin-restore.md b/changelog/unreleased/trashbin-restore.md new file mode 100644 index 0000000000..5abe3fdc13 --- /dev/null +++ b/changelog/unreleased/trashbin-restore.md @@ -0,0 +1,7 @@ +Enhancement: Add precondition checks for ocdav trashbin restore + +The precondition were not checked before doing a trashbin restore in the ownCloud dav API. +Without the checks the API would behave differently compared to the oC10 API. + +https://github.com/cs3org/reva/pull/1795 + diff --git a/internal/http/services/owncloud/ocdav/error.go b/internal/http/services/owncloud/ocdav/error.go index 304df8578e..b8947481d8 100644 --- a/internal/http/services/owncloud/ocdav/error.go +++ b/internal/http/services/owncloud/ocdav/error.go @@ -31,12 +31,14 @@ type code int const ( - // SabredavMethodBadRequest maps to HTTP 400 - SabredavMethodBadRequest code = iota + // SabredavBadRequest maps to HTTP 400 + SabredavBadRequest code = iota // SabredavMethodNotAllowed maps to HTTP 405 SabredavMethodNotAllowed - // SabredavMethodNotAuthenticated maps to HTTP 401 - SabredavMethodNotAuthenticated + // SabredavNotAuthenticated maps to HTTP 401 + SabredavNotAuthenticated + // SabredavPreconditionFailed maps to HTTP 412 + SabredavPreconditionFailed ) var ( @@ -44,12 +46,14 @@ var ( "Sabre\\DAV\\Exception\\BadRequest", "Sabre\\DAV\\Exception\\MethodNotAllowed", "Sabre\\DAV\\Exception\\NotAuthenticated", + "Sabre\\DAV\\Exception\\PreconditionFailed", } ) type exception struct { code code message string + header string } // Marshal just calls the xml marshaller for a given exception. @@ -59,6 +63,7 @@ func Marshal(e exception) ([]byte, error) { Xmlnss: "http://sabredav.org/ns", Exception: codesEnum[e.code], Message: e.message, + Header: e.header, }) } @@ -70,6 +75,7 @@ type errorXML struct { Exception string `xml:"s:exception"` Message string `xml:"s:message"` InnerXML []byte `xml:",innerxml"` + Header string `xml:"s:header"` } var errInvalidPropfind = errors.New("webdav: invalid propfind") diff --git a/internal/http/services/owncloud/ocdav/put.go b/internal/http/services/owncloud/ocdav/put.go index 7a9ad49963..18706b4519 100644 --- a/internal/http/services/owncloud/ocdav/put.go +++ b/internal/http/services/owncloud/ocdav/put.go @@ -282,7 +282,7 @@ func (s *svc) handlePutHelper(w http.ResponseWriter, r *http.Request, content io if httpRes.StatusCode == errtypes.StatusChecksumMismatch { w.WriteHeader(http.StatusBadRequest) b, err := Marshal(exception{ - code: SabredavMethodBadRequest, + code: SabredavBadRequest, message: "The computed checksum does not match the one received from the client.", }) if err != nil { diff --git a/internal/http/services/owncloud/ocdav/trashbin.go b/internal/http/services/owncloud/ocdav/trashbin.go index cbc992f922..473e3af33a 100644 --- a/internal/http/services/owncloud/ocdav/trashbin.go +++ b/internal/http/services/owncloud/ocdav/trashbin.go @@ -80,7 +80,7 @@ func (h *TrashbinHandler) Handler(s *svc) http.Handler { log.Debug().Str("username", username).Interface("user", u).Msg("trying to read another users trash") // listing other users trash is forbidden, no auth will change that b, err := Marshal(exception{ - code: SabredavMethodNotAuthenticated, + code: SabredavNotAuthenticated, }) if err != nil { log.Error().Msgf("error marshaling xml response: %s", b) @@ -370,6 +370,18 @@ func (h *TrashbinHandler) restore(w http.ResponseWriter, r *http.Request, s *svc sublog := appctx.GetLogger(ctx).With().Logger() + overwrite := r.Header.Get("Overwrite") + + overwrite = strings.ToUpper(overwrite) + if overwrite == "" { + overwrite = "T" + } + + if overwrite != "T" && overwrite != "F" { + w.WriteHeader(http.StatusBadRequest) + return + } + client, err := s.getClient() if err != nil { sublog.Error().Err(err).Msg("error getting grpc client") @@ -388,6 +400,64 @@ func (h *TrashbinHandler) restore(w http.ResponseWriter, r *http.Request, s *svc return } + dstRef := &provider.Reference{ + Path: filepath.Join(getHomeRes.Path, dst), + } + + dstStatReq := &provider.StatRequest{ + Ref: dstRef, + } + + dstStatRes, err := client.Stat(ctx, dstStatReq) + if err != nil { + sublog.Error().Err(err).Msg("error sending grpc stat request") + w.WriteHeader(http.StatusInternalServerError) + return + } + + if dstStatRes.Status.Code != rpc.Code_CODE_OK && dstStatRes.Status.Code != rpc.Code_CODE_NOT_FOUND { + HandleErrorStatus(&sublog, w, dstStatRes.Status) + return + } + + successCode := http.StatusCreated // 201 if new resource was created, see https://tools.ietf.org/html/rfc4918#section-9.9.4 + if dstStatRes.Status.Code == rpc.Code_CODE_OK { + successCode = http.StatusNoContent // 204 if target already existed, see https://tools.ietf.org/html/rfc4918#section-9.9.4 + + if overwrite != "T" { + sublog.Warn().Str("overwrite", overwrite).Msg("dst already exists") + w.WriteHeader(http.StatusPreconditionFailed) // 412, see https://tools.ietf.org/html/rfc4918#section-9.9.4 + b, err := Marshal(exception{ + code: SabredavPreconditionFailed, + message: "The destination node already exists, and the overwrite header is set to false", + header: "Overwrite", + }) + if err != nil { + sublog.Error().Msgf("error marshaling xml response: %s", b) + w.WriteHeader(http.StatusInternalServerError) + return + } + _, err = w.Write(b) + if err != nil { + sublog.Err(err).Msg("error writing response") + } + return + } + // delete existing tree + delReq := &provider.DeleteRequest{Ref: dstRef} + delRes, err := client.Delete(ctx, delReq) + if err != nil { + sublog.Error().Err(err).Msg("error sending grpc delete request") + w.WriteHeader(http.StatusInternalServerError) + return + } + + if delRes.Status.Code != rpc.Code_CODE_OK && delRes.Status.Code != rpc.Code_CODE_NOT_FOUND { + HandleErrorStatus(&sublog, w, delRes.Status) + return + } + } + req := &provider.RestoreRecycleItemRequest{ // use the target path to find the storage provider // this means we can only undelete on the same storage, not to a different folder @@ -411,7 +481,7 @@ func (h *TrashbinHandler) restore(w http.ResponseWriter, r *http.Request, s *svc HandleErrorStatus(&sublog, w, res.Status) return } - w.WriteHeader(http.StatusCreated) + w.WriteHeader(successCode) } // delete has only a key From b4da58c41d7ef5026da3f9ea833807b61a55dc3e Mon Sep 17 00:00:00 2001 From: David Christofas Date: Tue, 15 Jun 2021 16:05:46 +0200 Subject: [PATCH 2/5] add headers to trashbin restore response --- changelog/unreleased/trashbin-restore.md | 6 +++--- .../http/services/owncloud/ocdav/trashbin.go | 18 ++++++++++++++++++ 2 files changed, 21 insertions(+), 3 deletions(-) diff --git a/changelog/unreleased/trashbin-restore.md b/changelog/unreleased/trashbin-restore.md index 5abe3fdc13..e7688d7728 100644 --- a/changelog/unreleased/trashbin-restore.md +++ b/changelog/unreleased/trashbin-restore.md @@ -1,7 +1,7 @@ -Enhancement: Add precondition checks for ocdav trashbin restore +Enhancement: Increase trashbin restore API compatibility -The precondition were not checked before doing a trashbin restore in the ownCloud dav API. -Without the checks the API would behave differently compared to the oC10 API. +* The precondition were not checked before doing a trashbin restore in the ownCloud dav API. Without the checks the API would behave differently compared to the oC10 API. +* The restore response was missing HTTP headers like `ETag` https://github.com/cs3org/reva/pull/1795 diff --git a/internal/http/services/owncloud/ocdav/trashbin.go b/internal/http/services/owncloud/ocdav/trashbin.go index 473e3af33a..d19c086631 100644 --- a/internal/http/services/owncloud/ocdav/trashbin.go +++ b/internal/http/services/owncloud/ocdav/trashbin.go @@ -481,6 +481,24 @@ func (h *TrashbinHandler) restore(w http.ResponseWriter, r *http.Request, s *svc HandleErrorStatus(&sublog, w, res.Status) return } + + dstStatRes, err = client.Stat(ctx, dstStatReq) + if err != nil { + sublog.Error().Err(err).Msg("error sending grpc stat request") + w.WriteHeader(http.StatusInternalServerError) + return + } + if dstStatRes.Status.Code != rpc.Code_CODE_OK { + HandleErrorStatus(&sublog, w, dstStatRes.Status) + return + } + + info := dstStatRes.Info + w.Header().Set("Content-Type", info.MimeType) + w.Header().Set("ETag", info.Etag) + w.Header().Set("OC-FileId", wrapResourceID(info.Id)) + w.Header().Set("OC-ETag", info.Etag) + w.WriteHeader(successCode) } From faf229851407fa75f0e3c225468b4ba43a49a79f Mon Sep 17 00:00:00 2001 From: David Christofas Date: Wed, 16 Jun 2021 16:17:23 +0200 Subject: [PATCH 3/5] update expected failures --- .../expected-failures-on-OCIS-storage.md | 12 +------ .../expected-failures-on-OWNCLOUD-storage.md | 33 ++++++++++--------- .../expected-failures-on-S3NG-storage.md | 12 +------ 3 files changed, 19 insertions(+), 38 deletions(-) diff --git a/tests/acceptance/expected-failures-on-OCIS-storage.md b/tests/acceptance/expected-failures-on-OCIS-storage.md index 71919a3207..ed55c4dc51 100644 --- a/tests/acceptance/expected-failures-on-OCIS-storage.md +++ b/tests/acceptance/expected-failures-on-OCIS-storage.md @@ -26,20 +26,10 @@ Basic file management like up and download, move, copy, properties, quota, trash - [apiTrashbin/trashbinRestore.feature:111](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiTrashbin/trashbinRestore.feature#L111) #### [trash-bin restore move does not send back Etag and other headers](https://github.com/owncloud/ocis/issues/1121) -- [apiTrashbin/trashbinRestore.feature:34](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiTrashbin/trashbinRestore.feature#L34) -- [apiTrashbin/trashbinRestore.feature:35](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiTrashbin/trashbinRestore.feature#L35) - [apiTrashbin/trashbinRestore.feature:130](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiTrashbin/trashbinRestore.feature#L130) - [apiTrashbin/trashbinRestore.feature:131](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiTrashbin/trashbinRestore.feature#L131) -#### [cannot restore to a different file-name](https://github.com/owncloud/ocis/issues/1122) -#### [trash-bin restore move does not send back Etag and other headers](https://github.com/owncloud/ocis/issues/1121) -- [apiTrashbin/trashbinRestore.feature:88](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiTrashbin/trashbinRestore.feature#L88) -- [apiTrashbin/trashbinRestore.feature:89](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiTrashbin/trashbinRestore.feature#L89) -- [apiTrashbin/trashbinRestore.feature:90](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiTrashbin/trashbinRestore.feature#L90) -- [apiTrashbin/trashbinRestore.feature:91](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiTrashbin/trashbinRestore.feature#L91) -- [apiTrashbin/trashbinRestore.feature:92](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiTrashbin/trashbinRestore.feature#L92) -- [apiTrashbin/trashbinRestore.feature:93](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiTrashbin/trashbinRestore.feature#L93) - +#### [href in trashbin PROPFIND response is wrong](https://github.com/owncloud/ocis/issues/1120) #### [cannot restore to a different file-name](https://github.com/owncloud/ocis/issues/1122) - [apiTrashbin/trashbinRestore.feature:309](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiTrashbin/trashbinRestore.feature#L309) - [apiTrashbin/trashbinRestore.feature:310](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiTrashbin/trashbinRestore.feature#L310) diff --git a/tests/acceptance/expected-failures-on-OWNCLOUD-storage.md b/tests/acceptance/expected-failures-on-OWNCLOUD-storage.md index b79c616567..dfd331e145 100644 --- a/tests/acceptance/expected-failures-on-OWNCLOUD-storage.md +++ b/tests/acceptance/expected-failures-on-OWNCLOUD-storage.md @@ -33,22 +33,23 @@ The following scenarios fail on OWNCLOUD storage but not on OCIS storage: - [apiTrashbin/trashbinRestore.feature:110](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiTrashbin/trashbinRestore.feature#L110) - [apiTrashbin/trashbinRestore.feature:111](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiTrashbin/trashbinRestore.feature#L111) - -#### [trash-bin restore move does not send back Etag and other headers](https://github.com/owncloud/ocis/issues/1121) -- [apiTrashbin/trashbinRestore.feature:34](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiTrashbin/trashbinRestore.feature#L34) -- [apiTrashbin/trashbinRestore.feature:35](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiTrashbin/trashbinRestore.feature#L35) -- [apiTrashbin/trashbinRestore.feature:130](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiTrashbin/trashbinRestore.feature#L130) -- [apiTrashbin/trashbinRestore.feature:131](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiTrashbin/trashbinRestore.feature#L131) - -#### [cannot restore to a different file-name](https://github.com/owncloud/ocis/issues/1122) -#### [trash-bin restore move does not send back Etag and other headers](https://github.com/owncloud/ocis/issues/1121) -- [apiTrashbin/trashbinRestore.feature:88](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiTrashbin/trashbinRestore.feature#L88) -- [apiTrashbin/trashbinRestore.feature:89](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiTrashbin/trashbinRestore.feature#L89) -- [apiTrashbin/trashbinRestore.feature:90](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiTrashbin/trashbinRestore.feature#L90) -- [apiTrashbin/trashbinRestore.feature:91](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiTrashbin/trashbinRestore.feature#L91) -- [apiTrashbin/trashbinRestore.feature:92](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiTrashbin/trashbinRestore.feature#L92) -- [apiTrashbin/trashbinRestore.feature:93](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiTrashbin/trashbinRestore.feature#L93) - +#### [href in trashbin PROPFIND response is wrong](https://github.com/owncloud/ocis/issues/1120) +- [apiTrashbin/trashbinRestore.feature:116](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiTrashbin/trashbinRestore.feature#L116) +- [apiTrashbin/trashbinRestore.feature:117](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiTrashbin/trashbinRestore.feature#L117) +- [apiTrashbin/trashbinRestore.feature:118](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiTrashbin/trashbinRestore.feature#L118) +- [apiTrashbin/trashbinRestore.feature:119](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiTrashbin/trashbinRestore.feature#L119) +- [apiTrashbin/trashbinRestore.feature:257](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiTrashbin/trashbinRestore.feature#L257) +- [apiTrashbin/trashbinRestore.feature:258](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiTrashbin/trashbinRestore.feature#L258) +- [apiTrashbin/trashbinRestore.feature:259](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiTrashbin/trashbinRestore.feature#L259) +- [apiTrashbin/trashbinRestore.feature:260](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiTrashbin/trashbinRestore.feature#L260) +- [apiTrashbin/trashbinRestore.feature:261](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiTrashbin/trashbinRestore.feature#L261) +- [apiTrashbin/trashbinRestore.feature:262](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiTrashbin/trashbinRestore.feature#L262) +- [apiTrashbin/trashbinRestore.feature:410](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiTrashbin/trashbinRestore.feature#L410) +- [apiTrashbin/trashbinRestore.feature:411](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiTrashbin/trashbinRestore.feature#L411) +- [apiTrashbin/trashbinRestore.feature:449](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiTrashbin/trashbinRestore.feature#L449) +- [apiTrashbin/trashbinRestore.feature:450](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiTrashbin/trashbinRestore.feature#L450) + +#### [href in trashbin PROPFIND response is wrong](https://github.com/owncloud/ocis/issues/1120) #### [cannot restore to a different file-name](https://github.com/owncloud/ocis/issues/1122) - [apiTrashbin/trashbinRestore.feature:309](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiTrashbin/trashbinRestore.feature#L309) - [apiTrashbin/trashbinRestore.feature:310](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiTrashbin/trashbinRestore.feature#L310) diff --git a/tests/acceptance/expected-failures-on-S3NG-storage.md b/tests/acceptance/expected-failures-on-S3NG-storage.md index de5891788b..8474266769 100644 --- a/tests/acceptance/expected-failures-on-S3NG-storage.md +++ b/tests/acceptance/expected-failures-on-S3NG-storage.md @@ -26,20 +26,10 @@ Basic file management like up and download, move, copy, properties, quota, trash - [apiTrashbin/trashbinRestore.feature:111](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiTrashbin/trashbinRestore.feature#L111) #### [trash-bin restore move does not send back Etag and other headers](https://github.com/owncloud/ocis/issues/1121) -- [apiTrashbin/trashbinRestore.feature:34](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiTrashbin/trashbinRestore.feature#L34) -- [apiTrashbin/trashbinRestore.feature:35](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiTrashbin/trashbinRestore.feature#L35) - [apiTrashbin/trashbinRestore.feature:130](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiTrashbin/trashbinRestore.feature#L130) - [apiTrashbin/trashbinRestore.feature:131](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiTrashbin/trashbinRestore.feature#L131) -#### [cannot restore to a different file-name](https://github.com/owncloud/ocis/issues/1122) -#### [trash-bin restore move does not send back Etag and other headers](https://github.com/owncloud/ocis/issues/1121) -- [apiTrashbin/trashbinRestore.feature:88](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiTrashbin/trashbinRestore.feature#L88) -- [apiTrashbin/trashbinRestore.feature:89](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiTrashbin/trashbinRestore.feature#L89) -- [apiTrashbin/trashbinRestore.feature:90](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiTrashbin/trashbinRestore.feature#L90) -- [apiTrashbin/trashbinRestore.feature:91](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiTrashbin/trashbinRestore.feature#L91) -- [apiTrashbin/trashbinRestore.feature:92](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiTrashbin/trashbinRestore.feature#L92) -- [apiTrashbin/trashbinRestore.feature:93](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiTrashbin/trashbinRestore.feature#L93) - +#### [href in trashbin PROPFIND response is wrong](https://github.com/owncloud/ocis/issues/1120) #### [cannot restore to a different file-name](https://github.com/owncloud/ocis/issues/1122) - [apiTrashbin/trashbinRestore.feature:309](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiTrashbin/trashbinRestore.feature#L309) - [apiTrashbin/trashbinRestore.feature:310](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiTrashbin/trashbinRestore.feature#L310) From e8d4baae06e45acd952ca6f8346477552fa8327d Mon Sep 17 00:00:00 2001 From: David Christofas Date: Mon, 21 Jun 2021 11:17:18 +0200 Subject: [PATCH 4/5] update name when restore to new name --- changelog/unreleased/trashbin-restore.md | 1 + pkg/storage/utils/decomposedfs/tree/tree.go | 4 ++++ 2 files changed, 5 insertions(+) diff --git a/changelog/unreleased/trashbin-restore.md b/changelog/unreleased/trashbin-restore.md index e7688d7728..efedf8af2b 100644 --- a/changelog/unreleased/trashbin-restore.md +++ b/changelog/unreleased/trashbin-restore.md @@ -2,6 +2,7 @@ Enhancement: Increase trashbin restore API compatibility * The precondition were not checked before doing a trashbin restore in the ownCloud dav API. Without the checks the API would behave differently compared to the oC10 API. * The restore response was missing HTTP headers like `ETag` +* Update the name when restoring the file from trashbin to a new target name https://github.com/cs3org/reva/pull/1795 diff --git a/pkg/storage/utils/decomposedfs/tree/tree.go b/pkg/storage/utils/decomposedfs/tree/tree.go index a6f0700871..34b5056b27 100644 --- a/pkg/storage/utils/decomposedfs/tree/tree.go +++ b/pkg/storage/utils/decomposedfs/tree/tree.go @@ -381,6 +381,10 @@ func (t *Tree) RestoreRecycleItemFunc(ctx context.Context, key, restorePath stri } n.Exists = true + // update name attribute + if err := xattr.Set(nodePath, xattrs.NameAttr, []byte(n.Name)); err != nil { + return errors.Wrap(err, "Decomposedfs: could not set name attribute") + } // delete item link in trash if err = os.Remove(trashItem); err != nil { From ca8e6692a53f39457a3ee9a01cca1b054642fe04 Mon Sep 17 00:00:00 2001 From: David Christofas Date: Tue, 22 Jun 2021 15:51:16 +0200 Subject: [PATCH 5/5] update expected failures --- .../expected-failures-on-OCIS-storage.md | 8 +------- .../expected-failures-on-OWNCLOUD-storage.md | 16 ---------------- .../expected-failures-on-S3NG-storage.md | 8 +------- 3 files changed, 2 insertions(+), 30 deletions(-) diff --git a/tests/acceptance/expected-failures-on-OCIS-storage.md b/tests/acceptance/expected-failures-on-OCIS-storage.md index ed55c4dc51..47ed83a9ff 100644 --- a/tests/acceptance/expected-failures-on-OCIS-storage.md +++ b/tests/acceptance/expected-failures-on-OCIS-storage.md @@ -19,12 +19,6 @@ Basic file management like up and download, move, copy, properties, quota, trash - [apiTrashbin/trashbinFilesFolders.feature:278](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiTrashbin/trashbinFilesFolders.feature#L278) - [apiTrashbin/trashbinFilesFolders.feature:279](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiTrashbin/trashbinFilesFolders.feature#L279) -#### [cannot restore to a different file-name](https://github.com/owncloud/ocis/issues/1122) -- [apiTrashbin/trashbinRestore.feature:108](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiTrashbin/trashbinRestore.feature#L108) -- [apiTrashbin/trashbinRestore.feature:109](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiTrashbin/trashbinRestore.feature#L109) -- [apiTrashbin/trashbinRestore.feature:110](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiTrashbin/trashbinRestore.feature#L110) -- [apiTrashbin/trashbinRestore.feature:111](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiTrashbin/trashbinRestore.feature#L111) - #### [trash-bin restore move does not send back Etag and other headers](https://github.com/owncloud/ocis/issues/1121) - [apiTrashbin/trashbinRestore.feature:130](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiTrashbin/trashbinRestore.feature#L130) - [apiTrashbin/trashbinRestore.feature:131](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiTrashbin/trashbinRestore.feature#L131) @@ -2005,4 +1999,4 @@ _ocs: api compatibility, return correct status code_ - [apiWebdavProperties1/copyFile.feature:437](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiWebdavProperties1/copyFile.feature#L437) - [apiWebdavProperties1/copyFile.feature:438](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiWebdavProperties1/copyFile.feature#L438) - [apiWebdavProperties1/copyFile.feature:464](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiWebdavProperties1/copyFile.feature#L464) -- [apiWebdavProperties1/copyFile.feature:465](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiWebdavProperties1/copyFile.feature#L465) \ No newline at end of file +- [apiWebdavProperties1/copyFile.feature:465](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiWebdavProperties1/copyFile.feature#L465) diff --git a/tests/acceptance/expected-failures-on-OWNCLOUD-storage.md b/tests/acceptance/expected-failures-on-OWNCLOUD-storage.md index dfd331e145..71f79c4536 100644 --- a/tests/acceptance/expected-failures-on-OWNCLOUD-storage.md +++ b/tests/acceptance/expected-failures-on-OWNCLOUD-storage.md @@ -33,22 +33,6 @@ The following scenarios fail on OWNCLOUD storage but not on OCIS storage: - [apiTrashbin/trashbinRestore.feature:110](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiTrashbin/trashbinRestore.feature#L110) - [apiTrashbin/trashbinRestore.feature:111](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiTrashbin/trashbinRestore.feature#L111) -#### [href in trashbin PROPFIND response is wrong](https://github.com/owncloud/ocis/issues/1120) -- [apiTrashbin/trashbinRestore.feature:116](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiTrashbin/trashbinRestore.feature#L116) -- [apiTrashbin/trashbinRestore.feature:117](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiTrashbin/trashbinRestore.feature#L117) -- [apiTrashbin/trashbinRestore.feature:118](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiTrashbin/trashbinRestore.feature#L118) -- [apiTrashbin/trashbinRestore.feature:119](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiTrashbin/trashbinRestore.feature#L119) -- [apiTrashbin/trashbinRestore.feature:257](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiTrashbin/trashbinRestore.feature#L257) -- [apiTrashbin/trashbinRestore.feature:258](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiTrashbin/trashbinRestore.feature#L258) -- [apiTrashbin/trashbinRestore.feature:259](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiTrashbin/trashbinRestore.feature#L259) -- [apiTrashbin/trashbinRestore.feature:260](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiTrashbin/trashbinRestore.feature#L260) -- [apiTrashbin/trashbinRestore.feature:261](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiTrashbin/trashbinRestore.feature#L261) -- [apiTrashbin/trashbinRestore.feature:262](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiTrashbin/trashbinRestore.feature#L262) -- [apiTrashbin/trashbinRestore.feature:410](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiTrashbin/trashbinRestore.feature#L410) -- [apiTrashbin/trashbinRestore.feature:411](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiTrashbin/trashbinRestore.feature#L411) -- [apiTrashbin/trashbinRestore.feature:449](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiTrashbin/trashbinRestore.feature#L449) -- [apiTrashbin/trashbinRestore.feature:450](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiTrashbin/trashbinRestore.feature#L450) - #### [href in trashbin PROPFIND response is wrong](https://github.com/owncloud/ocis/issues/1120) #### [cannot restore to a different file-name](https://github.com/owncloud/ocis/issues/1122) - [apiTrashbin/trashbinRestore.feature:309](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiTrashbin/trashbinRestore.feature#L309) diff --git a/tests/acceptance/expected-failures-on-S3NG-storage.md b/tests/acceptance/expected-failures-on-S3NG-storage.md index 8474266769..6051a779e6 100644 --- a/tests/acceptance/expected-failures-on-S3NG-storage.md +++ b/tests/acceptance/expected-failures-on-S3NG-storage.md @@ -19,12 +19,6 @@ Basic file management like up and download, move, copy, properties, quota, trash - [apiTrashbin/trashbinFilesFolders.feature:278](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiTrashbin/trashbinFilesFolders.feature#L278) - [apiTrashbin/trashbinFilesFolders.feature:279](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiTrashbin/trashbinFilesFolders.feature#L279) -#### [cannot restore to a different file-name](https://github.com/owncloud/ocis/issues/1122) -- [apiTrashbin/trashbinRestore.feature:108](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiTrashbin/trashbinRestore.feature#L108) -- [apiTrashbin/trashbinRestore.feature:109](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiTrashbin/trashbinRestore.feature#L109) -- [apiTrashbin/trashbinRestore.feature:110](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiTrashbin/trashbinRestore.feature#L110) -- [apiTrashbin/trashbinRestore.feature:111](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiTrashbin/trashbinRestore.feature#L111) - #### [trash-bin restore move does not send back Etag and other headers](https://github.com/owncloud/ocis/issues/1121) - [apiTrashbin/trashbinRestore.feature:130](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiTrashbin/trashbinRestore.feature#L130) - [apiTrashbin/trashbinRestore.feature:131](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiTrashbin/trashbinRestore.feature#L131) @@ -2010,4 +2004,4 @@ _ocs: api compatibility, return correct status code_ - [apiWebdavProperties1/copyFile.feature:437](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiWebdavProperties1/copyFile.feature#L437) - [apiWebdavProperties1/copyFile.feature:438](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiWebdavProperties1/copyFile.feature#L438) - [apiWebdavProperties1/copyFile.feature:464](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiWebdavProperties1/copyFile.feature#L464) -- [apiWebdavProperties1/copyFile.feature:465](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiWebdavProperties1/copyFile.feature#L465) \ No newline at end of file +- [apiWebdavProperties1/copyFile.feature:465](https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiWebdavProperties1/copyFile.feature#L465)