fs: misc fixes related to symlinks

This commit is contained in:
Matheus
2023-07-05 00:07:43 -03:00
parent 3910646494
commit d4813dc277
2 changed files with 4 additions and 2 deletions
+2
View File
@@ -361,6 +361,8 @@ static int tmpfs_symlink(vnode_t *node, char *name, vattr_t *attr, char *path, c
if (pathbuf == NULL)
return ENOMEM;
strcpy(pathbuf, path);
vnode_t *linknode = NULL;
int err = tmpfs_create(node, name, attr, V_TYPE_LINK, &linknode, cred);
+2 -2
View File
@@ -153,7 +153,7 @@ int vfs_link(vnode_t *destref, char *destpath, vnode_t *linkref, char *linkpath,
err = VOP_LINK(targetnode, parent, component, getcred());
VOP_RELEASE(targetnode);
} else {
err = VOP_SYMLINK(parent, component, attr, linkpath, getcred());
err = VOP_SYMLINK(parent, component, attr, destpath, getcred());
}
VOP_RELEASE(parent);
@@ -319,7 +319,7 @@ int vfs_lookup(vnode_t **result, vnode_t *start, char *path, char *lastcomp, int
vnode_t *derefresult = NULL;
// get the start node of the dereference
vnode_t *derefstart = next;
vnode_t *derefstart = current;
if (*linkderef == '/' && _cpu()->thread && _cpu()->thread->proc) {
spinlock_acquire(&_cpu()->thread->proc->lock);