Skip to content

Resolve the remaining #5 review items: ACL mirroring reframe, realpath grants, mount resync, real FUSE mount tests - #7

Open
Krokz wants to merge 9 commits into
mainfrom
dev
Open

Krokz wants to merge 9 commits into
mainfrom
dev

Conversation

@Krokz

@Krokz Krokz commented Sep 29, 2026

Copy link
Copy Markdown
Owner

Resolves the items left open from the #5 review after #4, plus one CI fix. Closes #5.

Issue #5 items

  • 1. ACL mirroring: kept, but documented as a visibility aid only. WSL reaches NTFS as the Windows user who launched it, whatever the Linux uid, so a wsl_<uid> ACE never changes what WSL can do. acl-cleanup gains --dry-run and now tells the truth about what happened:

    • it used to print "complete" even when it couldn't list the accounts;
    • it removed them with -ErrorAction SilentlyContinue, which exits 0 on failure;
    • a missing powershell.exe produced a traceback.

    It now lists each account it removed, or would remove, and exits non-zero on any failure. The docs also showed ugow allow --mirror-acl, which argparse rejects; the flag goes before the subcommand.

  • 3. Path normalization: allow, deny, check and status resolve paths with realpath. The kernel follows a symlink before the shim or an LSM hook sees the path, so a grant stored under the link itself never matched in FUSE or kmod mode. A leaf that doesn't exist yet is kept as typed, a note is printed when the resolved path differs from what was typed, and deny also removes grants stored unresolved by older versions. Tests cover .. at both the store and the CLI level.

  • 4. BPF grants across remounts: ugow mount now reloads the BPF grant map after registering a drive. It exits non-zero if the reload fails, because the drive is enforced by then and its grants may be refused.

  • 5. Root in BPF mode: documented how each backend treats a container running as root (the README's Docker section and the BPF docs). No code change.

  • 6. End-to-end FUSE test: tests/test_fuse_mount.py mounts the real shim as root, the way the systemd unit does, and acts on it as an ordinary user. It covers reads, writes, creates, chmod by the owner, hard links, renames, ownership of created entries and the denial log, all through the kernel. It skips without Linux, /dev/fuse or passwordless sudo; CI sets UGOW_FUSE_TESTS=require so a missing prerequisite fails there instead.

  • 7. Smaller items:

    • Files, directories and symlinks created through the shim now belong to the caller's real uid/gid instead of root.
    • Requirements are pinned exactly, with Dependabot (targeting dev) keeping them and the Actions versions current. The docs build dependencies move into requirements-docs.txt, with MkDocs held below 2.0.
    • The FUSE docs state that mode bits never change enforcement.

CI

  • Kernel backends runs on main/dev no longer cancel each other; only superseded pull request runs are cancelled.

Testing

185 tests pass on Python 3.10–3.13, up from 149, including the 11 real-mount tests, which ran rather than skipped. The docs build with --strict.

🤖 Generated with Claude Code

Krokz and others added 9 commits September 29, 2026 22:27
…er; only superseded pull request runs are cancelled

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
…hem and the Actions versions current

The docs build dependencies move into requirements-docs.txt so Dependabot
tracks them too; MkDocs stays below 2.0, which drops the theme overrides the
site uses.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
…backend treats containers running as root

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
…un, and made cleanup report failures

WSL reaches NTFS as the launching Windows user whatever the Linux uid, so the
mirrored wsl_<uid> ACEs never change what WSL can do; the docs now say so.

acl-cleanup printed "complete" even when it could not list the accounts, and
removed them with -ErrorAction SilentlyContinue, which exits 0 on failure. It
now prints each account it removed (or would, with --dry-run), exits non-zero
on any failure, and reports a missing powershell.exe instead of a traceback.

The docs also showed `ugow allow --mirror-acl`, which argparse rejects: the
flag belongs to ugow itself and goes before the subcommand.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
…ode-keyed grants can go stale across a remount

A failed reload exits non-zero: the drive is enforced by then, and its grants
may be refused until ugow sync succeeds.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
…match what the backends enforce

The kernel follows a symlink before the FUSE shim or an LSM hook sees the
path, so a grant stored under the link itself never matched in FUSE or kmod
mode. allow, deny, check and status now resolve the path (non-strictly, so a
not-yet-existing leaf is kept) and print a note when it differs from what was
typed. deny also removes a grant stored unresolved by an older version, and
the kmod key is resolved for grants replayed by sync.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
… their creator instead of root

The shim runs as root, so everything it created was root-owned and the
creator could not chmod its own files. New entries now take the caller's real
uid and gid (not the launcher remap); an existing file opened with O_CREAT
keeps its owner, and a failed chown is logged rather than failing an
operation whose entry already exists.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
…on it as an ordinary user

The existing shim tests call its methods with a mocked FUSE context, so the
kernel's path walk, default_permissions and allow_other never took part.
These mount it the way the systemd unit does and check reads, writes,
creates, chmod, hard links, renames, ownership of created entries and the
denial log through the kernel. They skip without Linux, /dev/fuse or
passwordless sudo; CI sets UGOW_FUSE_TESTS=require so a missing prerequisite
fails there instead.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
…he version CI tests

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Review: ACL mirroring semantics, test CI, path normalization, BPF grant stability

1 participant