Skip to main content

Module mount_backend

Module mount_backend 

Source
Expand description

MountBackend — a Backend that exports an in-process VFS [Mount].

This is the server-side adapter used by the UDS 9P listener (#506). It is the local-mount counterpart to the hyprstream crate’s capnp-RPC ModelBackend: both implement the same Backend seam the [Translator] dispatches to, so the accept/serve/fid-table machinery is shared verbatim — only the object behind the Backend differs.

  Wanix (p9kit.ClientFS) ──► UnixListener ──► Translator ──► MountBackend ──► dyn Mount
        9P2000.L wire            UDS            fid table      Subject-scoped     policy PEP

§Subject threading (MAC-load-bearing)

Every [Mount] method takes the verified caller [Subject]. The listener serves exactly one tenant’s export, so the Subject is fixed at construction and threaded onto every op; the served mount remains the single policy enforcement point. There is no path by which a 9P op reaches the mount without the tenant’s Subject.

§Fid mapping

The translator allocates opaque u32 9P fids; a [Mount] hands back opaque [Fid] handles from walk. MountBackend owns the u32 → (path, Fid) mapping. Because a [Mount::walk] resolves a path from the mount root (not relative to a source fid), each fid also remembers its absolute path so a subsequent relative walk can re-resolve parent_path + components.

Re-exports§

pub use crate::mac_seam::AttachAuthenticator as AttachAuthorizer;

Structs§

MountBackend
A Backend backed by a single Subject-scoped VFS [Mount].