From nobody Sat Mar 23 12:42:32 2024 X-Original-To: dev-commits-ports-all@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 4V1zP529Zkz5FMR9; Sat, 23 Mar 2024 12:42:33 +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 4V1zP50SX4z4swP; Sat, 23 Mar 2024 12:42:33 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1711197753; 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=ys807UNU8WaABmd/7+R5o38J4KfxTrlLPZV5SjiFgq0=; b=dJ7iEhsCC20X+TBbyA+FfMsLoj9vsabaNaDgbxZAfeFaLi8mKQEB3VN4iU2zQA9jAeeevm cWHppRPXnW3ymbRrfqT65SDUeaDCN293vgHupPmHmMeZD9s0DuUOB5sJnZWogA1+7hburI Pmd6B8yYhDmMtO7Sb7hshT9amH83thT2DFLYI7PMuBQvH8L00ncc0zJFtKlbSvNiMfXFg9 JgZXpWv5YMOdHpelayTPL3ioWbu/rBQqhA87dDfESTy0cK0QU99ne/mpDI2/o+b0A4MLTN dUYTf3XgzRZI0Pzhifa9yABXrG8ZBQK9+wdVYIoLdBvbI9Dm9kQUiC9m0sD6zw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1711197753; a=rsa-sha256; cv=none; b=Su+iYYEjAj1673rekdleAuUqwnGT1MPMkb0wlcpgy74T7W7IwXILivwuEH7bko1C4LWl7t 4aElb8MDQkf4LkxhISZUZVn2m6gjScwkg593GkQL8EP8MVjtvWV/9xQOzZLBwXbLaCoxQi AlpTPzG1WJ62EHbvvK95VGahKDrZkcVbdL5ujgSFmjKPEGzTDWYe9qtwnEFi1DS83TGG/w UZ0a7mPOTaKuikiH5znHK8vjI9POfvvt9zG0leJ8A/JFqu9TyJ2VtW6nBxqDdugV+fliCm QCCSoItyADNdUSmWhwOuqPbw7ex2SAO9kbwzQIOA3zMaiUsLIFixZH9yn/h3BA== 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=1711197753; 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=ys807UNU8WaABmd/7+R5o38J4KfxTrlLPZV5SjiFgq0=; b=lfXHeuaRMd4EPM1Xq+tKu2qnrVesuYjDtpl7pfizHRXARTDD8s8RDKPKTHQdvpuiK2xJmz BYoW+x1G1iSc2aDWPq7dWvsxc1XGnFJIAJfxalqBfUbjEHFs8Ov9Vxh93UqIGPazSHc/aB ckcHKjN5b+Oe9I/cVCJWSwdwgcsgxJqzTArZNSEEGT5lqmLJAglaAEVscMZK8tGmO5eJwg OX8prUMnLmuGktth3asTnJCNIyH9FlBI1+B9fIycfBixT275dVp+8qnzxT+qCtZEGzTd9o N2RbctLB43wlg6DisQ++P+5QD56AzAGe7i23+lce07cKg1M8j93T2BIKCZxGgw== 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 4V1zP503xhzpTt; Sat, 23 Mar 2024 12:42:33 +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 42NCgW7d059730; Sat, 23 Mar 2024 12:42:32 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 42NCgWcn059727; Sat, 23 Mar 2024 12:42:32 GMT (envelope-from git) Date: Sat, 23 Mar 2024 12:42:32 GMT Message-Id: <202403231242.42NCgWcn059727@gitrepo.freebsd.org> To: ports-committers@FreeBSD.org, dev-commits-ports-all@FreeBSD.org, dev-commits-ports-main@FreeBSD.org From: Gleb Popov Subject: git: 04bd4bf4931b - main - devel/dbus: Teach D-Bus to obtain credentials using getsockopt(LOCAL_PEERCRED) List-Id: Commit messages for all branches of the ports repository List-Archive: https://lists.freebsd.org/archives/dev-commits-ports-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-ports-all@freebsd.org X-BeenThere: dev-commits-ports-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: arrowd X-Git-Repository: ports X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 04bd4bf4931ba794718f67ff5e693a679740bdad Auto-Submitted: auto-generated The branch main has been updated by arrowd: URL: https://cgit.FreeBSD.org/ports/commit/?id=04bd4bf4931ba794718f67ff5e693a679740bdad commit 04bd4bf4931ba794718f67ff5e693a679740bdad Author: Gleb Popov AuthorDate: 2024-03-23 12:07:12 +0000 Commit: Gleb Popov CommitDate: 2024-03-23 12:41:15 +0000 devel/dbus: Teach D-Bus to obtain credentials using getsockopt(LOCAL_PEERCRED) Obtained from: Alex S --- devel/dbus/Makefile | 2 +- devel/dbus/files/patch-dbus_dbus-sysdeps-unix.c | 43 ++++++++++++++++++++++--- 2 files changed, 39 insertions(+), 6 deletions(-) diff --git a/devel/dbus/Makefile b/devel/dbus/Makefile index f0f6c5f3b449..a72b5b366431 100644 --- a/devel/dbus/Makefile +++ b/devel/dbus/Makefile @@ -1,6 +1,6 @@ PORTNAME= dbus DISTVERSION= 1.14.10 -PORTREVISION= 4 +PORTREVISION= 5 PORTEPOCH= 1 CATEGORIES= devel gnome MASTER_SITES= https://dbus.freedesktop.org/releases/dbus/ diff --git a/devel/dbus/files/patch-dbus_dbus-sysdeps-unix.c b/devel/dbus/files/patch-dbus_dbus-sysdeps-unix.c index 9a1e8badbaa7..d8671714af28 100644 --- a/devel/dbus/files/patch-dbus_dbus-sysdeps-unix.c +++ b/devel/dbus/files/patch-dbus_dbus-sysdeps-unix.c @@ -8,7 +8,14 @@ #include #include #include -@@ -62,6 +63,9 @@ +@@ -59,9 +60,16 @@ + #include + #include + ++#ifdef __FreeBSD__ ++#include ++#endif ++ #ifdef HAVE_ERRNO_H #include #endif @@ -18,7 +25,7 @@ #ifdef HAVE_SYSLOG_H #include #endif -@@ -80,6 +84,9 @@ +@@ -80,6 +88,9 @@ #ifdef HAVE_SYS_RANDOM_H #include #endif @@ -28,7 +35,7 @@ #ifdef HAVE_ADT #include -@@ -137,6 +144,21 @@ +@@ -137,6 +148,21 @@ #endif /* Solaris */ @@ -50,7 +57,33 @@ /** * Ensure that the standard file descriptors stdin, stdout and stderr * are open, by opening /dev/null if necessary. -@@ -4791,7 +4813,24 @@ _dbus_close_all (void) +@@ -2325,6 +2351,25 @@ _dbus_read_credentials_socket (DBusSocket clien + pid_read = cr.unp_pid; + uid_read = cr.unp_euid; + } ++#elif defined(LOCAL_PEERCRED) ++ struct xucred cr; ++ socklen_t cr_len = sizeof (cr); ++ ++ if (getsockopt (client_fd.fd, 0, LOCAL_PEERCRED, &cr, &cr_len) != 0) ++ { ++ _dbus_verbose ("Failed to getsockopt(LOCAL_PEERCRED): %s\n", ++ _dbus_strerror (errno)); ++ } ++ else if (cr_len != sizeof (cr)) ++ { ++ _dbus_verbose ("Failed to getsockopt(LOCAL_PEERCRED), returned %d bytes, expected %d\n", ++ cr_len, (int) sizeof (cr)); ++ } ++ else ++ { ++ pid_read = cr.cr_pid; ++ uid_read = cr.cr_uid; ++ } + #elif defined(HAVE_CMSGCRED) + /* We only check for HAVE_CMSGCRED, but we're really assuming that the + * presence of that struct implies SCM_CREDS. Supported by at least +@@ -4791,7 +4836,24 @@ _dbus_close_all (void) void _dbus_close_all (void) { @@ -75,7 +108,7 @@ } /** -@@ -4801,6 +4840,11 @@ _dbus_fd_set_all_close_on_exec (void) +@@ -4801,6 +4863,11 @@ _dbus_fd_set_all_close_on_exec (void) void _dbus_fd_set_all_close_on_exec (void) {