fn resolve_policy_path(
root: &Dir,
env_override: Option<&Path>,
xdg_config_home: Option<&Path>,
home: Option<&Path>,
) -> Result<File>Expand description
Resolve the containers policy path using the same load order as the
upstream Go containers/image library, with all lookups relative to root:
CONTAINERS_POLICY_JSONenv var (trusted, no existence check)$XDG_CONFIG_HOME/containers/policy.json(or$HOME/.config/…)/etc/containers/policy.json/usr/share/containers/policy.json
For candidates 2–4 we only return a path when the file exists on disk.
Absolute paths (from env vars) have their leading / stripped so they
resolve under root. Passing root opened on / gives normal behaviour;
tests can pass a cap-std Dir backed by a temporary directory.