#1673

[BUG] A repository target ending in '..' derives a parent-directory name and deletes the shared clone directory

Openlxcxjxhxopened 1d ago

A target whose last path segment is .. makes the run derive a directory-only name, and clone_repository resolves it to the shared parent before cloning.

Steps:

  1. strix -n -t 'git@host:..' (or any repository target whose last segment is ..; derive_repo_base_name returns .. for it, sanitize_name keeps dots).
  2. assign_workspace_subdirs stores workspace_subdir = "..", prepare_run passes it as dest_name to clone_repository.
  3. clone_repository builds clone_path = <tmp>/strix_repos/<run_name>/.. - the shared <tmp>/strix_repos - and runs shutil.rmtree(clone_path) when it exists, before the clone that would fail.

So the attempt removes every other run's clone directory under strix_repos, not just its own.

Expected: a name that is only dots is not a name; the derived component stays inside the run's directory (or the target is refused). sanitize_name already maps an empty input to target, so the same treatment for ./.. is consistent.

Found by reading sanitize_name/derive_repo_base_name/clone_repository together; no provider traffic is involved, the input is the user's own target.

Activity

0

No activity yet.