Skip to content

fork-ci pinned: follow-ups from #305's lenses (cache race, import check spellings, private() vs bootstrap, tests) #314

Closed

Description

@scuttletoby

Follow-ups from the two lenses on #305 (security #305 (comment), state #305 (comment)). Both SAFE; all minor.

  1. Two first runs at once: README block checks existence then makedirs without exist_ok; parallel first runs fail with FileExistsError (state lens: 344/1600 in a probe), which adapters report as "no network". Catch FileExistsError, then run the same check; test it.
  2. Import check spellings (pinned.py neighbour_loads): misses import sys as s; s.path..., getattr(sys,'path'), sys.modules['sys'].path, from sys import path_hooks/*, sys.meta_path, site.addsitedir, __import__('importlib'), builtins.__import__, exec(open(...)), subprocess of a neighbour, chdir + import, data files via __file__. No fork-ci module that passes uses these today. Suggested: copy into a nested private folder (run_dir/<action>/<name>) so .. stays private; and/or refuse bare __file__ and add site.
  3. pinned.private() vs the bootstrap: it follows a symlinked cache and chmods our own 0775 folder to 0700 instead of refusing, so pinned.py --cache C run ... accepts a folder load_pinned refuses. Make it the same rule.
  4. Tests: nothing covers removing S_ISDIR (a regular file at the cache path, refused with no fetch); the '*' case and the pkgutil/imp/zipimport rows; the 0700 assertion only bites under some umasks.
  5. Docs: README line about refused modules should also list test_select.py and trace_check.py; mention the run temp folder risk ($TMPDIR/pr-queue) the PR closed, not only the cache.
  6. Info: only the last path part is checked (parent folders made 0775 under umask 002 could let a group member swap the folder after the check; nothing unchecked runs); Windows junctions pass S_ISDIR.

Activity

  1. added a commit that references this issue on Nov 17, 2026
  2. added 5 commits that reference this issue on Nov 18, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions