Disallow open()ing sockets

This commit is contained in:
Mark
2020-07-07 15:58:04 +03:00
parent a6ccddd695
commit 8f1e6fc610
+4
View File
@@ -185,6 +185,10 @@ int vfs_open_vnode(struct vfs_ioctx *ctx, struct ofile *fd, struct vnode *node,
_assert(node);
fd->flags &= ~OF_SOCKET;
if (node->type == VN_SOCK) {
return -ENODEV;
}
if (opt & O_DIRECTORY) {
if (node->type != VN_DIR) {
return -ENOTDIR;