Skip to content

Commit 1689870

Browse files
mmahroussfda-odoo
authored andcommitted
[IMP] server: canonicalize pattern filled paths
1 parent ff496f1 commit 1689870

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

server/src/core/config.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -639,7 +639,8 @@ F: Fn(&String) -> bool,
639639
let config_dir = config_path.parent().map(PathBuf::from).unwrap_or_else(|| PathBuf::from("."));
640640
if has_template(&sourced_path.value) {
641641
return fill_validate_path(ws_folders, workspace_name, &sourced_path.value, predicate, var_map, &config_dir)
642-
.map(|p| PathBuf::from(p).sanitize())
642+
.and_then(|p| std::fs::canonicalize(PathBuf::from(p)).ok())
643+
.map(|p| p.sanitize())
643644
.map(|path| Sourced { value: path, sources: sourced_path.sources.clone(), ..Default::default()});
644645
}
645646
let mut path = PathBuf::from(&sourced_path.value);

0 commit comments

Comments
 (0)