From nobody Thu Aug 31 07:56:00 2023 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 4Rbtl46fj6z4rsTJ; Thu, 31 Aug 2023 07:56:00 +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 4Rbtl45djNz4TDC; Thu, 31 Aug 2023 07:56:00 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1693468560; 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=zRzQ9if+CyuLHoZhSaZJ90HGLifz1QgbiVtp/3H3koE=; b=FjQ0Qte9hs/0eAUWvECchgH5MmZICdYDzsGrSZjvM6UIOGr0Jo7QGR968Yf9fbJ4QCqse7 R7HwFQ6kR9wpY3MmsTeCR5Z+ALBh3OZQsiIt4WVPiOQ2pFgDRoSnztRJh5/gTxoEWq1Kk3 ynOvhCFSFnMu6+9s8G4Z0F05M1gU1lmxdLxQoL6vZGgzMUonNI5EYeZrJwlAaEoQ+JAI72 6MOS80xN+rEPQ7eMLcd/ERxCo0QA9p5dx8RB+ewezFZNV8wPq+yEUmPlhKH4CrPQnE+AUJ S/C2JP3jogzQxYB1dcOXt+ZoWZDQjnL3V4/3rRftVJYD4EURa2YDeHYFBuVuug== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1693468560; a=rsa-sha256; cv=none; b=PZBmK0KhbRRYUZEtrSTbDFQam9gCfbB4A0h2gxLWSkWJfHrvdK9gyOZmZSPn8cd4Zmh8na lQ6aQATAyMMLgHCYlF40cWJKM0UrQnSqcteiOiJdmsADig0LVFIlo593fGOFsZWqsMVROL dFTA5flwEW4uB96pMQCDAoSzfXzRdcvRs9dpBLm8QuQH4f5gyz0WowKZfTE6OemOKaw9pP U24UBidZC3Y3uHDW0eTj66C+V5XaE2ngIZzgmPIkDqZNGa9Vg4t5xIVBDUA58kRPtIcdlY 8mxMfDbg7vz8F1QJ6NNkUAZZdPfb0il4jXRNPsFJ4f7ncgNJqiMIyLqkOLWvNg== 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=1693468560; 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=zRzQ9if+CyuLHoZhSaZJ90HGLifz1QgbiVtp/3H3koE=; b=MmQnnVDz2cE/oZAARzGdAXocKD8nXTIDU8QXx5jTRqSQbBTvHmb6Fu4c5NP6H5KkLiLtH3 g30ha+ChX+HDoE5Y2z9mzi3EUw/s/W6bcgsGvwfUeSDIekPP5pxX+QB9P5+K06a3A1nRGG VDi7w6bWFWeNbGZI8E7V0Ix948n0V3kwuZi6QUKYGLuYq56V84fdxYgTEWYBIIFxkTx+6Q zSXl48M1Axhh/2cvoBGMtg2AcZOCigjUqcf/zjtJhuIny9tKIeWP9g+O5r+eOWpJshmLop mNVboZnv01bXNO3HnmSiB6mpx2hdY0K7bq4I53Uw7R+P+nIR1JUHWZCt8cKrHQ== 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 4Rbtl44Htqz18d0; Thu, 31 Aug 2023 07:56:00 +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 37V7u0Yl083071; Thu, 31 Aug 2023 07:56:00 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 37V7u0Ti083068; Thu, 31 Aug 2023 07:56:00 GMT (envelope-from git) Date: Thu, 31 Aug 2023 07:56:00 GMT Message-Id: <202308310756.37V7u0Ti083068@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: 12b84b980b45 - main - sysutils/polkit: Adapt to ConsoleKit changes. 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: 12b84b980b45573c93be5382a274dbe872a1eb73 Auto-Submitted: auto-generated The branch main has been updated by arrowd: URL: https://cgit.FreeBSD.org/ports/commit/?id=12b84b980b45573c93be5382a274dbe872a1eb73 commit 12b84b980b45573c93be5382a274dbe872a1eb73 Author: Gleb Popov AuthorDate: 2023-08-31 07:55:34 +0000 Commit: Gleb Popov CommitDate: 2023-08-31 07:55:34 +0000 sysutils/polkit: Adapt to ConsoleKit changes. Sponsored by: Serenity Cybersecurity, LLC --- UPDATING | 8 ++++ sysutils/polkit/Makefile | 1 + .../files/patch-src_polkit_polkitunixsession.c | 53 ++++++++++++++++++++++ ...src_polkitbackend_polkitbackendsessionmonitor.c | 45 ++++++++++++++++++ 4 files changed, 107 insertions(+) diff --git a/UPDATING b/UPDATING index 428c7169615b..7ded41161f91 100644 --- a/UPDATING +++ b/UPDATING @@ -5,6 +5,14 @@ they are unavoidable. You should get into the habit of checking this file for changes each time you update your ports collection, before attempting any port upgrades. +20230822: + AUTHOR: arrowd@FreeBSD.org + AFFECTS: users of sysutils/polkit together with sysutils/consolekit2 + + ConsoleKit2 has grown some logind1 compatibility which resulted in breaking + changes in its API. One of its consumers, Polkit, is patched to handle it, + so make sure to update both ports simultaneously. + 20230822: AUTHOR: leres@FreeBSD.org AFFECTS: users of security/zeek diff --git a/sysutils/polkit/Makefile b/sysutils/polkit/Makefile index ef09a86ecf56..5c8cb59f7691 100644 --- a/sysutils/polkit/Makefile +++ b/sysutils/polkit/Makefile @@ -1,5 +1,6 @@ PORTNAME= polkit DISTVERSION= 123 +PORTREVISION= 1 CATEGORIES= sysutils gnome MAINTAINER= desktop@FreeBSD.org diff --git a/sysutils/polkit/files/patch-src_polkit_polkitunixsession.c b/sysutils/polkit/files/patch-src_polkit_polkitunixsession.c new file mode 100644 index 000000000000..6367e0e5c6b6 --- /dev/null +++ b/sysutils/polkit/files/patch-src_polkit_polkitunixsession.c @@ -0,0 +1,53 @@ +FreeBSD ConsoleKit is patched to return proper IDs instead D-Bus paths, so +adapt Polkit to this case. + +--- src/polkit/polkitunixsession.c.orig 2023-07-28 12:34:38 UTC ++++ src/polkit/polkitunixsession.c +@@ -364,6 +364,7 @@ polkit_unix_session_exists_sync (PolkitSubject *subj + PolkitUnixSession *session = POLKIT_UNIX_SESSION (subject); + GDBusConnection *connection; + GVariant *result; ++ const gchar* session_path = NULL; + gboolean ret; + + ret = FALSE; +@@ -372,9 +373,12 @@ polkit_unix_session_exists_sync (PolkitSubject *subj + if (connection == NULL) + goto out; + ++ if (strncmp (session->session_id, "/org/freedesktop/ConsoleKit", strlen ("/org/freedesktop/ConsoleKit") )) ++ session_path = g_build_path("/", "/org/freedesktop/ConsoleKit", session->session_id, NULL); ++ + result = g_dbus_connection_call_sync (connection, + "org.freedesktop.ConsoleKit", /* name */ +- session->session_id, /* object path */ ++ session_path ? session_path : session->session_id, /* object path */ + "org.freedesktop.ConsoleKit.Session", /* interface name */ + "GetUser", /* method */ + NULL, /* parameters */ +@@ -383,6 +387,7 @@ polkit_unix_session_exists_sync (PolkitSubject *subj + -1, + cancellable, + error); ++ g_free (session_path); + if (result == NULL) + goto out; + +@@ -472,6 +477,7 @@ polkit_unix_session_initable_init (GInitable *init + PolkitUnixSession *session = POLKIT_UNIX_SESSION (initable); + GDBusConnection *connection; + GVariant *result; ++ const gchar* session_path; + gboolean ret; + + connection = NULL; +@@ -502,7 +508,8 @@ polkit_unix_session_initable_init (GInitable *init + if (result == NULL) + goto out; + +- g_variant_get (result, "(o)", &session->session_id); ++ g_variant_get (result, "(&o)", &session_path); ++ session->session_id = g_path_get_basename (session_path); + g_variant_unref (result); + + ret = TRUE; diff --git a/sysutils/polkit/files/patch-src_polkitbackend_polkitbackendsessionmonitor.c b/sysutils/polkit/files/patch-src_polkitbackend_polkitbackendsessionmonitor.c new file mode 100644 index 000000000000..216f00b94e58 --- /dev/null +++ b/sysutils/polkit/files/patch-src_polkitbackend_polkitbackendsessionmonitor.c @@ -0,0 +1,45 @@ +FreeBSD ConsoleKit is patched to return proper IDs instead D-Bus paths, so +adapt Polkit to this case. + +--- src/polkitbackend/polkitbackendsessionmonitor.c.orig 2023-07-28 12:34:38 UTC ++++ src/polkitbackend/polkitbackendsessionmonitor.c +@@ -385,7 +385,7 @@ polkit_backend_session_monitor_get_session_for_subject + + if (POLKIT_IS_UNIX_PROCESS (subject)) + { +- const gchar *session_id; ++ const gchar *session_path, *session_id; + GVariant *result; + result = g_dbus_connection_call_sync (monitor->system_bus, + "org.freedesktop.ConsoleKit", +@@ -400,14 +400,16 @@ polkit_backend_session_monitor_get_session_for_subject + error); + if (result == NULL) + goto out; +- g_variant_get (result, "(&o)", &session_id); ++ g_variant_get (result, "(&o)", &session_path); ++ session_id = g_path_get_basename (session_path); + session = polkit_unix_session_new (session_id); ++ g_free (session_id); + g_variant_unref (result); + } + else if (POLKIT_IS_SYSTEM_BUS_NAME (subject)) + { + guint32 pid; +- const gchar *session_id; ++ const gchar *session_path, *session_id; + GVariant *result; + + result = g_dbus_connection_call_sync (monitor->system_bus, +@@ -439,8 +441,10 @@ polkit_backend_session_monitor_get_session_for_subject + error); + if (result == NULL) + goto out; +- g_variant_get (result, "(&o)", &session_id); ++ g_variant_get (result, "(&o)", &session_path); ++ session_id = g_path_get_basename (session_path); + session = polkit_unix_session_new (session_id); ++ g_free (session_id); + g_variant_unref (result); + } + else