mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-11-26 09:30:24 +00:00
Kernel: Accept SHUT_RD and SHUT_WR as shutdown() how values
The previous check for valid how values assumed this field was a bitmap and that SHUT_RDWR was simply a bitwise or of SHUT_RD and SHUT_WR, which is not the case.
This commit is contained in:
parent
693d34fe3d
commit
a6f237a247
Notes:
sideshowbarker
2024-07-17 18:49:10 +09:00
Author: https://github.com/IdanHo Commit: https://github.com/SerenityOS/serenity/commit/a6f237a247 Pull-request: https://github.com/SerenityOS/serenity/pull/14533 Reviewed-by: https://github.com/linusg ✅
1 changed files with 1 additions and 1 deletions
|
@ -160,7 +160,7 @@ ErrorOr<FlatPtr> Process::sys$shutdown(int sockfd, int how)
|
|||
{
|
||||
VERIFY_NO_PROCESS_BIG_LOCK(this)
|
||||
TRY(require_promise(Pledge::stdio));
|
||||
if (how & ~SHUT_RDWR)
|
||||
if (how != SHUT_RD && how != SHUT_WR && how != SHUT_RDWR)
|
||||
return EINVAL;
|
||||
auto description = TRY(open_file_description(sockfd));
|
||||
if (!description->is_socket())
|
||||
|
|
Loading…
Reference in a new issue