fs: check access for unlinkat()
This commit is contained in:
@@ -341,6 +341,12 @@ int vfs_unlinkat(struct vfs_ioctx *ctx, struct vnode *at, const char *pathname,
|
||||
}
|
||||
}
|
||||
|
||||
_assert(node->parent != NULL);
|
||||
// Must have write access to remove entries
|
||||
if ((res = vfs_access_node(ctx, node->parent, W_OK)) != 0) {
|
||||
return res;
|
||||
}
|
||||
|
||||
if ((res = node->op->unlink(node)) != 0) {
|
||||
return res;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user