server: Explicitly shutdown closed pipes to prevent access from file descriptors cached in the client.
This commit is contained in:
parent
64ba011dba
commit
bc426ab059
|
@ -282,7 +282,7 @@ NTSTATUS FILE_GetNtStatus(void)
|
|||
case ENFILE: return STATUS_TOO_MANY_OPENED_FILES;
|
||||
case EINVAL: return STATUS_INVALID_PARAMETER;
|
||||
case ENOTEMPTY: return STATUS_DIRECTORY_NOT_EMPTY;
|
||||
case EPIPE: return STATUS_PIPE_BROKEN;
|
||||
case EPIPE: return STATUS_PIPE_DISCONNECTED;
|
||||
case EIO: return STATUS_DEVICE_NOT_READY;
|
||||
#ifdef ENOMEDIUM
|
||||
case ENOMEDIUM: return STATUS_NO_MEDIA_IN_DEVICE;
|
||||
|
|
|
@ -197,6 +197,7 @@ static void mailslot_destroy( struct object *obj)
|
|||
assert( mailslot->fd );
|
||||
assert( mailslot->write_fd );
|
||||
|
||||
shutdown( get_unix_fd( mailslot->fd ), SHUT_RDWR );
|
||||
release_object( mailslot->fd );
|
||||
release_object( mailslot->write_fd );
|
||||
}
|
||||
|
@ -408,6 +409,7 @@ static struct mailslot *create_mailslot( struct directory *root,
|
|||
{
|
||||
fcntl( fds[0], F_SETFL, O_NONBLOCK );
|
||||
fcntl( fds[1], F_SETFL, O_NONBLOCK );
|
||||
shutdown( fds[0], SHUT_RD );
|
||||
mailslot->fd = create_anonymous_fd( &mailslot_fd_ops,
|
||||
fds[1], &mailslot->obj );
|
||||
mailslot->write_fd = create_anonymous_fd( &mail_writer_fd_ops,
|
||||
|
|
|
@ -338,6 +338,7 @@ static void do_disconnect( struct pipe_server *server )
|
|||
server->client->fd = NULL;
|
||||
}
|
||||
assert( server->fd );
|
||||
shutdown( get_unix_fd( server->fd ), SHUT_RDWR );
|
||||
release_object( server->fd );
|
||||
server->fd = NULL;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue