kernel/fs: Add permissions check to rootfs_open.

Missed in the earlier commit which added permissions checks to the
other functions.
This commit is contained in:
Augustin Cavalier
2023-01-25 19:11:33 -05:00
parent 83e06e62ef
commit 3773999f93
+5 -1
View File
@@ -603,7 +603,11 @@ rootfs_open(fs_volume* _volume, fs_vnode* _v, int openMode, void** _cookie)
if ((openMode & O_DIRECTORY) != 0 && !S_ISDIR(vnode->stream.type))
return B_NOT_A_DIRECTORY;
// allow to open the file, but it can't be done anything with it
status_t status = rootfs_check_permissions(vnode, W_OK);
if (status != B_OK)
return status;
// allow to open the file, but nothing can be done with it
*_cookie = NULL;
return B_OK;