Also check whether the supplied vnode is a directory, if there's only
one path component. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@24736 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
@@ -1811,7 +1811,8 @@ vnode_path_to_vnode(struct vnode *vnode, char *path, bool traverseLeafLink,
|
|||||||
put_vnode(vnode);
|
put_vnode(vnode);
|
||||||
vnode = nextVnode;
|
vnode = nextVnode;
|
||||||
}
|
}
|
||||||
} else if (nextPath[0]) {
|
}
|
||||||
|
|
||||||
// check if vnode is really a directory
|
// check if vnode is really a directory
|
||||||
if (type == 0) {
|
if (type == 0) {
|
||||||
// we need to retrieve the type first
|
// we need to retrieve the type first
|
||||||
@@ -1824,7 +1825,6 @@ vnode_path_to_vnode(struct vnode *vnode, char *path, bool traverseLeafLink,
|
|||||||
|
|
||||||
if (status == B_OK && !S_ISDIR(type))
|
if (status == B_OK && !S_ISDIR(type))
|
||||||
status = B_NOT_A_DIRECTORY;
|
status = B_NOT_A_DIRECTORY;
|
||||||
}
|
|
||||||
|
|
||||||
// Check if we have the right to search the current directory vnode.
|
// Check if we have the right to search the current directory vnode.
|
||||||
// If a file system doesn't have the access() function, we assume that
|
// If a file system doesn't have the access() function, we assume that
|
||||||
|
|||||||
Reference in New Issue
Block a user