diff --git a/fs/vfs_ops.c b/fs/vfs_ops.c index f1bd35f..4d1cdb3 100644 --- a/fs/vfs_ops.c +++ b/fs/vfs_ops.c @@ -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; }