(run_id: &str)
| 414 | } |
| 415 | |
| 416 | fn validate_run_id(run_id: &str) -> CliResult<()> { |
| 417 | if run_id.is_empty() |
| 418 | || run_id.contains("..") |
| 419 | || run_id.contains('/') |
| 420 | || run_id.contains('\\') |
| 421 | || run_id.contains('\0') |
| 422 | { |
| 423 | return Err(CliError::InvalidArgument { |
| 424 | message: format!("invalid run id '{}'", run_id), |
| 425 | }); |
| 426 | } |
| 427 | Ok(()) |
| 428 | } |
| 429 | |
| 430 | fn canonicalize_lenient(path: &Path) -> PathBuf { |
| 431 | path.canonicalize().unwrap_or_else(|_| path.to_path_buf()) |
no test coverage detected