Skip to content

Commit

Permalink
namei: Fix mknod
Browse files Browse the repository at this point in the history
Fix mknod. We were accidentally doing the S_BADFMT check wrong.

Signed-off-by: Pedro Falcato <[email protected]>
  • Loading branch information
heatd committed Jun 30, 2024
1 parent 48ec57a commit 715be9f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion kernel/kernel/fs/namei.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -861,7 +861,7 @@ expected<dentry *, int> creat_vfs(dentry *base, const char *path, int mode)

expected<dentry *, int> mknod_vfs(const char *path, mode_t mode, dev_t dev, struct dentry *dir)
{
if (mode & S_IFBAD)
if (mode & S_IFMT & S_IFBAD)
return unexpected<int>{-EINVAL};
return namei_create_generic(dir, path, mode, 0);
}
Expand Down

0 comments on commit 715be9f

Please sign in to comment.