vfs: fix permission check when creating files

When creating new files in a directory the creating process
must be allowed to write the directory not to read it.
This commit is contained in:
Florian Fischer
2024-01-28 21:47:50 +01:00
parent c3c2ba824e
commit 4c6cbc3360
+1 -1
View File
@@ -2267,7 +2267,7 @@ static vfs_file_t *ext2_creat(const char *path, mode_t permission)
return NULL;
}
// Get the parent VFS node.
vfs_file_t *parent = vfs_open(parent_path, O_RDONLY, 0);
vfs_file_t *parent = vfs_open(parent_path, O_WRONLY, 0);
if (parent == NULL) {
errno = ENOENT;
return NULL;