When splicing, drop unix fds

This commit is contained in:
Val Packett 2025-07-18 01:59:28 -03:00
parent efae851a9a
commit a321bf9a9a

View file

@ -36,11 +36,24 @@ pub async fn splice_conns(client_conn: zbus::Connection, target_conn: zbus::Conn
let target_bus_1 = target_conn.clone();
tokio::select! {
_ = handle_msgs("FROM", client_conn.clone().into(), async |msg| {
if let Some(n) = msg.header().unix_fds() {
if n > 0 {
let new_msg = crate::rewrite::RewriteMessage::new(&msg).unwrap().build().unwrap();
return target_bus_1.send(&new_msg).await;
}
}
target_bus_1.send(&msg).await
}) => {
info!("from_client exited");
}
_ = handle_msgs("TO", target_conn.into(), async |msg| {
// XXX: simply get rid of unix fds if they appear (they should not be sent in the first place buuut)
if let Some(n) = msg.header().unix_fds() {
if n > 0 {
let new_msg = crate::rewrite::RewriteMessage::new(&msg).unwrap().build().unwrap();
return client_conn.send(&new_msg).await;
}
}
client_conn.send(&msg).await
}) => {
info!("to_client exited");