mirror of
https://github.com/Mathewnd/Astral.git
synced 2026-11-01 15:08:21 +00:00
vfs: add VOP_ACCESS check to vfs_create
This commit is contained in:
@@ -141,6 +141,12 @@ int vfs_create(vnode_t *ref, char *path, vattr_t *attr, int type, vnode_t **node
|
|||||||
if (err)
|
if (err)
|
||||||
goto cleanup;
|
goto cleanup;
|
||||||
|
|
||||||
|
err = VOP_ACCESS(parent, V_ACCESS_WRITE, getcred());
|
||||||
|
if (err) {
|
||||||
|
VOP_RELEASE(parent);
|
||||||
|
goto cleanup;
|
||||||
|
}
|
||||||
|
|
||||||
vnode_t *ret;
|
vnode_t *ret;
|
||||||
err = VOP_CREATE(parent, component, attr, type, &ret, getcred());
|
err = VOP_CREATE(parent, component, attr, type, &ret, getcred());
|
||||||
VOP_RELEASE(parent);
|
VOP_RELEASE(parent);
|
||||||
|
|||||||
Reference in New Issue
Block a user