Skip to content

Commit

Permalink
prevent nil by disallowing CreateHome in public scope
Browse files Browse the repository at this point in the history
Signed-off-by: Jörn Friedrich Dreyer <jfd@butonic.de>
  • Loading branch information
butonic committed Mar 22, 2022
1 parent 2833e9b commit 20392fb
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion pkg/auth/scope/publicshare.go
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,8 @@ func publicshareScope(ctx context.Context, scope *authpb.Scope, resource interfa
}
}
return checkStorageRef(ctx, &share, ref), nil
case *provider.CreateHomeRequest:
return false, nil
case *provider.GetPathRequest:
return checkStorageRef(ctx, &share, &provider.Reference{ResourceId: v.GetResourceId()}), nil
case *provider.StatRequest:
Expand Down Expand Up @@ -127,7 +129,7 @@ func publicshareScope(ctx context.Context, scope *authpb.Scope, resource interfa
return checkResourcePath(v), nil
}

msg := "resource type assertion failed"
msg := "public resource type assertion failed"
logger.Debug().Str("scope", "publicshareScope").Interface("resource", resource).Msg(msg)
return false, errtypes.InternalError(msg)
}
Expand Down

0 comments on commit 20392fb

Please sign in to comment.