Bug#1155351: bustle: please port to zbus 6
Antonio Cotos
acf981 at protonmail.com
Sun Nov 29 01:41:10 GMT 2026
Hi,
Attached is an incremental patch on top of Simon’s debdiff, fixing UNIX_FDS handling in monitor.rs for both PCAP loading and live monitoring.
Test in unstable:
sbuild and Lintian pass.
12 Cargo and 3 Meson tests pass.
PCAP loading, live monitoring and save/reload tests pass.
No FD leaks observed during stress testing.
Test results are available if needed.
Thanks!
Antonio.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://alioth-lists.debian.net/pipermail/pkg-gnome-maintainers/attachments/20261129/b99ca68b/attachment.htm>
-------------- next part --------------
diff -Nru bustle-0.14.0/debian/patches/series bustle-0.14.0/debian/patches/series
--- bustle-0.14.0/debian/patches/series 2026-11-28 17:30:41.000000000 +0000
+++ bustle-0.14.0/debian/patches/series 2026-11-28 17:30:41.000000000 +0000
@@ -2,3 +2,4 @@
relax-deps.patch
disable-clippy.patch
zbus-6.patch
+zbus-6-unix-fds.patch
diff -Nru bustle-0.14.0/debian/patches/zbus-6-unix-fds.patch bustle-0.14.0/debian/patches/zbus-6-unix-fds.patch
--- bustle-0.14.0/debian/patches/zbus-6-unix-fds.patch 1970-01-01 00:00:00.000000000 +0000
+++ bustle-0.14.0/debian/patches/zbus-6-unix-fds.patch 2026-11-28 17:30:41.000000000 +0000
@@ -0,0 +1,73 @@
+Description: Fix UNIX_FDS handling with zbus 6.
+ zbus 6 rejects messages with missing file descriptors.
+ Use borrowed placeholder descriptors for captured messages,
+ up to the limit of 1024.
+Author: Antonio Cotos <acf981 at protonmail.com>
+Origin: vendor
+Forwarded: no
+Bug-Debian: https://bugs.debian.org/1155351
+Last-Update: 2026-11-29
+---
+ src/monitor.rs | 40 ++++++++++++++++++++++++++++++++++++++--
+ 1 file changed, 38 insertions(+), 2 deletions(-)
+
+--- a/src/monitor.rs
++++ b/src/monitor.rs
+@@ -1,4 +1,12 @@
+-use std::{ffi::OsStr, fmt, path::Path, process::Stdio, sync::LazyLock};
++use std::{
++ ffi::OsStr,
++ fmt,
++ fs::File,
++ os::fd::{AsFd, BorrowedFd},
++ path::Path,
++ process::Stdio,
++ sync::{LazyLock, OnceLock},
++};
+
+ use anyhow::{Context, Result, anyhow};
+ use futures_util::StreamExt;
+@@ -17,6 +25,18 @@ use crate::{ConnectionType, RUNTIME, tim
+ static IS_RUNNING_IN_FLATPAK: LazyLock<bool> =
+ LazyLock::new(|| Path::new("/.flatpak-info").exists());
+
++static PLACEHOLDER_FD: OnceLock<File> = OnceLock::new();
++
++const MAX_UNIX_FDS: u32 = 1024;
++
++fn placeholder_fd() -> std::io::Result<BorrowedFd<'static>> {
++ if let Some(file) = PLACEHOLDER_FD.get() {
++ return Ok(file.as_fd());
++ }
++ let file = File::open("/dev/null")?;
++ Ok(PLACEHOLDER_FD.get_or_init(|| file).as_fd())
++}
++
+ pub struct Event {
+ pub message: zbus::Message,
+ pub timestamp: Timestamp,
+@@ -29,7 +49,23 @@ impl Event {
+
+ pub fn from_bytes(bytes: Vec<u8>, timestamp: Timestamp) -> Result<Self> {
+ let ctx = zvariant::serialized::Context::new_dbus(zvariant::LE, 0);
+- let data = zvariant::serialized::Data::new(bytes, ctx);
++ let unix_fds = zvariant::serialized::Data::new(&bytes[..], ctx)
++ .deserialize::<zbus::message::Header<'_>>()
++ .ok()
++ .and_then(|(header, _)| header.unix_fds())
++ .filter(|n| *n <= MAX_UNIX_FDS)
++ .unwrap_or(0);
++ let data = if unix_fds == 0 {
++ zvariant::serialized::Data::new(bytes, ctx)
++ } else {
++ let placeholder =
++ placeholder_fd().context("Failed to open placeholder file descriptor")?;
++ zvariant::serialized::Data::new_borrowed_fds(
++ bytes,
++ ctx,
++ std::iter::repeat_n(placeholder, unix_fds as usize),
++ )
++ };
+ let message =
+ unsafe { zbus::Message::from_bytes(data).context("Failed to parse message")? };
+ Ok(Self { message, timestamp })
More information about the pkg-gnome-maintainers
mailing list