(run_id: &str)
| 665 | } |
| 666 | |
| 667 | fn validate_run_id(run_id: &str) -> CliResult<()> { |
| 668 | if run_id.is_empty() |
| 669 | || run_id.contains("..") |
| 670 | || run_id.contains('/') |
| 671 | || run_id.contains('\\') |
| 672 | || run_id.contains('\0') |
| 673 | { |
| 674 | return Err(CliError::InvalidArgument { |
| 675 | message: format!("invalid run id '{}'", run_id), |
| 676 | }); |
| 677 | } |
| 678 | Ok(()) |
| 679 | } |
| 680 | |
| 681 | fn canonicalize_lenient(path: &Path) -> PathBuf { |
| 682 | path.canonicalize().unwrap_or_else(|_| path.to_path_buf()) |
no test coverage detected