Skip to content

More rglob/os.walk sites list or digest a directory tree and skip a subdirectory they cannot list #1168

In review

Description

@antonwolfy

Same cause as #1103-#1106 (Path.rglob and an os.walk with no onerror skip a subdirectory that cannot be listed, mode 0o111, as a non-root user, with no error). Reproduced on this branch with a skill directory SKILL.md, references/a.md, references/plugin.json, then chmod 0o111 references:

  • harnesses/harbor_export.py:103 _content_key (the cache key of an exported task): 469980c5ee98f0cc becomes 8ccdac066593d4bb, no error.
  • eval/leakgate.py:73 read_skill (the files the leak gate indexes): ['SKILL.md', 'references/a.md', 'references/plugin.json'] becomes ['SKILL.md'], so a leak in the dropped files is not found.
  • skills/loader.py:186 load_skill resources: ['a.md', 'plugin.json'] becomes [].

Read, same cause, not reproduced with that input: skills/formats.py:261 detect_skill_packages (a manifest in the unlistable directory is missed), repos/conformance.py:140 scenarios_of (a guidance file there yields no scenario), repos/arms.py:151 _uncopyable (os.walk with no onerror, so a link in the unlistable directory is not checked), commands/leak.py:59 (the output-overwrite guard lists a smaller skill), mcp/local_markdown.py:135 and mcp/okf_client.py:209 (doc sources).

Fix: digest_entries.listed_entries (added with #1104) lists what rglob("*") lists and raises the OSError; use it, or an os.walk with an onerror that re-raises, and decide per site whether the error is the right outcome.

Found while fixing #1104. The fix's PR is #1169.

Activity

  1. self-assigned this
    on Nov 23, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

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