(self: Pin<&mut Self>, cx: &mut Context<'_>)
| 440 | type Item = io::Result<UnixStream>; |
| 441 | |
| 442 | fn poll_next(self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll<Option<Self::Item>> { |
| 443 | let this = self.get_mut(); |
| 444 | loop { |
| 445 | match this.listener.poll_accept(cx) { |
| 446 | Poll::Ready(Ok((stream, _addr))) => { |
| 447 | let authorized = peer_credentials(&stream).and_then(|peer| { |
| 448 | authorize_peer_credentials(peer, this.expected_uid, this.expected_peer_pid) |
| 449 | }); |
| 450 | match authorized { |
| 451 | Ok(()) => return Poll::Ready(Some(Ok(stream))), |
| 452 | Err(err) => { |
| 453 | tracing::warn!( |
| 454 | error = %err, |
| 455 | "rejected vm compute driver UDS client" |
| 456 | ); |
| 457 | } |
| 458 | } |
| 459 | } |
| 460 | Poll::Ready(Err(err)) => return Poll::Ready(Some(Err(err))), |
| 461 | Poll::Pending => return Poll::Pending, |
| 462 | } |
| 463 | } |
| 464 | } |
| 465 | } |
| 466 | |
| 467 | fn build_vm_launch_config(args: &Args) -> std::result::Result<VmLaunchConfig, String> { |
nothing calls this directly
no test coverage detected