summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGilles Dartiguelongue <eva@gentoo.org>2008-12-01 22:13:41 +0000
committerGilles Dartiguelongue <eva@gentoo.org>2008-12-01 22:13:41 +0000
commit034561c1e787916095527e84f217e6139bfdf36c (patch)
treec0b30fdcf2cf006265eb3a1b04d43f3d6edf4c32 /sys-auth/policykit
parentStable on sparc, security bug #244741 (diff)
downloadgentoo-2-034561c1e787916095527e84f217e6139bfdf36c.tar.gz
gentoo-2-034561c1e787916095527e84f217e6139bfdf36c.tar.bz2
gentoo-2-034561c1e787916095527e84f217e6139bfdf36c.zip
Bump to 0.9. Fix bug #214801.
(Portage version: 2.2_rc16/cvs/Linux 2.6.24-gentoo-r8-mactel x86_64)
Diffstat (limited to 'sys-auth/policykit')
-rw-r--r--sys-auth/policykit/ChangeLog11
-rw-r--r--sys-auth/policykit/files/policykit-0.7-completions.patch203
-rw-r--r--sys-auth/policykit/files/policykit-0.9-consolekit03.patch86
-rw-r--r--sys-auth/policykit/files/policykit-0.9-pam-headers.patch17
-rw-r--r--sys-auth/policykit/files/policykit-0.9-pk-debug.patch17
-rw-r--r--sys-auth/policykit/metadata.xml3
-rw-r--r--sys-auth/policykit/policykit-0.9.ebuild126
7 files changed, 462 insertions, 1 deletions
diff --git a/sys-auth/policykit/ChangeLog b/sys-auth/policykit/ChangeLog
index 2f3dc3fd0ca7..f46b67b69886 100644
--- a/sys-auth/policykit/ChangeLog
+++ b/sys-auth/policykit/ChangeLog
@@ -1,6 +1,15 @@
# ChangeLog for sys-auth/policykit
# Copyright 1999-2008 Gentoo Foundation; Distributed under the GPL v2
-# $Header: /var/cvsroot/gentoo-x86/sys-auth/policykit/ChangeLog,v 1.6 2008/01/25 19:09:40 corsair Exp $
+# $Header: /var/cvsroot/gentoo-x86/sys-auth/policykit/ChangeLog,v 1.7 2008/12/01 22:13:40 eva Exp $
+
+*policykit-0.9 (01 Dec 2008)
+
+ 01 Dec 2008; Gilles Dartiguelongue <eva@gentoo.org>
+ +files/policykit-0.7-completions.patch,
+ +files/policykit-0.9-consolekit03.patch,
+ +files/policykit-0.9-pam-headers.patch,
+ +files/policykit-0.9-pk-debug.patch, +policykit-0.9.ebuild:
+ Bump to 0.9. Fix bug #214801.
25 Jan 2008; Markus Rothe <corsair@gentoo.org> policykit-0.6.ebuild:
Added ~ppc64; bug #200076
diff --git a/sys-auth/policykit/files/policykit-0.7-completions.patch b/sys-auth/policykit/files/policykit-0.7-completions.patch
new file mode 100644
index 000000000000..37f8d0d1e803
--- /dev/null
+++ b/sys-auth/policykit/files/policykit-0.7-completions.patch
@@ -0,0 +1,203 @@
+commit afb4535accaa08e20050a7b2d508d884b02f45a0
+Author: Saleem Abdulrasool <compnerd@compnerd.org>
+Date: Mon Nov 19 15:35:03 2007 -0800
+
+ add zsh completion and optionalize bash and zsh completion
+
+ Signed-off-by: Saleem Abdulrasool <compnerd@compnerd.org>
+
+diff --git a/configure.in b/configure.in
+index 2fdb935..a9ea35a 100644
+--- a/configure.in
++++ b/configure.in
+@@ -495,6 +495,21 @@ AC_DEFINE_UNQUOTED(PAM_FILE_INCLUDE_PASSWORD, "$PAM_FILE_INCLUDE_PASSWORD", [pam
+ AC_DEFINE_UNQUOTED(PAM_FILE_INCLUDE_SESSION, "$PAM_FILE_INCLUDE_SESSION", [pam file session])
+
+ # ********************
++# Shell Completion
++# ********************
++
++AC_ARG_WITH([bash-completion],
++ AC_HELP_STRING([--with-bash-completion],[Install bash completion scripts]),,
++ [with_bash_completion=yes])
++
++AC_ARG_WITH([zsh-completion],
++ AC_HELP_STRING([--with-zsh-completion],[Install zsh completion scripts]),,
++ [with_zsh_completion=no])
++
++AM_CONDITIONAL([WITH_BASH_COMPLETION], test x"$with_bash_completion" != x"no")
++AM_CONDITIONAL([WITH_ZSH_COMPLETION], test x"$with_zsh_completion" != x"no")
++
++# ********************
+ # Internationalisation
+ # ********************
+
+diff --git a/tools/Makefile.am b/tools/Makefile.am
+index a76e9fc..0449e12 100644
+--- a/tools/Makefile.am
++++ b/tools/Makefile.am
+@@ -25,10 +25,17 @@ polkit_auth_LDADD = @GLIB_LIBS@ @DBUS_LIBS@ $(top_builddir)/src/polkit/libpolkit
+ polkit_action_SOURCES = polkit-action.c
+ polkit_action_LDADD = $(top_builddir)/src/polkit/libpolkit.la
+
++if WITH_BASH_COMPLETION
+ profiledir = $(sysconfdir)/profile.d
+ profile_SCRIPTS = polkit-bash-completion.sh
++endif
+
+-EXTRA_DIST = $(profile_SCRIPTS)
++if WITH_ZSH_COMPLETION
++zshcompletiondir = $(DESTDIR)$(datadir)/zsh/site-functions
++zshcompletion_SCRIPTS = _polkit _polkit_auth _polkit_action
++endif
++
++EXTRA_DIST = polkit-bash-completion.sh _polkit _polkit_auth _polkit_action
+
+ clean-local :
+ rm -f *~ polkit-reload-config
+diff --git a/tools/_polkit b/tools/_polkit
+new file mode 100644
+index 0000000..bc7bdac
+--- /dev/null
++++ b/tools/_polkit
+@@ -0,0 +1,54 @@
++#autoload
++
++# vim: set et sw=3 sts=3 ts=3 ft=zsh:
++# ZSH Completion for polkit-auth
++# Written by Saleem Abdulrasool <compnerd@compnerd.org>
++# Usage: _polkit actions|constraints|authorization|overriden-actions|obtainable-actions|authorized-actions
++
++_polkit_actions() {
++ local actions
++ actions=( $(polkit-action) )
++ compadd "$@" -k actions
++}
++
++_polkit_constraints() {
++ local constraints
++ constraints=( local active local+active )
++ compadd "$@" -k constraints
++}
++
++_polkit_authorization() {
++ local authorization
++ authorization=( no auth_admin_one_shot auth_admin auth_admin_keep_session auth_admin_keep_always auth_self_one_shot auth_self auth_self_keep_session auth_self_keep_always yes )
++ compadd "$@" -k authorization
++}
++
++_polkit_overriden_actions() {
++ local overrides
++ overrides=( $(polkit-action --show-overrides) )
++ compadd "$@" -k overrides
++}
++
++_polkit_obtainable_actions() {
++ local actions
++ actions=( $(polkit-auth --show-obtainable) )
++ compadd "$@" -k actions
++}
++
++_polkit_authorized_actions() {
++ local actions
++ actions=( $(polkit-auth --explicit) )
++ compadd "$@" -k actions
++}
++
++_polkit() {
++ local command="$argv[$#]"
++
++ [[ "$command" == (actions|constraints|authorization|overriden-actions|obtainable-actions|authorized-actions) ]] || {
++ _message "unknown command: $command"
++ }
++
++ _polkit_${command/-/_}
++}
++
++_polkit "$@"
+diff --git a/tools/_polkit_action b/tools/_polkit_action
+new file mode 100644
+index 0000000..7ec7365
+--- /dev/null
++++ b/tools/_polkit_action
+@@ -0,0 +1,24 @@
++#compdef polkit-action
++
++# vim: set et sw=3 sts=3 ts=3 ft=zsh:
++# ZSH Completion for polkit-action
++# Written by Saleem Abdulrasool <compnerd@compnerd.org>
++
++_polkit_action() {
++ local arguments
++
++ arguments=(
++ "(-)--action[Show detailed information about a specific action]:action:_polkit actions"
++ "(-)--reset-defaults[Reset the defaults for the specified action]:Overridden Action:_polkit overriden-actions"
++ "(-)--show-overrides[List actions where the defaults are overridden]"
++ "(-)--set-defaults-any[Override the any stanza for an action]:Action:_polkit _actions:Authorization:_polkit authorization"
++ "(-)--set-defaults-inactive[Override the inactive stanza for an action]:Action:polkit _actions:Authorization:_polkit authorization"
++ "(-)--set-defaults-active[Override the active stanza for an action]:Action:polkit _actions:Authorization:_polkit authorization"
++ "(-)--version[Display program version]"
++ "(-)--help[Display program help]"
++ )
++
++ _arguments $arguments
++}
++
++_polkit_action "$@"
+diff --git a/tools/_polkit_auth b/tools/_polkit_auth
+new file mode 100644
+index 0000000..e70f1a0
+--- /dev/null
++++ b/tools/_polkit_auth
+@@ -0,0 +1,50 @@
++#compdef polkit-auth
++
++# vim: set et sw=3 sts=3 ts=3 ft=zsh:
++# ZSH Completion for polkit-auth
++# Written by Saleem Abdulrasool <compnerd@compnerd.org>
++
++_polkit_auth() {
++ local arguments action_arguments user_arguments grant_arguments
++ local commands actions grant=0
++
++ commands=( --show-obtainable --version --help )
++ actions=( --obtain --explicit --explicit-detail --grant --revoke )
++
++ for (( i = 0 ; i < ${#words[@]} ; i++ )) ; do
++ if [[ "${words[$i]##--#}" == "grant" ]] ; then
++ grant=1
++ break
++ fi
++ done
++
++ arguments=(
++ '(-)--show-obtainable[Show all actions that can be obtained via authentication]'
++ '(-)--version[Show version and exit]'
++ '(-)--help[Show help information]'
++ )
++
++ action_arguments=(
++ "($commands $actions)--obtain[Attempt to obtain authorization to do an action]:Obtainable Actions:_polkit obtainable-actions"
++ "($commands $actions)--explicit[Show explicit authorizations]"
++ "($commands $actions)--explicit-detail[Show detailed information about explicit authorizations]"
++ "($commands $actions)--grant[Grant an authorization for an action]:Obtainable Actions:_polkit actions"
++ "($commands $actions)--revoke[Revoke all authorization for an action]:Authorized Actions:_polkit authorized-actions"
++ )
++
++ user_arguments=(
++ "($commands)--user[The user the authorization applies to]:User:_users"
++ )
++
++ grant_arguments=(
++ "($commands)--constraint[Optional constraints on the granted authorization]:Constraint:_polkit constraints"
++ )
++
++ if [[ grant -eq 1 ]] ; then
++ _arguments $arguments $user_arguments $action_arguments $grant_arguments
++ else
++ _arguments $arguments $user_arguments $action_arguments
++ fi
++}
++
++_polkit_auth "$@"
diff --git a/sys-auth/policykit/files/policykit-0.9-consolekit03.patch b/sys-auth/policykit/files/policykit-0.9-consolekit03.patch
new file mode 100644
index 000000000000..fe0abd8d6aed
--- /dev/null
+++ b/sys-auth/policykit/files/policykit-0.9-consolekit03.patch
@@ -0,0 +1,86 @@
+# Description: Make PolicyKit work with ConsoleKit 0.3 API as well
+# Ubuntu: https://bugs.launchpad.net/273711
+# Upstream: http://cvs.fedoraproject.org/viewvc/rpms/PolicyKit/devel/pk-ck-api-change.patch?view=markup
+--- policykit-0.9/src/polkit-dbus/polkit-dbus.c 2008-05-30 23:24:44.000000000 +0200
++++ policykit-0.9.new/src/polkit-dbus/polkit-dbus.c 2008-09-24 13:40:37.000000000 +0200
+@@ -214,11 +214,17 @@
+ dbus_message_unref (reply);
+ goto out;
+ }
++ /* GetUnixUser API Changed in CK 0.3.0 */
+ if (!dbus_message_get_args (reply, NULL,
+- DBUS_TYPE_INT32, &uid,
++ DBUS_TYPE_UINT32, &uid,
+ DBUS_TYPE_INVALID)) {
+- kit_warning ("Invalid GetUnixUser reply from CK");
+- goto out;
++ /* try the older API */
++ if (!dbus_message_get_args (reply, NULL,
++ DBUS_TYPE_INT32, &uid,
++ DBUS_TYPE_INVALID)) {
++ kit_warning ("Invalid GetUnixUser reply from CK");
++ goto out;
++ }
+ }
+ dbus_message_unref (message);
+ dbus_message_unref (reply);
+@@ -1326,16 +1332,21 @@
+
+ dbus_error_init (&error);
+ seat_objpath = dbus_message_get_path (message);
+- if (!dbus_message_get_args (message, &error,
+- DBUS_TYPE_STRING, &session_objpath,
++ /* API fixed in CK 0.3 to match spec */
++ if (!dbus_message_get_args (message, &error,
++ DBUS_TYPE_OBJECT_PATH, &session_objpath,
+ DBUS_TYPE_INVALID)) {
++ if (!dbus_message_get_args (message, &error,
++ DBUS_TYPE_STRING, &session_objpath,
++ DBUS_TYPE_INVALID)) {
++
++ /* TODO: should be _pk_critical */
++ kit_warning ("The SessionAdded signal on the org.freedesktop.ConsoleKit.Seat "
++ "interface for object %s has the wrong signature! "
++ "Your system is misconfigured.", seat_objpath);
+
+- /* TODO: should be _pk_critical */
+- kit_warning ("The SessionAdded signal on the org.freedesktop.ConsoleKit.Seat "
+- "interface for object %s has the wrong signature! "
+- "Your system is misconfigured.", seat_objpath);
+-
+- goto out;
++ goto out;
++ }
+ }
+
+ /* TODO: add to sessions - see polkit_tracker_is_authorization_relevant() */
+@@ -1353,16 +1364,21 @@
+
+ dbus_error_init (&error);
+ seat_objpath = dbus_message_get_path (message);
+- if (!dbus_message_get_args (message, &error,
+- DBUS_TYPE_STRING, &session_objpath,
++ /* API fixed in CK 0.3 to match spec */
++ if (!dbus_message_get_args (message, &error,
++ DBUS_TYPE_OBJECT_PATH, &session_objpath,
+ DBUS_TYPE_INVALID)) {
++ if (!dbus_message_get_args (message, &error,
++ DBUS_TYPE_STRING, &session_objpath,
++ DBUS_TYPE_INVALID)) {
++
++ /* TODO: should be _pk_critical */
++ kit_warning ("The SessionRemoved signal on the org.freedesktop.ConsoleKit.Seat "
++ "interface for object %s has the wrong signature! "
++ "Your system is misconfigured.", seat_objpath);
+
+- /* TODO: should be _pk_critical */
+- kit_warning ("The SessionRemoved signal on the org.freedesktop.ConsoleKit.Seat "
+- "interface for object %s has the wrong signature! "
+- "Your system is misconfigured.", seat_objpath);
+-
+- goto out;
++ goto out;
++ }
+ }
+
+ _remove_caller_by_session (pk_tracker, session_objpath);
diff --git a/sys-auth/policykit/files/policykit-0.9-pam-headers.patch b/sys-auth/policykit/files/policykit-0.9-pam-headers.patch
new file mode 100644
index 000000000000..b3b8e3ca35ee
--- /dev/null
+++ b/sys-auth/policykit/files/policykit-0.9-pam-headers.patch
@@ -0,0 +1,17 @@
+# Remove unwanted pam header
+#
+# Gentoo: https://bugs.gentoo.org/show_bug.cgi?id=239554
+# Upstream: https://bugs.freedesktop.org/show_bug.cgi?id=16131
+#
+diff --git a/src/polkit-dbus/polkit-resolve-exe-helper.c b/src/polkit-dbus/polkit-resolve-exe-helper.c
+index c56b2f5..5992b67 100644
+--- a/src/polkit-dbus/polkit-resolve-exe-helper.c
++++ b/src/polkit-dbus/polkit-resolve-exe-helper.c
+@@ -43,7 +43,6 @@
+ #ifdef HAVE_FREEBSD
+ #include <sys/param.h>
+ #endif
+-#include <security/pam_appl.h>
+ #include <grp.h>
+ #include <pwd.h>
+ #include <syslog.h>
diff --git a/sys-auth/policykit/files/policykit-0.9-pk-debug.patch b/sys-auth/policykit/files/policykit-0.9-pk-debug.patch
new file mode 100644
index 000000000000..e2e247804fc7
--- /dev/null
+++ b/sys-auth/policykit/files/policykit-0.9-pk-debug.patch
@@ -0,0 +1,17 @@
+#
+# Fix use of undefined _pk_debug
+#
+# Gentoo: https://bugs.gentoo.org/show_bug.cgi?id=239573
+# Upstream: https://bugs.freedesktop.org/show_bug.cgi?id=17904
+#
+--- a/src/polkit/polkit-authorization-db-dummy.c 2008-05-31 07:24:44.000000000 +1000
++++ b/src/polkit/polkit-authorization-db-dummy.c 2008-10-05 03:54:29.000000000 +1100
+@@ -105,7 +105,7 @@
+ polkit_authorization_db_debug (PolKitAuthorizationDB *authdb)
+ {
+ kit_return_if_fail (authdb != NULL);
+- _pk_debug ("PolKitAuthorizationDB: refcount=%d", authdb->refcount);
++ polkit_debug ("PolKitAuthorizationDB: refcount=%d", authdb->refcount);
+ }
+
+ polkit_bool_t
diff --git a/sys-auth/policykit/metadata.xml b/sys-auth/policykit/metadata.xml
index 7a6f22547f03..92af3b17766c 100644
--- a/sys-auth/policykit/metadata.xml
+++ b/sys-auth/policykit/metadata.xml
@@ -6,6 +6,9 @@
<name>Saleem Abdulrasool</name>
</maintainer>
<herd>gentopia</herd>
+ <use>
+ <flag name="zsh-completion">Install zsh command completion.</flag>
+ </use>
<longdescription lang="en">
</longdescription>
</pkgmetadata>
diff --git a/sys-auth/policykit/policykit-0.9.ebuild b/sys-auth/policykit/policykit-0.9.ebuild
new file mode 100644
index 000000000000..529f6ec56e35
--- /dev/null
+++ b/sys-auth/policykit/policykit-0.9.ebuild
@@ -0,0 +1,126 @@
+# Copyright 1999-2008 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/sys-auth/policykit/policykit-0.9.ebuild,v 1.1 2008/12/01 22:13:40 eva Exp $
+
+inherit autotools bash-completion eutils multilib pam
+
+MY_PN="PolicyKit"
+
+DESCRIPTION="Policy framework for controlling privileges for system-wide services"
+HOMEPAGE="http://hal.freedesktop.org/docs/PolicyKit"
+SRC_URI="http://hal.freedesktop.org/releases/${MY_PN}-${PV}.tar.gz"
+
+LICENSE="MIT"
+SLOT="0"
+KEYWORDS="~alpha ~amd64 ~hppa ~ia64 ~ppc64 ~sparc ~x86"
+IUSE="bash-completion doc pam selinux zsh-completion"
+
+RDEPEND=">=dev-libs/glib-2.6
+ >=dev-libs/dbus-glib-0.73
+ dev-libs/expat
+ pam? ( virtual/pam )
+ selinux? ( sys-libs/libselinux )"
+DEPEND="${RDEPEND}
+ dev-libs/libxslt
+ app-text/docbook-xsl-stylesheets
+ >=dev-util/pkgconfig-0.18
+ >=dev-util/intltool-0.36
+ >=dev-util/gtk-doc-am-1.10-r1
+ doc? ( >=dev-util/gtk-doc-1.10 )"
+
+S="${WORKDIR}/${MY_PN}-${PV}"
+
+pkg_setup() {
+ enewgroup polkituser
+ enewuser polkituser -1 "-1" /dev/null polkituser
+}
+
+src_unpack() {
+ unpack ${A}
+ cd "${S}"
+
+ # Add zsh/bash completion
+ epatch "${FILESDIR}/${PN}-0.7-completions.patch"
+
+ # Fix use of undefined _pk_debug, bug #239573
+ epatch "${FILESDIR}/${P}-pk-debug.patch"
+
+ # Fix useless pam header inclusion, bug #239554
+ epatch "${FILESDIR}/${P}-pam-headers.patch"
+
+ # Fix API change in consolekit 0.3
+ epatch "${FILESDIR}/${P}-consolekit03.patch"
+
+ eautoreconf
+}
+
+src_compile() {
+ local authdb=
+
+ if use pam ; then
+ authdb="--with-authdb=default --with-authfw=pam --with-pam-module-dir=$(getpam_mod_dir)"
+ else
+ authdb="--with-authdb=dummy --with-authfw=none"
+ fi
+
+ econf ${authdb} \
+ --without-bash-completion \
+ --without-zsh-completion \
+ --enable-man-pages \
+ --with-os-type=gentoo \
+ --with-polkit-user=polkituser \
+ --with-polkit-group=polkituser \
+ $(use_enable doc gtk-doc) \
+ $(use_enable selinux) \
+ --localstatedir=/var
+ # won't install with tests
+ # $(use_enable test tests) \
+ emake || die "emake failed"
+}
+
+src_install() {
+ emake DESTDIR="${D}" install || die "emake install failed"
+
+ dodoc NEWS README AUTHORS ChangeLog
+
+ if use bash-completion; then
+ dobashcompletion "${S}/tools/polkit-bash-completion.sh"
+ fi
+
+ if use zsh-completion ; then
+ insinto /usr/share/zsh/site-functions
+ doins "${S}/tools/_polkit" || die "zsh completion died"
+ doins "${S}/tools/_polkit_auth" || die "zsh completion died"
+ doins "${S}/tools/_polkit_action" || die "zsh completion died"
+ fi
+
+ einfo "Installing basic PolicyKit.conf"
+ insinto /etc/PolicyKit
+ doins "${FILESDIR}"/PolicyKit.conf
+ # Need to keep a few directories around...
+
+ diropts -m0770 -o root -g polkituser
+ keepdir /var/run/PolicyKit
+ keepdir /var/lib/PolicyKit
+}
+
+pkg_preinst() {
+ # Stolen from vixie-cron ebuilds
+ has_version "<${CATEGORY}/${PN}-0.9"
+ fix_var_dir_perms=$?
+}
+
+pkg_postinst() {
+ # bug #239231
+ if [[ $fix_var_dir_perms = 0 ]] ; then
+ echo
+ ewarn "Previous version of PolicyKit handled /var/run and /var/lib"
+ ewarn "with different permissions. Proper permissions are"
+ ewarn "now being set on ${ROOT}var/lib/PolicyKit and ${ROOT}var/lib/PolicyKit"
+ ewarn "Look at these directories if you have a specific configuration"
+ ewarn "that needs special ownerships or permissions."
+ echo
+ chmod 0770 "${ROOT}"var/{lib,run}/PolicyKit || die "chmod failed"
+ chgrp -R polkituser "${ROOT}"var/{lib,run}/PolicyKit || die "chgrp failed"
+ fi
+}