Skip to content

Commit

Permalink
Fail to open a named socket
Browse files Browse the repository at this point in the history
  • Loading branch information
tbodt committed Jul 14, 2019
1 parent 1e2c1ce commit 19f27ff
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions fs/generic.c
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,9 @@ struct fd *generic_openat(struct fd *at, const char *path_raw, int flags, int mo
return ERR_PTR(err);
}
}
if (S_ISSOCK(fd->type)) {
return ERR_PTR(_ENXIO);
}
if (S_ISDIR(fd->type) && flags & (O_RDWR_ | O_WRONLY_)) {
fd_close(fd);
return ERR_PTR(_EISDIR);
Expand Down

0 comments on commit 19f27ff

Please sign in to comment.