move to anther profile

This commit is contained in:
Mateusz Gruszczyński
2026-06-20 17:01:48 +02:00
parent e6733d6a27
commit fc03b7755b
12 changed files with 201 additions and 14 deletions
+3 -1
View File
@@ -578,7 +578,9 @@ def _profile_transfer_payload(source_profile: dict, data: dict, *, require_hashe
target_path = _clean_remote_transfer_path(requested_target_path or default_target_path)
inside_allowed_root = bool(roots and any(_path_inside_root(target_path, root) for root in roots))
if not inside_allowed_root:
# Note: A metadata-only profile transfer does not require source-user write access, but it still uses a safe target default.
# Note: A chosen target path must stay inside the target profile roots even for metadata-only transfers.
if requested_target_path:
raise ValueError("Target path is outside the target profile download roots")
target_path = default_target_path
inside_allowed_root = bool(roots and any(_path_inside_root(target_path, root) for root in roots))