(path: &Path)
| 972 | /// the filesystem. Only works correctly for absolute paths. |
| 973 | #[cfg(any(target_os = "linux", test))] |
| 974 | fn normalize_path(path: &Path) -> PathBuf { |
| 975 | let mut result = PathBuf::new(); |
| 976 | for component in path.components() { |
| 977 | match component { |
| 978 | std::path::Component::ParentDir => { |
| 979 | result.pop(); |
| 980 | } |
| 981 | std::path::Component::CurDir => {} |
| 982 | other => result.push(other), |
| 983 | } |
| 984 | } |
| 985 | result |
| 986 | } |
| 987 | |
| 988 | #[cfg(target_os = "linux")] |
| 989 | fn resolve_binary_in_container(policy_path: &str, entrypoint_pid: u32) -> Option<String> { |
no test coverage detected