Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed uploads that fail due to removing cbox account from ACL #4969

Merged
merged 1 commit into from
Nov 25, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions changelog/unreleased/fix-failing-stat.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
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
9 changes: 4 additions & 5 deletions pkg/storage/utils/eosfs/eosfs.go
Original file line number Diff line number Diff line change
Expand Up @@ -1232,12 +1232,14 @@ 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())

_, err := getUser(ctx)
u, err := getUser(ctx)
if err != nil {
return nil, err
}

auth, err := fs.getRootAuth(ctx)
p := ref.Path
fn := fs.wrap(ctx, p)
auth, err := fs.getUserAuth(ctx, u, fn)
if err != nil {
return nil, err
}
Expand All @@ -1262,16 +1264,13 @@ 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) {
return fs.getMDShareFolder(ctx, p, mdKeys)
}
}

fn := fs.wrap(ctx, p)
eosFileInfo, err := fs.c.GetFileInfoByPath(ctx, auth, fn)
if err != nil {
return nil, err
Expand Down
Loading