mirror of
https://github.com/bitwarden/browser
synced 2026-02-13 06:54:07 +00:00
Update
This commit is contained in:
@@ -11,11 +11,14 @@ use tokio::{
|
||||
};
|
||||
use tokio_util::sync::CancellationToken;
|
||||
|
||||
use super::peerinfo;
|
||||
use super::peerinfo::models::PeerInfo;
|
||||
|
||||
const PIPE_NAME: &str = r"\\.\pipe\openssh-ssh-agent";
|
||||
|
||||
#[pin_project::pin_project]
|
||||
pub struct NamedPipeServerStream {
|
||||
rx: tokio::sync::mpsc::Receiver<NamedPipeServer>,
|
||||
rx: tokio::sync::mpsc::Receiver<(NamedPipeServer, PeerInfo)>,
|
||||
}
|
||||
|
||||
impl NamedPipeServerStream {
|
||||
@@ -48,12 +51,12 @@ impl NamedPipeServerStream {
|
||||
}
|
||||
|
||||
impl Stream for NamedPipeServerStream {
|
||||
type Item = io::Result<NamedPipeServer>;
|
||||
type Item = io::Result<(NamedPipeServer, PeerInfo)>;
|
||||
|
||||
fn poll_next(
|
||||
self: Pin<&mut Self>,
|
||||
cx: &mut Context<'_>,
|
||||
) -> Poll<Option<io::Result<NamedPipeServer>>> {
|
||||
) -> Poll<Option<io::Result<(NamedPipeServer, PeerInfo)>>> {
|
||||
let this = self.project();
|
||||
|
||||
this.rx.poll_recv(cx).map(|v| v.map(Ok))
|
||||
|
||||
@@ -46,13 +46,8 @@ impl Stream for PeercredUnixListenerStream {
|
||||
};
|
||||
let peer_info = peerinfo::gather::get_peer_info(pid as u32);
|
||||
match peer_info {
|
||||
Ok(info) => {
|
||||
println!("name {:?}", info.process_name());
|
||||
println!("uid {:?}", info.uid());
|
||||
Poll::Ready(Some(Ok((stream, info))))
|
||||
}
|
||||
Ok(info) => Poll::Ready(Some(Ok((stream, info)))),
|
||||
Err(err) => {
|
||||
println!("Failed to get peer info: {}", err);
|
||||
Poll::Ready(Some(Err(io::Error::new(
|
||||
io::ErrorKind::Other,
|
||||
format!("Failed to get peer info: {}", err),
|
||||
|
||||
Reference in New Issue
Block a user