1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
//! Filesystem-change attribution: *which agent* created or last
//! modified each path.
//!
//! ## Disabled — every lookup returns empty
//!
//! The original design ran a process-global **fanotify** watch
//! (`FAN_MARK_FILESYSTEM` + pid reporting) and correlated each write's
//! pid to a bash exec's process group. Empirical probes (2026-07-15,
//! WSL2 6.18 / podman 5.8.4) proved it can never arm in a laboratory
//! container:
//!
//! - **Rootless** (the real environment): the kernel's unprivileged-
//! fanotify policy ignores namespaced capabilities — `--cap-add
//! SYS_ADMIN` or not, `fanotify_init` with pid reporting is `EPERM`
//! and filesystem/mount marks are `ENOTSUP` (only per-inode marks,
//! which are inotify with extra steps).
//! - **Rootful**: the capability gate opens, but FID-mode filesystem
//! marks need exportfs file-handle encoding, which overlayfs (without
//! `nfs_export=on`) and 9p mounts both lack — `ENOTSUP` on every
//! superblock in play. And dirent events (`FAN_CREATE` et al.)
//! require an FID-mode group, which a pid-reporting fd-mode group is
//! not.
//!
//! The `--cap-add SYS_ADMIN` grant that existed solely for this was
//! stripped from the host's `podman create` at the same time: it
//! excluded managed-cloud platforms (Kubernetes baseline/restricted
//! PSA, Fargate, Cloud Run all refuse it) while buying nothing.
//!
//! The API and the bash-exec process-group registration below remain:
//! every writer in the container is a descendant of one of our bash
//! execs, so a future capability-free correlation (e.g. stamping at
//! the exec layer) plugs back in without touching call sites. Until
//! then `created_by`/`modified_by` are simply absent, never wrong.
use Path;
/// One path's attribution. Absent fields mean "unknown" — currently
/// always (see the module docs).
/// Register a bash exec's process group under the calling agent's AIH.
/// Inert today; the registration point a future capability-free
/// attribution will correlate through.
/// Drop a finished exec's process group. Inert today.
/// The attribution recorded for `path`. Currently always empty (see
/// the module docs).