fix: Zero op new dir dies. (#2122)

This commit is contained in:
J M
2023-01-17 09:53:42 -07:00
committed by Aiden McClelland
parent b42abbd4a2
commit 212e94756b
3 changed files with 69 additions and 4 deletions

View File

@@ -832,11 +832,9 @@ mod fns {
bail!("Volume {} is readonly", volume_id);
}
let new_file = volume_path.join(path_in);
let parent_new_file = new_file
.parent()
.ok_or_else(|| anyhow!("Expecting that file is not root"))?;
// With the volume check
if !is_subset(&volume_path, &parent_new_file).await? {
if !is_subset(&volume_path, &new_file).await? {
bail!(
"Path '{}' has broken away from parent '{}'",
new_file.to_string_lossy(),