From 4820f8ca4d95bee8b62fc074d742c2fb71c5a7c1 Mon Sep 17 00:00:00 2001 From: Giuseppe Lo Presti Date: Thu, 28 Nov 2024 09:57:16 +0100 Subject: [PATCH] Revert "Fixed bug where uploads fail due to using cbox as the account used for Statting. Instead we use the user now" A different solution is being developed. This reverts commit a78f77b5c1b12fa845d3334f5e44d7999ac3885d. --- changelog/unreleased/fix-failing-stat.md | 5 ----- pkg/storage/utils/eosfs/eosfs.go | 9 +++++---- 2 files changed, 5 insertions(+), 9 deletions(-) delete mode 100644 changelog/unreleased/fix-failing-stat.md diff --git a/changelog/unreleased/fix-failing-stat.md b/changelog/unreleased/fix-failing-stat.md deleted file mode 100644 index fbacb5c428..0000000000 --- a/changelog/unreleased/fix-failing-stat.md +++ /dev/null @@ -1,5 +0,0 @@ -Bugfix: make uploads over gRPC work - -Uploads would return a 500 error, even though they succeeded, due to a failed Stat after an upload. The Stat failed because it was executed as cbox, which no longer has access to user files. This is fixed by using the user's auth now instead. - -https://github.com/cs3org/reva/pull/4969 \ No newline at end of file diff --git a/pkg/storage/utils/eosfs/eosfs.go b/pkg/storage/utils/eosfs/eosfs.go index d4af33fd2b..d231224756 100644 --- a/pkg/storage/utils/eosfs/eosfs.go +++ b/pkg/storage/utils/eosfs/eosfs.go @@ -1233,14 +1233,12 @@ func (fs *eosfs) GetMD(ctx context.Context, ref *provider.Reference, mdKeys []st log := appctx.GetLogger(ctx) log.Info().Msg("eosfs: get md for ref:" + ref.String()) - u, err := getUser(ctx) + _, err := getUser(ctx) if err != nil { return nil, err } - p := ref.Path - fn := fs.wrap(ctx, p) - auth, err := fs.getUserAuth(ctx, u, fn) + auth, err := fs.getRootAuth(ctx) if err != nil { return nil, err } @@ -1265,6 +1263,8 @@ func (fs *eosfs) GetMD(ctx context.Context, ref *provider.Reference, mdKeys []st return fs.convertToResourceInfo(ctx, eosFileInfo) } + p := ref.Path + // if path is home we need to add in the response any shadow folder in the shadow homedirectory. if fs.conf.EnableHome { if fs.isShareFolder(ctx, p) { @@ -1272,6 +1272,7 @@ func (fs *eosfs) GetMD(ctx context.Context, ref *provider.Reference, mdKeys []st } } + fn := fs.wrap(ctx, p) eosFileInfo, err := fs.c.GetFileInfoByPath(ctx, auth, fn) if err != nil { return nil, err