diff --git a/internal/http/services/owncloud/ocdav/report.go b/internal/http/services/owncloud/ocdav/report.go index 7ec2123568a..d51b36eff70 100644 --- a/internal/http/services/owncloud/ocdav/report.go +++ b/internal/http/services/owncloud/ocdav/report.go @@ -89,7 +89,7 @@ func (s *svc) doSearchFiles(w http.ResponseWriter, r *http.Request, sf *reportSe } // TODO(salfagem): hardcoded path for the time being: - ref := &provider.Reference{Path: "/eos/project/c/cernbox"} + ref := &provider.Reference{Path: "/eos/project/t/test"} req := &provider.ListContainerRequest{Opaque: &typespb.Opaque{ Map: opaqueMap, @@ -103,6 +103,8 @@ func (s *svc) doSearchFiles(w http.ResponseWriter, r *http.Request, sf *reportSe return } + log.Debug().Msgf("search: found %d matches", len(res.Infos)) + for _, v := range res.Infos { log.Debug().Msg(v.Path) } @@ -110,45 +112,159 @@ func (s *svc) doSearchFiles(w http.ResponseWriter, r *http.Request, sf *reportSe data := ` - - /remote.php/dav/spaces/1284d238-aa92-42ce-bdc4-0b0000009157$4c510ada-c86b-4815-8820-42cdf82c3d51/asd.txt + + /remote.php/dav/files/cboxbot/eos/project/a/awesomeproject/New%20Text%20Document.txt + + + newproject-a!420307062 + newproject-a!616510 + New Text Document.txt + 2022-12-05T16:12:20Z + text/plain + SRDNVCKZ + + + + + 0 + + HTTP/1.1 200 OK + + + + /remote.php/dav/files/cboxbot/eos/project/a/awesomeproject/New%20text%20file.txt - - 1284d238-aa92-42ce-bdc4-0b0000009157$4c510ada-c86b-4815-8820-42cdf82c3d51!d5613880-307c-4e3e-b56d-97839fcf6d03 - 1284d238-aa92-42ce-bdc4-0b0000009157$4c510ada-c86b-4815-8820-42cdf82c3d51!4c510ada-c86b-4815-8820-42cdf82c3d51 - asd.txt - 2022-11-08T10:45:16Z + + newproject-a!166399624 + newproject-a!616510 + New text file.txt + 2022-12-05T16:12:20Z text/plain - RDNVW + SRDNVCKZ - - 0 - 0.4809828996658325 - - HTTP/1.1 200 OK + + + + 5 + + HTTP/1.1 200 OK - - - /remote.php/dav/spaces/1284d238-aa92-42ce-bdc4-0b0000009157$4c510ada-c86b-4815-8820-42cdf82c3d51/asdddddd + + + /remote.php/dav/files/cboxbot/eos/project/a/awesomeproject/recover.txt - - 1284d238-aa92-42ce-bdc4-0b0000009157$4c510ada-c86b-4815-8820-42cdf82c3d51!fa3c7a85-5fc4-46d3-a0b1-293a282da1b7 - 1284d238-aa92-42ce-bdc4-0b0000009157$4c510ada-c86b-4815-8820-42cdf82c3d51!4c510ada-c86b-4815-8820-42cdf82c3d51 - asdddddd - 2022-11-08T10:45:32Z - httpd/unix-directory - RDNVCK + + newproject-a!493427700 + newproject-a!616510 + recover.txt + 2022-12-05T16:12:20Z + text/plain + SRDNVCKZ - + 0 - 0.4809828996658325 - - HTTP/1.1 200 OK + + HTTP/1.1 200 OK + + + + /remote.php/dav/files/cboxbot/eos/project/a/awesomeproject/test_support.txt + + + newproject-a!420300390 + newproject-a!616510 + test_support.txt + 2022-12-05T16:12:20Z + text/plain + SRDNVCKZ + + + + + 0 + + HTTP/1.1 200 OK + + + + /remote.php/dav/files/cboxbot/eos/project/a/awesomeproject/testing.txt + + + newproject-a!420300167 + newproject-a!616510 + testing.txt + 2022-12-05T16:12:20Z + text/plain + SRDNVCKZ + + + + + 0 + + HTTP/1.1 200 OK + + + + /remote.php/dav/files/cboxbot/eos/project/a/awesomeproject/testing2.txt + + + newproject-a!420300326 + newproject-a!616510 + testing2.txt + 2022-12-05T16:12:20Z + text/plain + SRDNVCKZ + + + + + 0 + + HTTP/1.1 200 OK + + + + /remote.php/dav/files/cboxbot/eos/project/a/awesomeproject/Denied%20Folder/New%20file.txt + + + newproject-a!437033942 + newproject-a!67942728 + New file.txt + 2022-12-05T16:12:20Z + text/plain + SRDNVCKZ + + + + + 0 + + HTTP/1.1 200 OK + + + + /remote.php/dav/files/cboxbot/eos/project/a/awesomeproject/test_versions/test.txt + + + newproject-a!506354963 + newproject-a!73758625 + test.txt + 2022-12-05T16:12:20Z + text/plain + SRDNVCKZ + + + + + 9 + + HTTP/1.1 200 OK - - + + ` w.Write([]byte(data)) w.WriteHeader(207) diff --git a/pkg/eosclient/eosbinary/eosbinary.go b/pkg/eosclient/eosbinary/eosbinary.go index 7f840e5ec03..74ba672b5d8 100644 --- a/pkg/eosclient/eosbinary/eosbinary.go +++ b/pkg/eosclient/eosbinary/eosbinary.go @@ -720,11 +720,11 @@ func (c *Client) List(ctx context.Context, auth eosclient.Authorization, path st // List the contents of the directory given by path with depth infinity func (c *Client) SearchDir(ctx context.Context, auth eosclient.Authorization, searchString string, path string) ([]*eosclient.FileInfo, error) { // TODO(salfagem): path is truncated - i.e. /c/cernbox (not absolute) - args := []string{"newfind", "--fileinfo", "-name", searchString, path} + args := []string{"newfind", "--fileinfo", "--name", searchString, path} log := appctx.GetLogger(ctx) log.Debug().Msgf("eosbinary search with args: %s", args) // Safeguard #2 to prevent the search to go to undesired places: - if !strings.HasPrefix(path, "/eos/project/c/cernbox") { + if !strings.HasPrefix(path, "/eos/project/t/test") { log.Debug().Msgf("eosbinary - prefix doesn't match") return nil, errors.Errorf("eosclient: search path out of bounds fn=%s", path) } @@ -741,9 +741,12 @@ func (c *Client) SearchDir(ctx context.Context, auth eosclient.Authorization, se case errtypes.NotFound, errtypes.PermissionDenied: log.Debug().Msgf("eosbinary - user had insufficient permissions to search part of the directory") default: - return nil, errors.Wrapf(err, "eosclient: error listing fn=%s", path) + log.Error().Msgf("ERRROR LISTING= %s", stdout) + // There will be errors: + //return nil, errors.Wrapf(err, "eosclient: error listing fn=%s", path) } } + log.Debug().Msgf("eos find stdout= %s", stdout) return c.parseFind(ctx, auth, path, stdout) } diff --git a/pkg/storage/utils/eosfs/eosfs.go b/pkg/storage/utils/eosfs/eosfs.go index 53209e50fc6..511626f1c0b 100644 --- a/pkg/storage/utils/eosfs/eosfs.go +++ b/pkg/storage/utils/eosfs/eosfs.go @@ -1336,7 +1336,7 @@ func (fs *eosfs) ListFolder(ctx context.Context, ref *provider.Reference, mdKeys // - also check that searchString not empty: searchString = mdKeys[i+1] - log.Info().Msgf("eosfs: running search: path=%s searchString=%s", p, searchString) + log.Debug().Msgf("eosfs: running search: path=%s searchString=%s", p, searchString) eosFileInfos, err := fs.c.SearchDir(ctx, auth, searchString, p) if err != nil { @@ -1353,6 +1353,7 @@ func (fs *eosfs) ListFolder(ctx context.Context, ref *provider.Reference, mdKeys } if finfo, err := fs.convertToFileReference(ctx, eosFileInfo); err == nil { + log.Debug().Msgf("eosfs: file name from search %s", finfo.Name) finfos = append(finfos, finfo) } }