summaryrefslogtreecommitdiff
path: root/extra/polkit
diff options
context:
space:
mode:
Diffstat (limited to 'extra/polkit')
-rw-r--r--extra/polkit/PKGBUILD24
-rwxr-xr-xextra/polkit/autogen.sh123
-rw-r--r--extra/polkit/fix-empty-wheel.patch47
-rw-r--r--extra/polkit/polkit.install18
4 files changed, 205 insertions, 7 deletions
diff --git a/extra/polkit/PKGBUILD b/extra/polkit/PKGBUILD
index e95a35d00..174dac9ae 100644
--- a/extra/polkit/PKGBUILD
+++ b/extra/polkit/PKGBUILD
@@ -1,26 +1,33 @@
-# $Id: PKGBUILD 158972 2012-05-13 21:06:37Z jgc $
+# $Id: PKGBUILD 169989 2012-10-30 23:00:46Z heftig $
# Maintainer: Jan de Groot <jgc@archlinux.org>
pkgname=polkit
-pkgver=0.105
-pkgrel=1
+pkgver=0.107
+pkgrel=4
pkgdesc="Application development toolkit for controlling system-wide privileges"
arch=(i686 x86_64 'mips64el')
license=('LGPL')
url="http://www.freedesktop.org/wiki/Software/PolicyKit"
-depends=('glib2' 'pam' 'expat')
+depends=('glib2' 'pam' 'expat' 'libsystemd' 'js')
makedepends=('intltool' 'gtk-doc' 'gobject-introspection')
replaces=('policykit')
options=('!libtool')
+install=polkit.install
source=(http://www.freedesktop.org/software/polkit/releases/$pkgname-$pkgver.tar.gz
- polkit.pam)
-md5sums=('9c29e1b6c214f0bd6f1d4ee303dfaed9'
- '6564f95878297b954f0572bc1610dd15')
+ polkit.pam fix-empty-wheel.patch)
+md5sums=('0e4f9c53f43fd1b25ac3f0d2e09b2ae1'
+ '6564f95878297b954f0572bc1610dd15'
+ 'c99ab2a7919ad0b69fde4804c043b07f')
build() {
cd $pkgname-$pkgver
+
+ # https://bugs.archlinux.org/task/31717
+ patch -Np1 -i ../fix-empty-wheel.patch
+
./configure --prefix=/usr --sysconfdir=/etc \
--localstatedir=/var --libexecdir=/usr/lib/polkit-1 \
+ --with-systemdsystemunitdir=/usr/lib/systemd/system \
--disable-static --enable-gtk-doc
make
}
@@ -29,5 +36,8 @@ package() {
cd $pkgname-$pkgver
make DESTDIR="$pkgdir" install
+ chown 102 "$pkgdir/etc/polkit-1/rules.d"
+ chown 102 "$pkgdir/usr/share/polkit-1/rules.d"
+
install -m644 "$srcdir/polkit.pam" "$pkgdir/etc/pam.d/polkit-1"
}
diff --git a/extra/polkit/autogen.sh b/extra/polkit/autogen.sh
new file mode 100755
index 000000000..d08b00a49
--- /dev/null
+++ b/extra/polkit/autogen.sh
@@ -0,0 +1,123 @@
+#!/bin/sh
+# Run this to generate all the initial makefiles, etc.
+
+srcdir=`dirname $0`
+test -z "$srcdir" && srcdir=.
+
+DIE=0
+
+(test -f $srcdir/configure.ac) || {
+ echo -n "**Error**: Directory $srcdir does not look like the"
+ echo " top-level package directory"
+ exit 1
+}
+
+olddir=`pwd`
+cd "$srcdir"
+
+touch ChangeLog
+
+(autoconf --version) < /dev/null > /dev/null 2>&1 || {
+ echo
+ echo "**Error**: You must have autoconf installed."
+ echo "Download the appropriate package for your distribution,"
+ echo "or get the source tarball at ftp://ftp.gnu.org/pub/gnu/"
+ DIE=1
+}
+
+(grep "^AM_PROG_LIBTOOL" configure.ac >/dev/null) && {
+ (libtoolize --version) < /dev/null > /dev/null 2>&1 || {
+ echo
+ echo "**Error**: You must have libtool installed."
+ echo "You can get it from: ftp://ftp.gnu.org/pub/gnu/"
+ DIE=1
+ }
+}
+
+(gtkdocize --flavour no-tmpl) < /dev/null > /dev/null 2>&1 || {
+ echo
+ echo "You must have gtk-doc installed to compile $PROJECT."
+ echo "Install the appropriate package for your distribution,"
+ echo "or get the source tarball at http://ftp.gnome.org/pub/GNOME/sources/gtk-doc/"
+ DIE=1
+}
+
+(automake --version) < /dev/null > /dev/null 2>&1 || {
+ echo
+ echo "**Error**: You must have automake installed."
+ echo "You can get it from: ftp://ftp.gnu.org/pub/gnu/"
+ DIE=1
+ NO_AUTOMAKE=yes
+}
+
+
+# if no automake, don't bother testing for aclocal
+test -n "$NO_AUTOMAKE" || (aclocal --version) < /dev/null > /dev/null 2>&1 || {
+ echo
+ echo "**Error**: Missing aclocal. The version of automake"
+ echo "installed doesn't appear recent enough."
+ echo "You can get automake from ftp://ftp.gnu.org/pub/gnu/"
+ DIE=1
+}
+
+
+# if no automake, don't bother testing for autoreconf
+test -n "$NO_AUTOMAKE" || (autoreconf --version) < /dev/null > /dev/null 2>&1 || {
+ echo
+ echo "**Error**: You must have autoreconf installed."
+ echo "You can get autoreconf from ..."
+ DIE=1
+}
+
+
+if test "$DIE" -eq 1; then
+ exit 1
+fi
+
+if test -z "$*"; then
+ echo "**Warning**: I am going to run configure with no arguments."
+ echo "If you wish to pass any to it, please specify them on the"
+ echo $0 " command line."
+ echo
+fi
+
+case $CC in
+xlc )
+ am_opt=--include-deps;;
+esac
+
+ aclocalinclude="$ACLOCAL_FLAGS"
+
+ echo "Running autoreconf on test/mocklibc ..."
+ (cd "test/mocklibc"; autoreconf --install)
+
+ if grep "^AM_PROG_LIBTOOL" configure.ac >/dev/null; then
+ if test -z "$NO_LIBTOOLIZE" ; then
+ echo "Running libtoolize..."
+ libtoolize --force --copy
+ fi
+ fi
+ echo "Running aclocal $aclocalinclude ..."
+ aclocal $aclocalinclude
+ if grep "^AM_CONFIG_HEADER" configure.ac >/dev/null; then
+ echo "Running autoheader..."
+ autoheader
+ fi
+ echo "Running automake --gnu -Wno-portability $am_opt ..."
+ automake --add-missing --gnu -Wno-portability $am_opt
+ echo "Running autoconf ..."
+ autoconf
+
+intltoolize --copy --force --automake || exit 1
+
+cd "$olddir"
+
+conf_flags="--enable-maintainer-mode --enable-gtk-doc"
+
+if test x$NOCONFIGURE = x; then
+ echo "Running $srcdir/configure $conf_flags $@ ..."
+ $srcdir/configure $conf_flags "$@" \
+ && echo "Now type make to compile." || exit 1
+else
+ echo "Skipping configure process."
+fi
diff --git a/extra/polkit/fix-empty-wheel.patch b/extra/polkit/fix-empty-wheel.patch
new file mode 100644
index 000000000..d6f99c43d
--- /dev/null
+++ b/extra/polkit/fix-empty-wheel.patch
@@ -0,0 +1,47 @@
+From fa04223240d46641b0773dbf9f7d72f529046bea Mon Sep 17 00:00:00 2001
+From: David Zeuthen <zeuthen@gmail.com>
+Date: Tue, 18 Sep 2012 18:47:06 +0000
+Subject: Fall back to authenticating as uid 0 if the list of admin identities is empty
+
+For example, this can happen if the wheel group has no members. This
+was reported in Red Hat bug 834494, see
+
+ https://bugzilla.redhat.com/show_bug.cgi?id=834494
+
+Signed-off-by: David Zeuthen <zeuthen@gmail.com>
+---
+diff --git a/src/polkitbackend/polkitbackendinteractiveauthority.c b/src/polkitbackend/polkitbackendinteractiveauthority.c
+index 1d4a555..3bd2f0b 100644
+--- a/src/polkitbackend/polkitbackendinteractiveauthority.c
++++ b/src/polkitbackend/polkitbackendinteractiveauthority.c
+@@ -1293,15 +1293,11 @@ polkit_backend_interactive_authority_get_admin_identities (PolkitBackendInteract
+ PolkitDetails *details)
+ {
+ PolkitBackendInteractiveAuthorityClass *klass;
+- GList *ret;
++ GList *ret = NULL;
+
+ klass = POLKIT_BACKEND_INTERACTIVE_AUTHORITY_GET_CLASS (authority);
+
+- if (klass->get_admin_identities == NULL)
+- {
+- ret = g_list_prepend (NULL, polkit_unix_user_new (0));
+- }
+- else
++ if (klass->get_admin_identities != NULL)
+ {
+ ret = klass->get_admin_identities (authority,
+ caller,
+@@ -2257,6 +2253,10 @@ authentication_agent_initiate_challenge (AuthenticationAgent *agent,
+ }
+ }
+
++ /* Fall back to uid 0 if no users are available (rhbz #834494) */
++ if (user_identities == NULL)
++ user_identities = g_list_prepend (NULL, polkit_unix_user_new (0));
++
+ session = authentication_session_new (agent,
+ cookie,
+ subject,
+--
+cgit v0.9.0.2-2-gbebe
diff --git a/extra/polkit/polkit.install b/extra/polkit/polkit.install
new file mode 100644
index 000000000..fbb98919e
--- /dev/null
+++ b/extra/polkit/polkit.install
@@ -0,0 +1,18 @@
+post_install() {
+ getent group polkitd >/dev/null || groupadd -g 102 polkitd
+ getent passwd polkitd >/dev/null || useradd -c 'Policy Kit Daemon' -u 102 -g polkitd -d '/' -s /bin/false polkitd
+ passwd -l polkitd &>/dev/null
+}
+
+post_upgrade() {
+ post_install
+}
+
+post_remove() {
+ if getent passwd polkitd >/dev/null; then
+ userdel polkitd
+ fi
+ if getent group polkitd >/dev/null; then
+ groupdel polkitd
+ fi
+}