diff --git a/sysutils/polkit/Makefile b/sysutils/polkit/Makefile index 839b08d29502..c6485734f0e7 100644 --- a/sysutils/polkit/Makefile +++ b/sysutils/polkit/Makefile @@ -1,70 +1,70 @@ # Created by: Koop Mast PORTNAME= polkit PORTVERSION= 0.120 -PORTREVISION= 1 +PORTREVISION= 2 CATEGORIES= sysutils gnome MASTER_SITES= https://www.freedesktop.org/software/polkit/releases/ PATCH_SITES= https://gitlab.freedesktop.org/${PORTNAME}/${PORTNAME}/-/commit/ PATCHFILES+= e7f3d9e8341d.patch:-p1 # https://gitlab.freedesktop.org/polkit/polkit/-/merge_requests/99 PATCHFILES+= a2bf5c9c83b6.patch:-p1 # https://gitlab.freedesktop.org/polkit/polkit/-/merge_requests/104 (CVE-2021-4034) MAINTAINER= desktop@FreeBSD.org COMMENT= Framework for controlling access to system-wide components LICENSE= GPLv2 LICENSE_FILE= ${WRKSRC}/COPYING LIB_DEPENDS= libexpat.so:textproc/expat2 \ libdbus-1.so:devel/dbus \ - libmozjs-78.so:lang/spidermonkey78 + libmozjs-91.so:lang/spidermonkey91 USERS= polkitd GROUPS= polkitd USES= compiler:c++11-lib cpe gettext gnome libtool localbase meson \ pathfix pkgconfig shebangfix USE_GNOME= glib20 intltool introspection:build SHEBANG_FILES= ${WRKSRC}/src/polkitbackend/toarray.pl USE_LDCONFIG= yes CPE_VENDOR= polkit_project MESON_ARGS= -Dpam_include=system \ -Dpolkitd_user=${USERS} \ -Dexamples=false \ -Dsession_tracking=ConsoleKit \ -Dtests=false \ -Dintrospection=true \ -Dlocalstatedir=/var \ -Dgtk_doc=false INSTALL_TARGET= install-strip OPTIONS_DEFINE= MANPAGES MANPAGES_BUILD_DEPENDS= docbook-sgml>=4.5:textproc/docbook-sgml \ docbook-xsl>=1.76:textproc/docbook-xsl MANPAGES_USE= gnome=libxslt:build MANPAGES_MESON_TRUE= man OPTIONS_SUB= yes .include post-patch: @${REINPLACE_CMD} -e 's|/usr/bin/|${PREFIX}/bin/|g' \ ${WRKSRC}/docs/man/pkexec.xml \ ${WRKSRC}/src/examples/org.freedesktop.policykit.examples.pkexec.policy.in @${REINPLACE_CMD} -e 's|%%LOCALBASE%%|${PREFIX}|g' \ ${WRKSRC}/docs/man/polkit.xml post-install: @${MKDIR} ${STAGEDIR}/var/lib/polkit-1 \ ${STAGEDIR}${PREFIX}/share/polkit-1/rules.d .for i in 10-vendor.d 20-org.d 30-site.d 50-local.d 90-mandatory.d ${MKDIR} ${STAGEDIR}${PREFIX}/etc/polkit-1/localauthority/${i} ${MKDIR} ${STAGEDIR}/var/lib/polkit-1/localauthority/${i} .endfor .include diff --git a/sysutils/polkit/distinfo b/sysutils/polkit/distinfo index a0a990aa819b..839b6c439a75 100644 --- a/sysutils/polkit/distinfo +++ b/sysutils/polkit/distinfo @@ -1,7 +1,7 @@ -TIMESTAMP = 1643152765 +TIMESTAMP = 1656189343 SHA256 (polkit-0.120.tar.gz) = ee7a599a853117bf273548725719fa92fabd2f136915c7a4906cee98567aee03 SIZE (polkit-0.120.tar.gz) = 1626659 SHA256 (e7f3d9e8341d.patch) = 9a84b59d38b3f86c70c5fc3a28cbfe8d7a22cf190eb20ff433f7f53f5ff73a9a SIZE (e7f3d9e8341d.patch) = 1201 SHA256 (a2bf5c9c83b6.patch) = 5930a48bf4262a7c89f8737a1a5a648bd41cfdb6476dcca1140cba6555b67d2c SIZE (a2bf5c9c83b6.patch) = 2070 diff --git a/sysutils/polkit/files/patch-meson.build b/sysutils/polkit/files/patch-meson.build index 440dce3e8fdd..260fe5aafd82 100644 --- a/sysutils/polkit/files/patch-meson.build +++ b/sysutils/polkit/files/patch-meson.build @@ -1,27 +1,31 @@ --- meson.build.orig 2021-09-29 19:16:29 UTC +++ meson.build -@@ -136,7 +136,7 @@ assert(cc.has_function('XML_ParserCreate', dependencie - mozjs_dep = dependency('mozjs-78') +@@ -133,10 +133,10 @@ assert(cc.has_function('XML_ParserCreate', dependencie + assert(cc.has_header('expat.h', dependencies: expat_dep), 'Can\'t find expat.h. Please install expat.') + assert(cc.has_function('XML_ParserCreate', dependencies: expat_dep), 'Can\'t find expat library. Please install expat.') + +-mozjs_dep = dependency('mozjs-78') ++mozjs_dep = dependency('mozjs-91') dbus_dep = dependency('dbus-1', required: false) -dbus_policydir = pk_prefix / pk_datadir / 'dbus-1/system.d' +dbus_policydir = pk_prefix / pk_sysconfdir / 'dbus-1/system.d' if dbus_dep.found() dbus_system_bus_services_dir = dbus_dep.get_pkgconfig_variable('system_bus_services_dir', define_variable: ['datadir', pk_prefix / pk_datadir]) else -@@ -329,15 +329,6 @@ endif +@@ -329,15 +329,6 @@ configure_file( configure_file( output: 'config.h', configuration: config_h, -) - -meson.add_install_script( - 'meson_post_install.py', - get_option('bindir'), - pk_pkgdatadir, - pk_libprivdir, - pk_pkgsysconfdir, - polkitd_user, ) output = '\n ' + meson.project_name() + ' ' + meson.project_version() + '\n' diff --git a/sysutils/polkit/files/patch-src_polkitbackend_polkitbackendjsauthority.cpp b/sysutils/polkit/files/patch-src_polkitbackend_polkitbackendjsauthority.cpp new file mode 100644 index 000000000000..a8f47c895e8f --- /dev/null +++ b/sysutils/polkit/files/patch-src_polkitbackend_polkitbackendjsauthority.cpp @@ -0,0 +1,33 @@ +--- src/polkitbackend/polkitbackendjsauthority.cpp.orig 2022-06-25 20:41:05 UTC ++++ src/polkitbackend/polkitbackendjsauthority.cpp +@@ -75,6 +75,13 @@ + + /* ---------------------------------------------------------------------------------------------------- */ + ++static class JsInitHelperType ++{ ++public: ++ JsInitHelperType() { JS_Init(); } ++ ~JsInitHelperType() { JS_ShutDown(); } ++} JsInitHelper; ++ + struct _PolkitBackendJsAuthorityPrivate + { + gchar **rules_dirs; +@@ -589,7 +596,6 @@ polkit_backend_js_authority_finalize (GObject *object) + delete authority->priv->js_polkit; + + JS_DestroyContext (authority->priv->cx); +- /* JS_ShutDown (); */ + + G_OBJECT_CLASS (polkit_backend_js_authority_parent_class)->finalize (object); + } +@@ -665,8 +671,6 @@ polkit_backend_js_authority_class_init (PolkitBackendJ + + + g_type_class_add_private (klass, sizeof (PolkitBackendJsAuthorityPrivate)); +- +- JS_Init (); + } + + /* ---------------------------------------------------------------------------------------------------- */