diff --git a/sysutils/polkit/Makefile b/sysutils/polkit/Makefile index 4252c990f7f2..60185ef5d60e 100644 --- a/sysutils/polkit/Makefile +++ b/sysutils/polkit/Makefile @@ -1,69 +1,76 @@ PORTNAME= polkit -PORTVERSION= 0.120 -PORTREVISION= 2 +PORTVERSION= 122 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) +MASTER_SITES= https://www.freedesktop.org/software/polkit/releases/ \ + https://gitlab.freedesktop.org/${PORTNAME}/${PORTNAME}/-/archive/${PORTVERSION}/ MAINTAINER= desktop@FreeBSD.org COMMENT= Framework for controlling access to system-wide components WWW= https://www.freedesktop.org/wiki/Software/polkit/ LICENSE= GPLv2 LICENSE_FILE= ${WRKSRC}/COPYING LIB_DEPENDS= libexpat.so:textproc/expat2 \ - libdbus-1.so:devel/dbus \ - libmozjs-91.so:lang/spidermonkey91 + libdbus-1.so:devel/dbus USERS= polkitd GROUPS= polkitd -USES= compiler:c++11-lib cpe gettext gnome libtool localbase meson \ +USES= compiler:c++17-lang 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 +OPTIONS_DEFAULT= DUKTAPE + +OPTIONS_SINGLE= JS +OPTIONS_SINGLE_JS= DUKTAPE SPIDERMONKEY + +JS_DESC= JavaScript engines +DUKTAPE_DESC= Duktape JavaScript backend +SPIDERMONKEY_DESC= SpiderMonkey JavaScript backend + +DUKTAPE_LIB_DEPENDS= libduktape.so:lang/duktape-lib +DUKTAPE_MESON_ON= -Djs_engine='duktape' + +SPIDERMONKEY_LIB_DEPENDS= libmozjs-102.so:lang/spidermonkey102 +SPIDERMONKEY_MESON_ON= -Djs_engine='mozjs' 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 839b6c439a75..66975b24dc9b 100644 --- a/sysutils/polkit/distinfo +++ b/sysutils/polkit/distinfo @@ -1,7 +1,3 @@ -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 +TIMESTAMP = 1666804675 +SHA256 (polkit-122.tar.gz) = 0d69656d60800835c3d7d1f0a8362b32e1ae3ace2875a35bb624296fc52d5dc4 +SIZE (polkit-122.tar.gz) = 744767 diff --git a/sysutils/polkit/files/patch-meson.build b/sysutils/polkit/files/patch-meson.build index 260fe5aafd82..74e14902a24e 100644 --- a/sysutils/polkit/files/patch-meson.build +++ b/sysutils/polkit/files/patch-meson.build @@ -1,31 +1,31 @@ ---- meson.build.orig 2021-09-29 19:16:29 UTC +--- meson.build.orig 2022-10-26 12:12:24 UTC +++ meson.build -@@ -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') +@@ -154,10 +154,11 @@ if js_engine == 'duktape' + config_h.set('HAVE_' + func.to_upper(), cc.has_function(func, prefix : '#include ')) + elif js_engine == 'mozjs' + js_dep = dependency('mozjs-102') ++ config_h.set('__BSD_VISIBLE', 1) + endif 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 @@ configure_file( +@@ -358,15 +359,6 @@ endif 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_meson.build b/sysutils/polkit/files/patch-src_polkitbackend_meson.build new file mode 100644 index 000000000000..7190e505d15c --- /dev/null +++ b/sysutils/polkit/files/patch-src_polkitbackend_meson.build @@ -0,0 +1,19 @@ +--- src/polkitbackend/meson.build.orig 2022-10-26 12:12:24 UTC ++++ src/polkitbackend/meson.build +@@ -30,7 +30,6 @@ c_flags = [ + '-DPACKAGE_DATA_DIR="@0@"'.format(pk_prefix / pk_datadir), + '-DPACKAGE_SYSCONF_DIR="@0@"'.format(pk_prefix / pk_sysconfdir), + '-D_XOPEN_SOURCE=700', +- '-D_GNU_SOURCE=1', + ] + + if js_engine == 'duktape' +@@ -61,7 +60,7 @@ libpolkit_backend = static_library( + + install_data( + '50-default.rules', +- install_dir: pk_pkgdatadir / 'rules.d', ++ install_dir: pk_pkgsysconfdir / 'rules.d', + ) + + program = 'polkitd' diff --git a/sysutils/polkit/files/patch-src_polkitbackend_polkitbackendjsauthority.cpp b/sysutils/polkit/files/patch-src_polkitbackend_polkitbackendjsauthority.cpp deleted file mode 100644 index a8f47c895e8f..000000000000 --- a/sysutils/polkit/files/patch-src_polkitbackend_polkitbackendjsauthority.cpp +++ /dev/null @@ -1,33 +0,0 @@ ---- 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 (); - } - - /* ---------------------------------------------------------------------------------------------------- */ diff --git a/sysutils/polkit/files/patch-src_programs_pkexec.c b/sysutils/polkit/files/patch-src_programs_pkexec.c new file mode 100644 index 000000000000..47fed9033d8a --- /dev/null +++ b/sysutils/polkit/files/patch-src_programs_pkexec.c @@ -0,0 +1,33 @@ +--- src/programs/pkexec.c.orig 2022-07-11 08:46:06 UTC ++++ src/programs/pkexec.c +@@ -37,6 +37,11 @@ + #include + #endif + ++#ifdef __FreeBSD__ ++#include ++#include ++#endif ++ + #include + + #ifdef POLKIT_AUTHFW_PAM +@@ -729,10 +734,17 @@ main (int argc, char *argv[]) + } + + /* make sure we are nuked if the parent process dies */ +-#ifdef __linux__ ++#if defined(__linux__) + if (prctl (PR_SET_PDEATHSIG, SIGTERM) != 0) + { + g_printerr ("prctl(PR_SET_PDEATHSIG, SIGTERM) failed: %s\n", g_strerror (errno)); ++ goto out; ++ } ++#elif defined(__FreeBSD__) ++ int _sig = SIGTERM; ++ if (procctl (P_PID, 0, PROC_PDEATHSIG_CTL, &_sig) != 0) ++ { ++ g_printerr ("procctl(2) failed: %s\n", g_strerror (errno)); + goto out; + } + #else diff --git a/sysutils/polkit/pkg-plist b/sysutils/polkit/pkg-plist index f6ad72a65d8e..c1a23766792f 100644 --- a/sysutils/polkit/pkg-plist +++ b/sysutils/polkit/pkg-plist @@ -1,94 +1,97 @@ bin/pkaction bin/pkcheck @(root,,4755) bin/pkexec bin/pkttyagent @sample etc/dbus-1/system.d/org.freedesktop.PolicyKit1.conf.sample etc/pam.d/polkit-1 etc/polkit-1/rules.d/50-default.rules include/polkit-1/polkit/polkit.h include/polkit-1/polkit/polkitactiondescription.h include/polkit-1/polkit/polkitauthority.h include/polkit-1/polkit/polkitauthorityfeatures.h include/polkit-1/polkit/polkitauthorizationresult.h include/polkit-1/polkit/polkitcheckauthorizationflags.h include/polkit-1/polkit/polkitdetails.h include/polkit-1/polkit/polkitenumtypes.h include/polkit-1/polkit/polkiterror.h include/polkit-1/polkit/polkitidentity.h include/polkit-1/polkit/polkitimplicitauthorization.h include/polkit-1/polkit/polkitpermission.h include/polkit-1/polkit/polkitprivate.h include/polkit-1/polkit/polkitsubject.h include/polkit-1/polkit/polkitsystembusname.h include/polkit-1/polkit/polkittemporaryauthorization.h include/polkit-1/polkit/polkittypes.h include/polkit-1/polkit/polkitunixgroup.h include/polkit-1/polkit/polkitunixnetgroup.h include/polkit-1/polkit/polkitunixprocess.h include/polkit-1/polkit/polkitunixsession.h include/polkit-1/polkit/polkitunixuser.h include/polkit-1/polkitagent/polkitagent.h include/polkit-1/polkitagent/polkitagentenumtypes.h include/polkit-1/polkitagent/polkitagentlistener.h include/polkit-1/polkitagent/polkitagentsession.h include/polkit-1/polkitagent/polkitagenttextlistener.h include/polkit-1/polkitagent/polkitagenttypes.h lib/girepository-1.0/Polkit-1.0.typelib lib/girepository-1.0/PolkitAgent-1.0.typelib lib/libpolkit-agent-1.so lib/libpolkit-agent-1.so.0 lib/libpolkit-agent-1.so.0.0.0 lib/libpolkit-gobject-1.so lib/libpolkit-gobject-1.so.0 lib/libpolkit-gobject-1.so.0.0.0 @(root,,4755) lib/polkit-1/polkit-agent-helper-1 lib/polkit-1/polkitd libdata/pkgconfig/polkit-agent-1.pc libdata/pkgconfig/polkit-gobject-1.pc %%MANPAGES%%man/man1/pkaction.1.gz %%MANPAGES%%man/man1/pkcheck.1.gz %%MANPAGES%%man/man1/pkexec.1.gz %%MANPAGES%%man/man1/pkttyagent.1.gz %%MANPAGES%%man/man8/polkit.8.gz %%MANPAGES%%man/man8/polkitd.8.gz share/dbus-1/system-services/org.freedesktop.PolicyKit1.service share/gettext/its/polkit.its share/gettext/its/polkit.loc share/gir-1.0/Polkit-1.0.gir share/gir-1.0/PolkitAgent-1.0.gir share/locale/cs/LC_MESSAGES/polkit-1.mo share/locale/da/LC_MESSAGES/polkit-1.mo share/locale/de/LC_MESSAGES/polkit-1.mo share/locale/hr/LC_MESSAGES/polkit-1.mo share/locale/hu/LC_MESSAGES/polkit-1.mo share/locale/id/LC_MESSAGES/polkit-1.mo share/locale/it/LC_MESSAGES/polkit-1.mo +share/locale/ka/LC_MESSAGES/polkit-1.mo +share/locale/nl/LC_MESSAGES/polkit-1.mo share/locale/nn/LC_MESSAGES/polkit-1.mo share/locale/pl/LC_MESSAGES/polkit-1.mo share/locale/pt/LC_MESSAGES/polkit-1.mo share/locale/pt_BR/LC_MESSAGES/polkit-1.mo share/locale/ro/LC_MESSAGES/polkit-1.mo share/locale/sk/LC_MESSAGES/polkit-1.mo share/locale/sv/LC_MESSAGES/polkit-1.mo share/locale/tr/LC_MESSAGES/polkit-1.mo share/locale/uk/LC_MESSAGES/polkit-1.mo share/locale/zh_CN/LC_MESSAGES/polkit-1.mo share/locale/zh_TW/LC_MESSAGES/polkit-1.mo share/polkit-1/actions/org.freedesktop.policykit.policy +share/polkit-1/policyconfig-1.dtd @dir(polkitd,,700) etc/polkit-1/rules.d @dir(polkitd,,700) share/polkit-1/rules.d @dir etc/polkit-1/localauthority/90-mandatory.d @dir etc/polkit-1/localauthority/50-local.d @dir etc/polkit-1/localauthority/30-site.d @dir etc/polkit-1/localauthority/20-org.d @dir etc/polkit-1/localauthority/10-vendor.d @dir(,,700) etc/polkit-1/localauthority @dir etc/polkit-1 @dir /var/lib/polkit-1/localauthority/90-mandatory.d @dir /var/lib/polkit-1/localauthority/50-local.d @dir /var/lib/polkit-1/localauthority/30-site.d @dir /var/lib/polkit-1/localauthority/20-org.d @dir /var/lib/polkit-1/localauthority/10-vendor.d @dir /var/lib/polkit-1/localauthority @dir(,,700) /var/lib/polkit-1 @dir /var/lib