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 authored and butonic committed Feb 14, 2022
1 parent 32384aa commit 1aadbc8
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 @@ -544,7 +544,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 @@ -553,7 +553,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 1aadbc8

Please sign in to comment.