pub fn sanitize_existing_path(path: &str) -> Result<PathBuf>Expand description
Sanitize and validate a user-provided path.
This function:
- Expands tilde (~) to home directory
- Checks for path traversal sequences
- Canonicalizes the path (requires it to exist)
- Validates the path is under an allowed base directory
Returns the sanitized, canonicalized path.