kernel/fs: vnode_path_to_vnode(): check directory on trailing slash
fix #14352 Change-Id: I2fb7f0f455f46f0b5b2fe0eb487896f41b33a44b Reviewed-on: https://review.haiku-os.org/c/haiku/+/9335 Reviewed-by: waddlesplash <[email protected]> Tested-by: Commit checker robot <[email protected]>
This commit is contained in:
committed by
waddlesplash
parent
23f923bcaf
commit
5ac839cb94
@@ -2303,6 +2303,10 @@ vnode_path_to_vnode(struct vnode* start, char* path, bool traverseLeafLink,
|
||||
lastParentID = vnode->id;
|
||||
}
|
||||
|
||||
// if next path component is empty, check next vnode is actually a directory
|
||||
if (directoryFound && *nextPath == '\0' && !S_ISDIR(nextVnode->Type()))
|
||||
return B_NOT_A_DIRECTORY;
|
||||
|
||||
// decrease the ref count on the old dir we just looked up into
|
||||
vnode.Unset();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user