From nobody Thu May 2 21:55:31 2024 X-Original-To: dev-commits-ports-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4VVnmh1Bfcz5K6vJ; Thu, 2 May 2024 21:55:32 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4VVnmh0fzzz4BGS; Thu, 2 May 2024 21:55:32 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1714686932; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=R5JTzkQy1529U4V+VZ4pPRcv37+c1bTqv1Dgx1IVVoU=; b=ccRjbd016Qk7zElFsG7ee0E3nj01FV0w1r1cEiFhSgpYl4aoHuw8al5IQulqeQIK3HXbUQ qLTne5R/+uJYjA7vb4VHHgRpxY+MHGqV0QtedNo/8cvQMAnFk1pH5qxzAgtaUY6ShuhtpM MLq/4SEippyW4aNw7DYY1V5Ic2M0UrMXUMC8lDdn9GKVBqN8XkwI47s/q/eH0rHeaYwkrX V9Bf4nUaSCFeIocswIPSJYC4+5xwM+Q9paAdncrkkPGkZ7QFH/Q4i/8Bbffjy8rHSDStw8 yCpt8ZT3c8Wudh02OcalmlzsNMjVXJ5vV/0clnqIS94lfavQMUZMGYq3qYX2oQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1714686932; a=rsa-sha256; cv=none; b=AKuRDus+z6likvIkpfY8E6ObPgnUo4R7c8nGtCCi26cm/svaXA6UvTUJJaxA2ipDiroFdV 8H0GyQIlHtaFAxFpCKIaf+Q3f+gJPCSWcoZXqmOK17mHT3/bV7+t7wk9t8B4huJfd2Uue8 nK/hT4rsXs5q6++o7kUZBlDX47dRCXc9M7lGhqZC/FoL+ymeuFWtNvbF7nOEOK7ke8nQOY zbbxxDtDwOsstBj0BmqCrYQTk3ASIznDg4KQMSKLPv/kA49tVoM3NVUqguYXlpjF8wMMUy Rw0mVbBndqfvGPEtw4PBwEfwzwFPJhFN3J3KESoR1998hfydwXSjHmu5wGBPCA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1714686932; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=R5JTzkQy1529U4V+VZ4pPRcv37+c1bTqv1Dgx1IVVoU=; b=Poh1DMFut6bREd/bODLV5C/8FTqftLA7zbnTyi4+gGFqnng/5j5tkjZ1Vif3SCNHTN9bRF ypy8tTyS6zyTbzvw9e4T9zuamO8IsLXRvcs6s+HL1QrB+lZ9045+gPE8TZTDfnMWOj+acy eDGroXYZz77aYZp3ejZzhfjpLJSdvDGj7h5MOdShH6iJo914DGNjTDrIgAAoeSqe9tYsh0 dnPZMFPHUt+QZuHXayedJuEtlR6xJAUNg72oGDZ4J+67XNOyTTROfF2u7zDEqO4vRTKKAQ XJVlH+bShA701/7YJf1tDr1AWHBrdaX5Uv21cNDVXApBn6SmQtFFc+HlnXT0yw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4VVnmh0G0mzKB4; Thu, 2 May 2024 21:55:32 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 442LtVH5041677; Thu, 2 May 2024 21:55:31 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 442LtVbS041674; Thu, 2 May 2024 21:55:31 GMT (envelope-from git) Date: Thu, 2 May 2024 21:55:31 GMT Message-Id: <202405022155.442LtVbS041674@gitrepo.freebsd.org> To: ports-committers@FreeBSD.org, dev-commits-ports-all@FreeBSD.org, dev-commits-ports-main@FreeBSD.org From: Jan Beich Subject: git: 744faa81ea34 - main - devel/busd: backport TCP fix List-Id: Commits to the main branch of the FreeBSD ports repository List-Archive: https://lists.freebsd.org/archives/dev-commits-ports-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-ports-main@freebsd.org Sender: owner-dev-commits-ports-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jbeich X-Git-Repository: ports X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 744faa81ea34f98530699b2893142e63aba070c9 Auto-Submitted: auto-generated The branch main has been updated by jbeich: URL: https://cgit.FreeBSD.org/ports/commit/?id=744faa81ea34f98530699b2893142e63aba070c9 commit 744faa81ea34f98530699b2893142e63aba070c9 Author: Jan Beich AuthorDate: 2024-05-02 21:16:40 +0000 Commit: Jan Beich CommitDate: 2024-05-02 21:55:19 +0000 devel/busd: backport TCP fix --- devel/busd/Makefile | 2 +- devel/busd/files/patch-zbus | 86 +++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 87 insertions(+), 1 deletion(-) diff --git a/devel/busd/Makefile b/devel/busd/Makefile index 76cd7bdd7bf8..3a8ffc92d850 100644 --- a/devel/busd/Makefile +++ b/devel/busd/Makefile @@ -1,6 +1,6 @@ PORTNAME= busd DISTVERSION= 0.3.0 -PORTREVISION= 1 +PORTREVISION= 2 CATEGORIES= devel MAINTAINER= jbeich@FreeBSD.org diff --git a/devel/busd/files/patch-zbus b/devel/busd/files/patch-zbus index f6d1c1014e41..194aa47b6311 100644 --- a/devel/busd/files/patch-zbus +++ b/devel/busd/files/patch-zbus @@ -1,5 +1,39 @@ https://github.com/dbus2/zbus/pull/757 +--- cargo-crates/zbus-4.2.0/src/connection/handshake/client.rs.orig 2006-07-24 01:21:28 UTC ++++ cargo-crates/zbus-4.2.0/src/connection/handshake/client.rs +@@ -95,21 +95,16 @@ impl Client { + #[instrument(skip(self))] + #[cfg(any(target_os = "freebsd", target_os = "dragonfly"))] + async fn send_zero_byte(&mut self) -> Result<()> { +- let written = self +- .common +- .socket_mut() +- .write_mut() +- .send_zero_byte() +- .await +- .map_err(|e| { +- Error::Handshake(format!("Could not send zero byte with credentials: {}", e)) +- }) +- .and_then(|n| match n { +- None => Err(Error::Handshake( +- "Could not send zero byte with credentials".to_string(), +- )), +- Some(n) => Ok(n), +- })?; ++ let write = self.common.socket_mut().write_mut(); ++ ++ let written = match write.send_zero_byte().await.map_err(|e| { ++ Error::Handshake(format!("Could not send zero byte with credentials: {}", e)) ++ })? { ++ // This likely means that the socket type is unable to send SCM_CREDS. ++ // Let's try to send the 0 byte as a regular message. ++ None => write.sendmsg(&[0], &[]).await?, ++ Some(n) => n, ++ }; + + if written != 1 { + return Err(Error::Handshake( --- cargo-crates/zbus-4.2.0/src/connection/handshake/common.rs.orig 2006-07-24 01:21:28 UTC +++ cargo-crates/zbus-4.2.0/src/connection/handshake/common.rs @@ -122,17 +122,13 @@ impl Common { @@ -26,3 +60,55 @@ https://github.com/dbus2/zbus/pull/757 }; let line_bytes = self.recv_buffer.drain(..=lf_index); +--- cargo-crates/zbus-4.2.0/src/connection/socket/tcp.rs.orig 2006-07-24 01:21:28 UTC ++++ cargo-crates/zbus-4.2.0/src/connection/socket/tcp.rs +@@ -26,32 +26,25 @@ impl ReadHalf for Arc> { + } + } + ++ #[cfg(windows)] + async fn peer_credentials(&mut self) -> io::Result { +- #[cfg(windows)] +- let creds = { +- let stream = self.clone(); +- crate::Task::spawn_blocking( +- move || { +- use crate::win32::{tcp_stream_get_peer_pid, ProcessToken}; ++ let stream = self.clone(); ++ crate::Task::spawn_blocking( ++ move || { ++ use crate::win32::{tcp_stream_get_peer_pid, ProcessToken}; + +- let pid = tcp_stream_get_peer_pid(stream.get_ref())? as _; +- let sid = ProcessToken::open(if pid != 0 { Some(pid as _) } else { None }) +- .and_then(|process_token| process_token.sid())?; +- io::Result::Ok( +- crate::fdo::ConnectionCredentials::default() +- .set_process_id(pid) +- .set_windows_sid(sid), +- ) +- }, +- "peer credentials", +- ) +- .await +- }?; +- +- #[cfg(not(windows))] +- let creds = crate::fdo::ConnectionCredentials::default(); +- +- Ok(creds) ++ let pid = tcp_stream_get_peer_pid(stream.get_ref())? as _; ++ let sid = ProcessToken::open(if pid != 0 { Some(pid as _) } else { None }) ++ .and_then(|process_token| process_token.sid())?; ++ io::Result::Ok( ++ crate::fdo::ConnectionCredentials::default() ++ .set_process_id(pid) ++ .set_windows_sid(sid), ++ ) ++ }, ++ "peer credentials", ++ ) ++ .await + } + } +