Skip to content

Commit

Permalink
Bugfix: we always do stat as daemon
Browse files Browse the repository at this point in the history
  • Loading branch information
Jesse Geens committed Dec 2, 2024
1 parent 4afdc73 commit 929b48b
Showing 1 changed file with 1 addition and 14 deletions.
15 changes: 1 addition & 14 deletions pkg/storage/utils/eosfs/eosfs.go
Original file line number Diff line number Diff line change
Expand Up @@ -1199,26 +1199,13 @@ 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)
if err != nil {
return nil, err
}

p := ref.Path
fn := fs.wrap(ctx, p)

// We use daemon for auth because we need access to the file in order to stat it
// We cannot use the current user, because the file may be a shared file
// and lightweight accounts don't have a uid
var auth eosclient.Authorization
if utils.IsLightweightUser(u) {
auth = utils.GetDaemonAuth()
} else {
auth, err = fs.getUserAuth(ctx, u, fn)
}
if err != nil {
return nil, err
}
auth := utils.GetDaemonAuth()

if ref.ResourceId != nil {
fid, err := strconv.ParseUint(ref.ResourceId.OpaqueId, 10, 64)
Expand Down

0 comments on commit 929b48b

Please sign in to comment.