(path: &Path, description: &str)
| 3390 | } |
| 3391 | |
| 3392 | fn canonicalize_existing_file(path: &Path, description: &str) -> CoreResult<PathBuf> { |
| 3393 | if !path.is_file() { |
| 3394 | return Err(Error::config(format!( |
| 3395 | "{description} '{}' does not exist or is not a file", |
| 3396 | path.display() |
| 3397 | ))); |
| 3398 | } |
| 3399 | std::fs::canonicalize(path).map_err(|err| { |
| 3400 | Error::config(format!( |
| 3401 | "failed to resolve {description} '{}': {err}", |
| 3402 | path.display() |
| 3403 | )) |
| 3404 | }) |
| 3405 | } |
| 3406 | |
| 3407 | pub(crate) fn validate_linux_elf_binary(path: &Path) -> CoreResult<()> { |
| 3408 | let mut file = std::fs::File::open(path).map_err(|err| { |
no test coverage detected