mirror of
https://github.com/Mathewnd/Astral.git
synced 2026-10-27 12:48:22 +00:00
fs: misc fixes related to symlinks
This commit is contained in:
@@ -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
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user