diff --git a/internal/http/services/owncloud/ocdav/report.go b/internal/http/services/owncloud/ocdav/report.go index ef82b63e0f1..caf6606fea2 100644 --- a/internal/http/services/owncloud/ocdav/report.go +++ b/internal/http/services/owncloud/ocdav/report.go @@ -27,7 +27,7 @@ import ( rpcv1beta1 "github.com/cs3org/go-cs3apis/cs3/rpc/v1beta1" provider "github.com/cs3org/go-cs3apis/cs3/storage/provider/v1beta1" - typespb "github.com/cs3org/go-cs3apis/cs3/types/v1beta1" + types "github.com/cs3org/go-cs3apis/cs3/types/v1beta1" "github.com/cs3org/reva/pkg/appctx" ctxpkg "github.com/cs3org/reva/pkg/ctx" ) @@ -68,7 +68,7 @@ func (s *svc) doSearchFiles(w http.ResponseWriter, r *http.Request, sf *reportSe ctx := r.Context() log := appctx.GetLogger(ctx) - log.Info().Msgf("hugo: search is: %+v", sf) + log.Info().Msgf("search is: %+v", sf) client, err := s.getClient() if err != nil { @@ -77,7 +77,7 @@ func (s *svc) doSearchFiles(w http.ResponseWriter, r *http.Request, sf *reportSe return } - opaqueMap := map[string]*typespb.OpaqueEntry{ + opaqueMap := map[string]*types.OpaqueEntry{ "search": { Decoder: "plain", Value: []byte("search"), @@ -88,10 +88,10 @@ 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/t/test"} + // TODO(salfagem): hardcoded path for the time being, enable a list: + ref := &provider.Reference{Path: "/eos/project/a/awesomeproject"} - req := &provider.ListContainerRequest{Opaque: &typespb.Opaque{ + req := &provider.ListContainerRequest{Opaque: &types.Opaque{ Map: opaqueMap, }, Ref: ref} diff --git a/pkg/eosclient/eosbinary/eosbinary.go b/pkg/eosclient/eosbinary/eosbinary.go index 74ba672b5d8..31e00ea061e 100644 --- a/pkg/eosclient/eosbinary/eosbinary.go +++ b/pkg/eosclient/eosbinary/eosbinary.go @@ -724,7 +724,7 @@ func (c *Client) SearchDir(ctx context.Context, auth eosclient.Authorization, se 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/t/test") { + if !strings.HasPrefix(path, "/eos/project/a/awesomeproject") { log.Debug().Msgf("eosbinary - prefix doesn't match") return nil, errors.Errorf("eosclient: search path out of bounds fn=%s", path) } @@ -735,18 +735,18 @@ func (c *Client) SearchDir(ctx context.Context, auth eosclient.Authorization, se return nil, errors.Errorf("eosclient: ilegal search string: %s", searchString) } // TODO: set a timeout for the find in case it goes out of hand - stdout, _, err := c.executeEOS(ctx, args, auth) + stdout, stderr, err := c.executeEOS(ctx, args, auth) if err != nil { switch err.(type) { - case errtypes.NotFound, errtypes.PermissionDenied: + case errtypes.IsNotFound, errtypes.IsPermissionDenied: log.Debug().Msgf("eosbinary - user had insufficient permissions to search part of the directory") default: - log.Error().Msgf("ERRROR LISTING= %s", stdout) - // There will be errors: - //return nil, errors.Wrapf(err, "eosclient: error listing fn=%s", path) + // There will be errors; we cannot ignore them: + return nil, errors.Wrapf(err, "eosclient: error listing fn=%s", path) } } log.Debug().Msgf("eos find stdout= %s", stdout) + log.Debug().Msgf("=========== eos find stderr =========== %s", stderr) return c.parseFind(ctx, auth, path, stdout) }