pub async fn canonicalize_allow_missing(normalized: &Path) -> Result<PathBuf>Expand description
Canonicalize a path, walking up to find the nearest existing ancestor for new files.
This function handles paths to files that may not yet exist by finding the nearest existing parent directory, canonicalizing that, and then appending the remaining path components.
§Safety
This function is critical for security. It prevents symlink escapes by:
- Finding the nearest existing ancestor directory
- Canonicalizing that directory (resolves symlinks)
- Appending the remaining path components
§Arguments
normalized- A normalized path (output fromnormalize_path)
§Returns
The canonical path, or the normalized path if no parent exists