vfs: on vfs_lookup, return ENOENT if pathlen is 0 and we are looking for the parent

This commit is contained in:
Matheus
2024-04-20 10:28:10 -03:00
parent c9d79f69c6
commit 2b917c539d
+4 -1
View File
@@ -230,7 +230,10 @@ int vfs_lookup(vnode_t **result, vnode_t *start, char *path, char *lastcomp, int
size_t pathlen = strlen(path);
if (pathlen == 0) {
__assert((flags & VFS_LOOKUP_PARENT) == 0);
if (flags & VFS_LOOKUP_PARENT) {
return ENOENT;
}
vnode_t *r = start;
int e = highestnodeinmp(start, &r);
if (e)