pub fn normalize_path(
path: &str,
path_type: SupportedPathType,
) -> MicrosandboxUtilsResult<String>
Expand description
Normalizes a path string for volume mount comparison.
Rules:
- Resolves . and .. components where possible
- Prevents path traversal that would escape the root
- Removes redundant separators and trailing slashes
- Case-sensitive comparison (Unix standard)
- Can enforce path type requirements (absolute, relative, or any)
§Arguments
path
- The path to normalizepath_type
- The required path type (absolute, relative, or any)
§Returns
An error if the path is invalid, would escape root, or doesn’t meet path type requirement