Skip to content

Commit

Permalink
Disallow moves between shares, even if they resolve to the same space.
Browse files Browse the repository at this point in the history
  • Loading branch information
aduffeck committed Nov 6, 2023
1 parent d3831fd commit bb1c887
Showing 1 changed file with 6 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -591,6 +591,12 @@ func (s *service) Move(ctx context.Context, req *provider.MoveRequest) (*provide
Interface("destination", req.Destination).
Msg("sharesstorageprovider: Got Move request")

if !utils.ResourceIDEqual(req.Source.ResourceId, req.Destination.ResourceId) {
return &provider.MoveResponse{
Status: status.NewUnimplemented(ctx, nil, "sharesstorageprovider: can not move between shares"),
}, nil
}

// TODO moving inside a shared tree should just be a forward of the move
// but when do we rename a mounted share? Does that request even hit us?
// - the registry needs to invalidate the alias
Expand Down Expand Up @@ -643,11 +649,6 @@ func (s *service) Move(ctx context.Context, req *provider.MoveRequest) (*provide
Status: rpcStatus,
}, nil
}
if srcReceivedShare.Share.ResourceId.SpaceId != dstReceivedShare.Share.ResourceId.SpaceId {
return &provider.MoveResponse{
Status: status.NewInvalid(ctx, "sharesstorageprovider: can not move between shares on different storages"),
}, nil
}

gatewayClient, err := s.gatewaySelector.Next()
if err != nil {
Expand Down

0 comments on commit bb1c887

Please sign in to comment.