mirror of
https://github.com/Mathewnd/Astral.git
synced 2026-11-01 06:58:22 +00:00
link: call VOP_ACCESS
This commit is contained in:
+5
-2
@@ -375,6 +375,10 @@ int vfs_link(vnode_t *destref, char *destpath, vnode_t *linkref, char *linkpath,
|
|||||||
if (err)
|
if (err)
|
||||||
goto cleanup;
|
goto cleanup;
|
||||||
|
|
||||||
|
err = VOP_ACCESS(parent, V_ACCESS_WRITE, getcred());
|
||||||
|
if (err)
|
||||||
|
goto cleanup;
|
||||||
|
|
||||||
if (type == V_TYPE_REGULAR) {
|
if (type == V_TYPE_REGULAR) {
|
||||||
vnode_t *targetnode = NULL;
|
vnode_t *targetnode = NULL;
|
||||||
err = vfs_lookup(&targetnode, destref, destpath, NULL, 0);
|
err = vfs_lookup(&targetnode, destref, destpath, NULL, 0);
|
||||||
@@ -388,9 +392,8 @@ int vfs_link(vnode_t *destref, char *destpath, vnode_t *linkref, char *linkpath,
|
|||||||
err = VOP_SYMLINK(parent, component, attr, destpath, getcred());
|
err = VOP_SYMLINK(parent, component, attr, destpath, getcred());
|
||||||
}
|
}
|
||||||
|
|
||||||
VOP_RELEASE(parent);
|
|
||||||
|
|
||||||
cleanup:
|
cleanup:
|
||||||
|
VOP_RELEASE(parent);
|
||||||
free(component);
|
free(component);
|
||||||
return err;
|
return err;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user