Skip to content

Commit

Permalink
[tests-only] Fix panic in storageSpaceFromNode (#2504)
Browse files Browse the repository at this point in the history
* fix panic in storageSpaceFromNode

Signed-off-by: jkoberg <jkoberg@owncloud.com>

* check node for being nil

Signed-off-by: jkoberg <jkoberg@owncloud.com>

* Revert "check node for being nil"

This reverts commit e38228e.
  • Loading branch information
kobergj committed Feb 4, 2022
1 parent 6f3572e commit d6a8f9b
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions pkg/storage/utils/decomposedfs/spaces.go
Original file line number Diff line number Diff line change
Expand Up @@ -538,7 +538,7 @@ func (fs *Decomposedfs) storageSpaceFromNode(ctx context.Context, n *node.Node,
return p.Stat
})
if err != nil || !ok {
return nil, errtypes.PermissionDenied(fmt.Sprintf("user %s is not allowed to Stat the space %s", user.Username, n.SpaceRoot.ID))
return nil, errtypes.PermissionDenied(fmt.Sprintf("user %s is not allowed to Stat the space %s", user.Username, n.ID))
}

if strings.Contains(n.Name, node.TrashIDDelimiter) {
Expand All @@ -547,7 +547,7 @@ func (fs *Decomposedfs) storageSpaceFromNode(ctx context.Context, n *node.Node,
return p.AddGrant
})
if err != nil || !ok {
return nil, errtypes.PermissionDenied(fmt.Sprintf("user %s is not allowed to list deleted spaces %s", user.Username, n.SpaceRoot.ID))
return nil, errtypes.PermissionDenied(fmt.Sprintf("user %s is not allowed to list deleted spaces %s", user.Username, n.ID))
}
}
}
Expand Down

0 comments on commit d6a8f9b

Please sign in to comment.