Refuse grant paths that cannot be mounted

Implemented-By: OpenCode session (model recorded in docs/implementer-log.md)
This commit is contained in:
2026-09-22 23:06:09 -07:00
parent bf9e79ac21
commit 644fda14da
3 changed files with 54 additions and 0 deletions
+8
View File
@@ -260,6 +260,14 @@ fn check_grant(grant: &LoadedGrant, problems: &mut Vec<GrantProblem>) {
None,
format!("{:?} is not a valid absolute path", path),
);
} else if path.contains([':', ',']) {
// Mounted as `--volume=<path>:<path>:ro`, where both are separators.
push(
problems,
file.clone(),
None,
format!("{:?} cannot be mounted: it contains ':' or ','", path),
);
}
}
// Rule 8: every host must be a valid host pattern.