diff options
author | Natanael Copa <ncopa@alpinelinux.org> | 2010-09-27 12:28:50 +0000 |
---|---|---|
committer | Natanael Copa <ncopa@alpinelinux.org> | 2010-09-27 12:28:50 +0000 |
commit | 8a8ef1ba2a601a79dc31b938a73ac15726d1b16f (patch) | |
tree | 33a1308ede239c8d12e43386543b18a8b7cbc83d | |
parent | cb335e4dfc973aa53625a749b36fc5e87551f2a7 (diff) | |
parent | 2f5252058c88098adcddfb3f3406b1e8ed808b2c (diff) | |
download | aports-8a8ef1ba2a601a79dc31b938a73ac15726d1b16f.tar.bz2 aports-8a8ef1ba2a601a79dc31b938a73ac15726d1b16f.tar.xz |
Merge remote branch 'clandmeter/master'
-rw-r--r-- | main/eggdbus/APKBUILD | 38 | ||||
-rw-r--r-- | main/glib/APKBUILD | 6 | ||||
-rw-r--r-- | main/glproto/APKBUILD | 4 | ||||
-rw-r--r-- | main/libatasmart/APKBUILD | 39 | ||||
-rw-r--r-- | main/libx11/APKBUILD | 4 | ||||
-rw-r--r-- | main/lvm2/APKBUILD | 13 | ||||
-rw-r--r-- | main/pixman/APKBUILD | 4 | ||||
-rw-r--r-- | main/polkit/APKBUILD | 51 | ||||
-rw-r--r-- | main/polkit/polkit-1-shadow.diff | 1030 | ||||
-rw-r--r-- | main/renderproto/APKBUILD | 4 | ||||
-rw-r--r-- | main/sg3_utils/APKBUILD | 36 | ||||
-rw-r--r-- | main/udisks/APKBUILD | 46 | ||||
-rw-r--r-- | main/udisks/lvm.patch | 120 | ||||
-rw-r--r-- | main/udisks/no-floppy.patch | 31 |
14 files changed, 1410 insertions, 16 deletions
diff --git a/main/eggdbus/APKBUILD b/main/eggdbus/APKBUILD new file mode 100644 index 0000000000..d2ba1c52ed --- /dev/null +++ b/main/eggdbus/APKBUILD @@ -0,0 +1,38 @@ +# Contributor: Carlo Landmeter +# Maintainer: +pkgname=eggdbus +pkgver=0.6 +pkgrel=0 +pkgdesc="Experimental D-Bus bindings for GObject" +url="http://www.freedesktop.org/wiki/Software/Policykit" +license="GPL" +depends="" +makedepends="glib-dev dbus-glib-dev" +install= +subpackages="$pkgname-dev $pkgname-doc" +source="http://hal.freedesktop.org/releases/$pkgname-$pkgver.tar.gz" + +_builddir="$srcdir"/$pkgname-$pkgver + +prepare() { + cd "$_builddir" + # apply patches here +} + +build() { + cd "$_builddir" + ./configure --prefix=/usr \ + --sysconfdir=/etc \ + --mandir=/usr/share/man \ + --infodir=/usr/share/info \ + --disable-static + + make -j1 || return 1 +} + +package() { + cd "$_builddir" + make DESTDIR="$pkgdir" install +} + +md5sums="b43d2a6c523fcb8b9d0b0300c4222386 eggdbus-0.6.tar.gz" diff --git a/main/glib/APKBUILD b/main/glib/APKBUILD index b58305b70b..f621b61cd2 100644 --- a/main/glib/APKBUILD +++ b/main/glib/APKBUILD @@ -1,7 +1,7 @@ # Maintainer: Natanael Copa <ncopa@alpinelinux.org> pkgname=glib -pkgver=2.24.2 -pkgrel=1 +pkgver=2.25.17 +pkgrel=0 pkgdesc="Common C routines used by Gtk+ and other libs" url="http://www.gtk.org" license='GPL' @@ -38,4 +38,4 @@ dev() { mv "$pkgdir"/usr/bin "$subpkgdir"/usr/ } -md5sums="8a6e45d7840460ed84288ebfd75782d4 glib-2.24.2.tar.bz2" +md5sums="335c448c05cff9c296b37f47eb019f3a glib-2.25.17.tar.bz2" diff --git a/main/glproto/APKBUILD b/main/glproto/APKBUILD index 1ec45c7488..185a6c7bf8 100644 --- a/main/glproto/APKBUILD +++ b/main/glproto/APKBUILD @@ -1,6 +1,6 @@ # Maintainer: Natanael Copa <ncopa@alpinelinux.org> pkgname=glproto -pkgver=1.4.11 +pkgver=1.4.12 pkgrel=0 pkgdesc="X11 OpenGL extension wire protocol" url="http://xorg.freedesktop.org/" @@ -19,4 +19,4 @@ package() { cd "$srcdir"/$pkgname-$pkgver make DESTDIR="$pkgdir" install || return 1 } -md5sums="78e7c4dc7dcb74b1869fee7897e00f59 glproto-1.4.11.tar.bz2" +md5sums="55edc5ff2efb734215c868f72f7cf27e glproto-1.4.12.tar.bz2" diff --git a/main/libatasmart/APKBUILD b/main/libatasmart/APKBUILD new file mode 100644 index 0000000000..ad2fb1ecc8 --- /dev/null +++ b/main/libatasmart/APKBUILD @@ -0,0 +1,39 @@ +# Contributor: Carlo Landmeter +# Maintainer: +pkgname=libatasmart +pkgver=0.17 +pkgrel=0 +pkgdesc="ATA S.M.A.R.T. Reading and Parsing Library" +url="http://0pointer.de/blog/projects/being-smart.html" +license="GPL" +depends= +makedepends="udev-dev" +install= +subpackages="$pkgname-dev $pkgname-doc" +source="http://0pointer.de/public/$pkgname-$pkgver.tar.gz" + +_builddir="$srcdir"/$pkgname-$pkgver + +prepare() { + cd "$_builddir" + # apply patches here +} + +build() { + cd "$_builddir" + ./configure --prefix=/usr \ + --sysconfdir=/etc \ + --mandir=/usr/share/man \ + --infodir=/usr/share/info \ + --disable-static \ + --localstatedir=/var + + make || return 1 +} + +package() { + cd "$_builddir" + make DESTDIR="$pkgdir" install +} + +md5sums="dc36cadbbb7fa38f8af175713eda1a21 libatasmart-0.17.tar.gz" diff --git a/main/libx11/APKBUILD b/main/libx11/APKBUILD index 69bd313a68..f1a31b4243 100644 --- a/main/libx11/APKBUILD +++ b/main/libx11/APKBUILD @@ -1,6 +1,6 @@ # Maintainer: Natanael Copa <ncopa@alpinelinux.org> pkgname=libx11 -pkgver=1.3.5 +pkgver=1.3.6 pkgrel=0 pkgdesc="X11 client-side library" url="http://xorg.freedesktop.org/" @@ -28,4 +28,4 @@ package() { install -Dm644 COPYING "$pkgdir"/usr/share/licenses/$pkgname/COPYING } -md5sums="a1175b6667fcb249c6f1d725965944e3 libX11-1.3.5.tar.bz2" +md5sums="8e0a8a466aa78f66e09fe06cb395319f libX11-1.3.6.tar.bz2" diff --git a/main/lvm2/APKBUILD b/main/lvm2/APKBUILD index e7a510f5aa..f46dad7072 100644 --- a/main/lvm2/APKBUILD +++ b/main/lvm2/APKBUILD @@ -1,12 +1,12 @@ # Maintainer: Natanael Copa <ncopa@alpinelinux.org> pkgname=lvm2 -pkgver=2.02.73 +pkgver=2.02.74 pkgrel=0 pkgdesc="Logical Volume Manager 2 utilities" url="http://sourceware.org/lvm2/" license="GPL" depends= -makedepends="readline-dev" +makedepends="readline-dev pkgconfig" source="ftp://sources.redhat.com/pub/$pkgname/LVM2.$pkgver.tgz lvm.initd lvm.confd @@ -22,6 +22,7 @@ build () { --sbindir=/sbin \ --localstatedir=/var \ --disable-nls \ + --enable-pkgconfig \ CLDFLAGS="$LDFLAGS" \ || return 1 @@ -32,12 +33,14 @@ build () { package() { cd "$srcdir"/LVM2.$pkgver make -j1 DESTDIR="$pkgdir" \ - usrlibdir="$pkgdir"/lib \ install || return 1 - + #usrlibdir="$pkgdir"/lib \ install -d "$pkgdir"/etc/lvm/archive "$pkgdir"/etc/lvm/backup install -Dm755 "$srcdir"/lvm.initd "$pkgdir"/etc/init.d/lvm install -Dm644 "$srcdir"/lvm.confd "$pkgdir"/etc/conf.d/lvm + # some packages need this iin usr/lib + cd "$pkgdir"/lib || return 1 + ln -s libdevmapper.so.1.02 libdevmapper.so || return 1 } dm() { @@ -47,6 +50,6 @@ dm() { mv "$pkgdir"/sbin/dm* "$subpkgdir"/sbin/ } -md5sums="ef975c33e224b3a2c057313d29718d91 LVM2.2.02.73.tgz +md5sums="3f86b528310183cad73c81c8efda0c34 LVM2.2.02.74.tgz 6f65f902cf19f144a42b8d6aceadf395 lvm.initd ec36d5fe4561220304e406c5c797e71f lvm.confd" diff --git a/main/pixman/APKBUILD b/main/pixman/APKBUILD index a626c1196a..008638283f 100644 --- a/main/pixman/APKBUILD +++ b/main/pixman/APKBUILD @@ -1,6 +1,6 @@ # Maintainer: Natanael Copa <ncopa@alpinelinux.org> pkgname=pixman -pkgver=0.18.4 +pkgver=0.19.4 pkgrel=0 pkgdesc="Pixman library" url="http://xorg.freedesktop.org" @@ -21,4 +21,4 @@ package() { cd "$srcdir"/$pkgname-$pkgver make DESTDIR="$pkgdir" install || return 1 } -md5sums="c1d69aaddba8c1e046d26ac125da95bf pixman-0.18.4.tar.bz2" +md5sums="dfbfbd46221246edd3be702ea65084aa pixman-0.19.4.tar.bz2" diff --git a/main/polkit/APKBUILD b/main/polkit/APKBUILD new file mode 100644 index 0000000000..6a1cbde748 --- /dev/null +++ b/main/polkit/APKBUILD @@ -0,0 +1,51 @@ +# Contributor: Carlo Landmeter +# Maintainer: +pkgname=polkit +_pkgname=PolicyKit +pkgver=0.96 +pkgrel=0 +pkgdesc="Application development toolkit for controlling system-wide privileges" +url="http://www.freedesktop.org/wiki/Software/PolicyKit" +license="LGPL" +depends= +makedepends="expat-dev glib-dev eggdbus-dev intltool dbus-glib-dev autoconf + libtool automake gtk-doc" +install= +subpackages="$pkgname-dev $pkgname-doc" +source="http://cgit.freedesktop.org/PolicyKit/snapshot/PolicyKit-$pkgver.tar.bz2 + polkit-1-shadow.diff" + +_builddir="$srcdir"/$_pkgname-$pkgver + +prepare() { + cd "$_builddir" + #We do not need PAM + patch -p1 -i "$srcdir"/polkit-1-shadow.diff +} + +build() { + cd "$_builddir" + ./autogen.sh --prefix=/usr \ + --sysconfdir=/etc \ + --mandir=/usr/share/man \ + --infodir=/usr/share/info \ + --libexecdir=/usr/lib/polkit-1 \ + --localstatedir=/var \ + --disable-static \ + --disable-nls \ + --disable-introspection \ + --with-authfw=shadow \ + --disable-gtk-doc \ + --disable-gtk-doc-html \ + --disable-gtk-doc-pdf + + make || return 1 +} + +package() { + cd "$_builddir" + make DESTDIR="$pkgdir" install +} + +md5sums="fbd8d49310ad885bd559b55633b548e1 PolicyKit-0.96.tar.bz2 +3ad3c2400e8dd33e35806e7aadb964e1 polkit-1-shadow.diff" diff --git a/main/polkit/polkit-1-shadow.diff b/main/polkit/polkit-1-shadow.diff new file mode 100644 index 0000000000..56e24277d3 --- /dev/null +++ b/main/polkit/polkit-1-shadow.diff @@ -0,0 +1,1030 @@ +diff --git a/src/polkitagent/Makefile.am b/src/polkitagent/Makefile.am +index 3f38329..e114d01 100644 +--- a/src/polkitagent/Makefile.am ++++ b/src/polkitagent/Makefile.am +@@ -68,8 +68,15 @@ libpolkit_agent_1_la_LDFLAGS = -export-symbols-regex '(^polkit_.*)' + libexec_PROGRAMS = polkit-agent-helper-1 + + polkit_agent_helper_1_SOURCES = \ +- polkitagenthelper.c \ +- $(NULL) ++ polkitagenthelperprivate.c polkitagenthelperprivate.h ++ ++if POLKIT_AUTHFW_PAM ++polkit_agent_helper_1_SOURCES += polkitagenthelper-pam.c ++endif ++if POLKIT_AUTHFW_SHADOW ++polkit_agent_helper_1_SOURCES += polkitagenthelper-shadow.c ++endif ++polkit_agent_helper_1_SOURCES += $(NULL) + + polkit_agent_helper_1_CFLAGS = \ + -D_POLKIT_COMPILATION \ +diff --git a/src/polkitagent/polkitagenthelper-pam.c b/src/polkitagent/polkitagenthelper-pam.c +new file mode 100644 +index 0000000..4c6c6fb +--- /dev/null ++++ b/src/polkitagent/polkitagenthelper-pam.c +@@ -0,0 +1,264 @@ ++/* ++ * Copyright (C) 2008, 2010 Red Hat, Inc. ++ * ++ * This library is free software; you can redistribute it and/or ++ * modify it under the terms of the GNU Lesser General Public ++ * License as published by the Free Software Foundation; either ++ * version 2 of the License, or (at your option) any later version. ++ * ++ * This library is distributed in the hope that it will be useful, ++ * but WITHOUT ANY WARRANTY; without even the implied warranty of ++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ++ * Lesser General Public License for more details. ++ * ++ * You should have received a copy of the GNU Lesser General ++ * Public License along with this library; if not, write to the ++ * Free Software Foundation, Inc., 59 Temple Place, Suite 330, ++ * Boston, MA 02111-1307, USA. ++ * ++ * Author: David Zeuthen <davidz@redhat.com> ++ */ ++ ++#include "config.h" ++#include <stdio.h> ++#include <stdlib.h> ++#include <string.h> ++#include <unistd.h> ++#include <sys/types.h> ++#include <sys/stat.h> ++#include <syslog.h> ++#include <security/pam_appl.h> ++ ++#include <polkit/polkit.h> ++#include "polkitagenthelperprivate.h" ++ ++static int conversation_function (int n, const struct pam_message **msg, struct pam_response **resp, void *data); ++ ++int ++main (int argc, char *argv[]) ++{ ++ int rc; ++ const char *user_to_auth; ++ const char *cookie; ++ struct pam_conv pam_conversation; ++ pam_handle_t *pam_h; ++ const void *authed_user; ++ ++ rc = 0; ++ pam_h = NULL; ++ ++ /* clear the entire environment to avoid attacks using with libraries honoring environment variables */ ++ if (clearenv () != 0) ++ goto error; ++ ++ /* set a minimal environment */ ++ setenv ("PATH", "/usr/sbin:/usr/bin:/sbin:/bin", 1); ++ ++ /* check that we are setuid root */ ++ if (geteuid () != 0) ++ { ++ fprintf (stderr, "polkit-agent-helper-1: needs to be setuid root\n"); ++ goto error; ++ } ++ ++ openlog ("polkit-agent-helper-1", LOG_CONS | LOG_PID, LOG_AUTHPRIV); ++ ++ /* check for correct invocation */ ++ if (argc != 3) ++ { ++ syslog (LOG_NOTICE, "inappropriate use of helper, wrong number of arguments [uid=%d]", getuid ()); ++ fprintf (stderr, "polkit-agent-helper-1: wrong number of arguments. This incident has been logged.\n"); ++ goto error; ++ } ++ ++ user_to_auth = argv[1]; ++ cookie = argv[2]; ++ ++ if (getuid () != 0) ++ { ++ /* check we're running with a non-tty stdin */ ++ if (isatty (STDIN_FILENO) != 0) ++ { ++ syslog (LOG_NOTICE, "inappropriate use of helper, stdin is a tty [uid=%d]", getuid ()); ++ fprintf (stderr, "polkit-agent-helper-1: inappropriate use of helper, stdin is a tty. This incident has been logged.\n"); ++ goto error; ++ } ++ } ++ ++#ifdef PAH_DEBUG ++ fprintf (stderr, "polkit-agent-helper-1: user to auth is '%s'.\n", user_to_auth); ++#endif /* PAH_DEBUG */ ++ ++ pam_conversation.conv = conversation_function; ++ pam_conversation.appdata_ptr = NULL; ++ ++ /* start the pam stack */ ++ rc = pam_start ("polkit-1", ++ user_to_auth, ++ &pam_conversation, ++ &pam_h); ++ if (rc != PAM_SUCCESS) ++ { ++ fprintf (stderr, "polkit-agent-helper-1: pam_start failed: %s\n", pam_strerror (pam_h, rc)); ++ goto error; ++ } ++ ++ /* set the requesting user */ ++ rc = pam_set_item (pam_h, PAM_RUSER, user_to_auth); ++ if (rc != PAM_SUCCESS) ++ { ++ fprintf (stderr, "polkit-agent-helper-1: pam_set_item failed: %s\n", pam_strerror (pam_h, rc)); ++ goto error; ++ } ++ ++ /* is user really user? */ ++ rc = pam_authenticate (pam_h, 0); ++ if (rc != PAM_SUCCESS) ++ { ++ fprintf (stderr, "polkit-agent-helper-1: pam_authenticated failed: %s\n", pam_strerror (pam_h, rc)); ++ goto error; ++ } ++ ++ /* permitted access? */ ++ rc = pam_acct_mgmt (pam_h, 0); ++ if (rc != PAM_SUCCESS) ++ { ++ fprintf (stderr, "polkit-agent-helper-1: pam_acct_mgmt failed: %s\n", pam_strerror (pam_h, rc)); ++ goto error; ++ } ++ ++ /* did we auth the right user? */ ++ rc = pam_get_item (pam_h, PAM_USER, &authed_user); ++ if (rc != PAM_SUCCESS) ++ { ++ fprintf (stderr, "polkit-agent-helper-1: pam_get_item failed: %s\n", pam_strerror (pam_h, rc)); ++ goto error; ++ } ++ ++ if (strcmp (authed_user, user_to_auth) != 0) ++ { ++ fprintf (stderr, "polkit-agent-helper-1: Tried to auth user '%s' but we got auth for user '%s' instead", ++ user_to_auth, (const char *) authed_user); ++ goto error; ++ } ++ ++#ifdef PAH_DEBUG ++ fprintf (stderr, "polkit-agent-helper-1: successfully authenticated user '%s'.\n", user_to_auth); ++#endif /* PAH_DEBUG */ ++ ++ pam_end (pam_h, rc); ++ pam_h = NULL; ++ ++#ifdef PAH_DEBUG ++ fprintf (stderr, "polkit-agent-helper-1: sending D-Bus message to PolicyKit daemon\n"); ++#endif /* PAH_DEBUG */ ++ ++ /* now send a D-Bus message to the PolicyKit daemon that ++ * includes a) the cookie; and b) the user we authenticated ++ */ ++ if (!send_dbus_message (cookie, user_to_auth)) ++ { ++#ifdef PAH_DEBUG ++ fprintf (stderr, "polkit-agent-helper-1: error sending D-Bus message to PolicyKit daemon\n"); ++#endif /* PAH_DEBUG */ ++ goto error; ++ } ++ ++#ifdef PAH_DEBUG ++ fprintf (stderr, "polkit-agent-helper-1: successfully sent D-Bus message to PolicyKit daemon\n"); ++#endif /* PAH_DEBUG */ ++ ++ fprintf (stdout, "SUCCESS\n"); ++ flush_and_wait(); ++ return 0; ++ ++error: ++ if (pam_h != NULL) ++ pam_end (pam_h, rc); ++ ++ fprintf (stdout, "FAILURE\n"); ++ flush_and_wait(); ++ return 1; ++} ++ ++static int ++conversation_function (int n, const struct pam_message **msg, struct pam_response **resp, void *data) ++{ ++ struct pam_response *aresp; ++ char buf[PAM_MAX_RESP_SIZE]; ++ int i; ++ ++ data = data; ++ if (n <= 0 || n > PAM_MAX_NUM_MSG) ++ return PAM_CONV_ERR; ++ ++ if ((aresp = calloc(n, sizeof *aresp)) == NULL) ++ return PAM_BUF_ERR; ++ ++ for (i = 0; i < n; ++i) ++ { ++ aresp[i].resp_retcode = 0; ++ aresp[i].resp = NULL; ++ switch (msg[i]->msg_style) ++ { ++ ++ case PAM_PROMPT_ECHO_OFF: ++ fprintf (stdout, "PAM_PROMPT_ECHO_OFF "); ++ goto conv1; ++ ++ case PAM_PROMPT_ECHO_ON: ++ fprintf (stdout, "PAM_PROMPT_ECHO_ON "); ++ conv1: ++ fputs (msg[i]->msg, stdout); ++ if (strlen (msg[i]->msg) > 0 && msg[i]->msg[strlen (msg[i]->msg) - 1] != '\n') ++ fputc ('\n', stdout); ++ fflush (stdout); ++ ++ if (fgets (buf, sizeof buf, stdin) == NULL) ++ goto error; ++ ++ if (strlen (buf) > 0 && ++ buf[strlen (buf) - 1] == '\n') ++ buf[strlen (buf) - 1] = '\0'; ++ ++ aresp[i].resp = strdup (buf); ++ if (aresp[i].resp == NULL) ++ goto error; ++ break; ++ ++ case PAM_ERROR_MSG: ++ fprintf (stdout, "PAM_ERROR_MSG "); ++ goto conv2; ++ ++ case PAM_TEXT_INFO: ++ fprintf (stdout, "PAM_TEXT_INFO "); ++ conv2: ++ fputs (msg[i]->msg, stdout); ++ if (strlen (msg[i]->msg) > 0 && ++ msg[i]->msg[strlen (msg[i]->msg) - 1] != '\n') ++ fputc ('\n', stdout); ++ fflush (stdout); ++ break; ++ ++ default: ++ goto error; ++ } ++ } ++ ++ *resp = aresp; ++ return PAM_SUCCESS; ++ ++error: ++ ++ for (i = 0; i < n; ++i) ++ { ++ if (aresp[i].resp != NULL) { ++ memset (aresp[i].resp, 0, strlen(aresp[i].resp)); ++ free (aresp[i].resp); ++ } ++ } ++ memset (aresp, 0, n * sizeof *aresp); ++ *resp = NULL; ++ return PAM_CONV_ERR; ++} ++ +diff --git a/src/polkitagent/polkitagenthelper-shadow.c b/src/polkitagent/polkitagenthelper-shadow.c +new file mode 100644 +index 0000000..7435533 +--- /dev/null ++++ b/src/polkitagent/polkitagenthelper-shadow.c +@@ -0,0 +1,189 @@ ++/* ++ * Copyright (C) 2008 Red Hat, Inc. ++ * Copyright (C) 2009-2010 Andrew Psaltis <ampsaltis@gmail.com> ++ * ++ * This library is free software; you can redistribute it and/or ++ * modify it under the terms of the GNU Lesser General Public ++ * License as published by the Free Software Foundation; either ++ * version 2 of the License, or (at your option) any later version. ++ * ++ * This library is distributed in the hope that it will be useful, ++ * but WITHOUT ANY WARRANTY; without even the implied warranty of ++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ++ * Lesser General Public License for more details. ++ * ++ * You should have received a copy of the GNU Lesser General ++ * Public License along with this library; if not, write to the ++ * Free Software Foundation, Inc., 59 Temple Place, Suite 330, ++ * Boston, MA 02111-1307, USA. ++ * ++ * Authors: Andrew Psaltis <ampsaltis@gmail.com>, based on ++ * polkitagenthelper.c which was written by ++ * David Zeuthen <davidz@redhat.com> ++ */ ++ ++#include "config.h" ++#include <stdio.h> ++#include <stdlib.h> ++#include <string.h> ++#include <unistd.h> ++#include <sys/types.h> ++#include <sys/stat.h> ++#include <syslog.h> ++#include <shadow.h> ++#include <grp.h> ++#include <pwd.h> ++#include <time.h> ++ ++#include <polkit/polkit.h> ++#include "polkitagenthelperprivate.h" ++ ++ ++extern char *crypt (); ++static int shadow_authenticate (struct spwd *shadow); ++ ++int ++main (int argc, char *argv[]) ++{ ++ struct spwd *shadow; ++ const char *user_to_auth; ++ const char *cookie; ++ time_t tm; ++ ++ /* clear the entire environment to avoid attacks with ++ libraries honoring environment variables */ ++ if (clearenv () != 0) ++ goto error; ++ ++ /* set a minimal environment */ ++ setenv ("PATH", "/usr/sbin:/usr/bin:/sbin:/bin", 1); ++ ++ /* check that we are setuid root */ ++ if (geteuid () != 0) ++ { ++ fprintf (stderr, "polkit-agent-helper-1: needs to be setuid root\n"); ++ goto error; ++ } ++ ++ openlog ("polkit-agent-helper-1", LOG_CONS | LOG_PID, LOG_AUTHPRIV); ++ ++ /* check for correct invocation */ ++ if (argc != 3) ++ { ++ syslog (LOG_NOTICE, "inappropriate use of helper, wrong number of arguments [uid=%d]", getuid ()); ++ fprintf (stderr, "polkit-agent-helper-1: wrong number of arguments. This incident has been logged.\n"); ++ goto error; ++ } ++ ++ if (getuid () != 0) ++ { ++ /* check we're running with a non-tty stdin */ ++ if (isatty (STDIN_FILENO) != 0) ++ { ++ syslog (LOG_NOTICE, "inappropriate use of helper, stdin is a tty [uid=%d]", getuid ()); ++ fprintf (stderr, "polkit-agent-helper-1: inappropriate use of helper, stdin is a tty. This incident has been logged.\n"); ++ goto error; ++ } ++ } ++ ++ user_to_auth = argv[1]; ++ cookie = argv[2]; ++ ++#ifdef PAH_DEBUG ++ fprintf (stderr, "polkit-agent-helper-1: user to auth is '%s'.\n", user_to_auth); ++#endif /* PAH_DEBUG */ ++ ++ /* Ask shadow about the user requesting authentication */ ++ if ((shadow = getspnam (user_to_auth)) == NULL) ++ { ++ syslog (LOG_NOTICE, "shadow file data information request for user %s [uid=%d] failed", user_to_auth, getuid()); ++ fprintf(stderr, "polkit-agent-helper-1: could not get shadow information for%.100s", user_to_auth); ++ goto error; ++ } ++ ++ /* Check the user's identity */ ++ if(!shadow_authenticate (shadow)) ++ { ++ syslog (LOG_NOTICE, "authentication failure [uid=%d] trying to authenticate '%s'", getuid (), user_to_auth); ++ fprintf (stderr, "polkit-agent-helper-1: authentication failure. This incident has been logged.\n"); ++ goto error; ++ } ++ ++ /* Check whether the user's password has expired */ ++ time(&tm); ++ if( shadow->sp_max >= 0 && (shadow->sp_lstchg + shadow->sp_max) * 60 * 60 * 24 <= tm) ++ { ++ syslog (LOG_NOTICE, "password expired for user '%s' [uid=%d] trying to authenticate", user_to_auth, getuid () ); ++ fprintf (stderr, "polkit-agent-helper-1: authorization failure. This incident has been logged.\n"); ++ goto error; ++ } ++ ++ /* Check whether the user's password has aged (and account expired along ++ * with it) ++ */ ++ if( shadow->sp_inact >= 0 && (shadow->sp_lstchg + shadow->sp_max + shadow->sp_inact) * 60 * 60 * 24 <= tm) ++ { ++ syslog (LOG_NOTICE, "password aged for user '%s' [uid=%d] trying to authenticate", user_to_auth, getuid () ); ++ fprintf (stderr, "polkit-agent-helper-1: authorization failure. This incident has been logged.\n"); ++ goto error; ++ } ++ ++ /* Check whether the user's account has expired */ ++ if(shadow->sp_expire >= 0 && shadow->sp_expire * 60 * 60 * 24 <= tm) ++ { ++ syslog (LOG_NOTICE, "account expired for user '%s' [uid=%d] trying to authenticate", user_to_auth, getuid () ); ++ fprintf (stderr, "polkit-agent-helper-1: authorization failure. This incident has been logged.\n"); ++ goto error; ++ } ++ ++#ifdef PAH_DEBUG ++ fprintf (stderr, "polkit-agent-helper-1: sending D-Bus message to PolicyKit daemon\n"); ++#endif /* PAH_DEBUG */ ++ ++ /* now send a D-Bus message to the PolicyKit daemon that ++ * includes a) the cookie; and b) the user we authenticated ++ */ ++ if (!send_dbus_message (cookie, user_to_auth)) ++ { ++#ifdef PAH_DEBUG ++ fprintf (stderr, "polkit-agent-helper-1: error sending D-Bus message to PolicyKit daemon\n"); ++#endif /* PAH_DEBUG */ ++ goto error; ++ } ++ ++#ifdef PAH_DEBUG ++ fprintf (stderr, "polkit-agent-helper-1: successfully sent D-Bus message to PolicyKit daemon\n"); ++#endif /* PAH_DEBUG */ ++ ++ fprintf (stdout, "SUCCESS\n"); ++ flush_and_wait(); ++ return 0; ++ ++error: ++ fprintf (stdout, "FAILURE\n"); ++ flush_and_wait(); ++ return 1; ++} ++ ++static int ++shadow_authenticate(struct spwd *shadow) ++{ ++ /* Speak PAM to the daemon, thanks to David Zeuthen for the idea. */ ++ char passwd[512]; ++ fprintf(stdout, "PAM_PROMPT_ECHO_OFF password:\n"); ++ fflush(stdout); ++ usleep (10 * 1000); /* since fflush(3) seems buggy */ ++ ++ if (fgets (passwd, sizeof (passwd), stdin) == NULL) ++ goto error; ++ ++ if (strlen (passwd) > 0 && passwd[strlen (passwd) - 1] == '\n') ++ passwd[strlen (passwd) - 1] = '\0'; ++ ++ if (strcmp (shadow->sp_pwdp, crypt (passwd, shadow->sp_pwdp)) != 0) ++ goto error; ++ return 1; ++error: ++ return 0; ++} ++ +diff --git a/src/polkitagent/polkitagenthelper.c b/src/polkitagent/polkitagenthelper.c +deleted file mode 100644 +index cca86db..0000000 +--- a/src/polkitagent/polkitagenthelper.c ++++ /dev/null +@@ -1,339 +0,0 @@ +-/* +- * Copyright (C) 2008 Red Hat, Inc. +- * +- * This library is free software; you can redistribute it and/or +- * modify it under the terms of the GNU Lesser General Public +- * License as published by the Free Software Foundation; either +- * version 2 of the License, or (at your option) any later version. +- * +- * This library is distributed in the hope that it will be useful, +- * but WITHOUT ANY WARRANTY; without even the implied warranty of +- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +- * Lesser General Public License for more details. +- * +- * You should have received a copy of the GNU Lesser General +- * Public License along with this library; if not, write to the +- * Free Software Foundation, Inc., 59 Temple Place, Suite 330, +- * Boston, MA 02111-1307, USA. +- * +- * Author: David Zeuthen <davidz@redhat.com> +- */ +- +-#include "config.h" +-#include <stdio.h> +-#include <stdlib.h> +-#include <string.h> +-#include <unistd.h> +-#include <sys/types.h> +-#include <sys/stat.h> +-#include <syslog.h> +-#include <security/pam_appl.h> +- +-#include <polkit/polkit.h> +- +-#ifdef HAVE_SOLARIS +-# define LOG_AUTHPRIV (10<<3) +-#endif +- +-#ifndef HAVE_CLEARENV +-extern char **environ; +- +-static int +-clearenv (void) +-{ +- if (environ != NULL) +- environ[0] = NULL; +- return 0; +-} +-#endif +- +-/* Development aid: define PAH_DEBUG to get debugging output. Do _NOT_ +- * enable this in production builds; it may leak passwords and other +- * sensitive information. +- */ +-#undef PAH_DEBUG +-// #define PAH_DEBUG +- +-static gboolean send_dbus_message (const char *cookie, const char *user); +- +-static int conversation_function (int n, const struct pam_message **msg, struct pam_response **resp, void *data); +- +-int +-main (int argc, char *argv[]) +-{ +- int rc; +- const char *user_to_auth; +- const char *cookie; +- struct pam_conv pam_conversation; +- pam_handle_t *pam_h; +- const void *authed_user; +- +- rc = 0; +- pam_h = NULL; +- +- /* clear the entire environment to avoid attacks using with libraries honoring environment variables */ +- if (clearenv () != 0) +- goto error; +- +- /* set a minimal environment */ +- setenv ("PATH", "/usr/sbin:/usr/bin:/sbin:/bin", 1); +- +- /* check that we are setuid root */ +- if (geteuid () != 0) +- { +- fprintf (stderr, "polkit-agent-helper-1: needs to be setuid root\n"); +- goto error; +- } +- +- openlog ("polkit-agent-helper-1", LOG_CONS | LOG_PID, LOG_AUTHPRIV); +- +- /* check for correct invocation */ +- if (argc != 3) +- { +- syslog (LOG_NOTICE, "inappropriate use of helper, wrong number of arguments [uid=%d]", getuid ()); +- fprintf (stderr, "polkit-agent-helper-1: wrong number of arguments. This incident has been logged.\n"); +- goto error; +- } +- +- user_to_auth = argv[1]; +- cookie = argv[2]; +- +- if (getuid () != 0) +- { +- /* check we're running with a non-tty stdin */ +- if (isatty (STDIN_FILENO) != 0) +- { +- syslog (LOG_NOTICE, "inappropriate use of helper, stdin is a tty [uid=%d]", getuid ()); +- fprintf (stderr, "polkit-agent-helper-1: inappropriate use of helper, stdin is a tty. This incident has been logged.\n"); +- goto error; +- } +- } +- +-#ifdef PAH_DEBUG +- fprintf (stderr, "polkit-agent-helper-1: user to auth is '%s'.\n", user_to_auth); +-#endif /* PAH_DEBUG */ +- +- pam_conversation.conv = conversation_function; +- pam_conversation.appdata_ptr = NULL; +- +- /* start the pam stack */ +- rc = pam_start ("polkit-1", +- user_to_auth, +- &pam_conversation, +- &pam_h); +- if (rc != PAM_SUCCESS) +- { +- fprintf (stderr, "polkit-agent-helper-1: pam_start failed: %s\n", pam_strerror (pam_h, rc)); +- goto error; +- } +- +- /* set the requesting user */ +- rc = pam_set_item (pam_h, PAM_RUSER, user_to_auth); +- if (rc != PAM_SUCCESS) +- { +- fprintf (stderr, "polkit-agent-helper-1: pam_set_item failed: %s\n", pam_strerror (pam_h, rc)); +- goto error; +- } +- +- /* is user really user? */ +- rc = pam_authenticate (pam_h, 0); +- if (rc != PAM_SUCCESS) +- { +- fprintf (stderr, "polkit-agent-helper-1: pam_authenticated failed: %s\n", pam_strerror (pam_h, rc)); +- goto error; +- } +- +- /* permitted access? */ +- rc = pam_acct_mgmt (pam_h, 0); +- if (rc != PAM_SUCCESS) +- { +- fprintf (stderr, "polkit-agent-helper-1: pam_acct_mgmt failed: %s\n", pam_strerror (pam_h, rc)); +- goto error; +- } +- +- /* did we auth the right user? */ +- rc = pam_get_item (pam_h, PAM_USER, &authed_user); +- if (rc != PAM_SUCCESS) +- { +- fprintf (stderr, "polkit-agent-helper-1: pam_get_item failed: %s\n", pam_strerror (pam_h, rc)); +- goto error; +- } +- +- if (strcmp (authed_user, user_to_auth) != 0) +- { +- fprintf (stderr, "polkit-agent-helper-1: Tried to auth user '%s' but we got auth for user '%s' instead", +- user_to_auth, (const char *) authed_user); +- goto error; +- } +- +-#ifdef PAH_DEBUG +- fprintf (stderr, "polkit-agent-helper-1: successfully authenticated user '%s'.\n", user_to_auth); +-#endif /* PAH_DEBUG */ +- +- pam_end (pam_h, rc); +- pam_h = NULL; +- +-#ifdef PAH_DEBUG +- fprintf (stderr, "polkit-agent-helper-1: sending D-Bus message to PolicyKit daemon\n"); +-#endif /* PAH_DEBUG */ +- +- /* now send a D-Bus message to the PolicyKit daemon that +- * includes a) the cookie; and b) the user we authenticated +- */ +- if (!send_dbus_message (cookie, user_to_auth)) +- { +-#ifdef PAH_DEBUG +- fprintf (stderr, "polkit-agent-helper-1: error sending D-Bus message to PolicyKit daemon\n"); +-#endif /* PAH_DEBUG */ +- goto error; +- } +- +-#ifdef PAH_DEBUG +- fprintf (stderr, "polkit-agent-helper-1: successfully sent D-Bus message to PolicyKit daemon\n"); +-#endif /* PAH_DEBUG */ +- +- fprintf (stdout, "SUCCESS\n"); +- fflush (stdout); +- fflush (stderr); +- usleep (10 * 1000); /* since fflush(3) seems buggy */ +- return 0; +- +-error: +- if (pam_h != NULL) +- pam_end (pam_h, rc); +- +- fprintf (stdout, "FAILURE\n"); +- fflush (stdout); +- fflush (stderr); +- usleep (10 * 1000); /* since fflush(3) seems buggy */ +- return 1; +-} +- +-static int +-conversation_function (int n, const struct pam_message **msg, struct pam_response **resp, void *data) +-{ +- struct pam_response *aresp; +- char buf[PAM_MAX_RESP_SIZE]; +- int i; +- +- data = data; +- if (n <= 0 || n > PAM_MAX_NUM_MSG) +- return PAM_CONV_ERR; +- +- if ((aresp = calloc(n, sizeof *aresp)) == NULL) +- return PAM_BUF_ERR; +- +- for (i = 0; i < n; ++i) +- { +- aresp[i].resp_retcode = 0; +- aresp[i].resp = NULL; +- switch (msg[i]->msg_style) +- { +- +- case PAM_PROMPT_ECHO_OFF: +- fprintf (stdout, "PAM_PROMPT_ECHO_OFF "); +- goto conv1; +- +- case PAM_PROMPT_ECHO_ON: +- fprintf (stdout, "PAM_PROMPT_ECHO_ON "); +- conv1: +- fputs (msg[i]->msg, stdout); +- if (strlen (msg[i]->msg) > 0 && msg[i]->msg[strlen (msg[i]->msg) - 1] != '\n') +- fputc ('\n', stdout); +- fflush (stdout); +- +- if (fgets (buf, sizeof buf, stdin) == NULL) +- goto error; +- +- if (strlen (buf) > 0 && +- buf[strlen (buf) - 1] == '\n') +- buf[strlen (buf) - 1] = '\0'; +- +- aresp[i].resp = strdup (buf); +- if (aresp[i].resp == NULL) +- goto error; +- break; +- +- case PAM_ERROR_MSG: +- fprintf (stdout, "PAM_ERROR_MSG "); +- goto conv2; +- +- case PAM_TEXT_INFO: +- fprintf (stdout, "PAM_TEXT_INFO "); +- conv2: +- fputs (msg[i]->msg, stdout); +- if (strlen (msg[i]->msg) > 0 && +- msg[i]->msg[strlen (msg[i]->msg) - 1] != '\n') +- fputc ('\n', stdout); +- fflush (stdout); +- break; +- +- default: +- goto error; +- } +- } +- +- *resp = aresp; +- return PAM_SUCCESS; +- +-error: +- +- for (i = 0; i < n; ++i) +- { +- if (aresp[i].resp != NULL) { +- memset (aresp[i].resp, 0, strlen(aresp[i].resp)); +- free (aresp[i].resp); +- } +- } +- memset (aresp, 0, n * sizeof *aresp); +- *resp = NULL; +- return PAM_CONV_ERR; +-} +- +-static gboolean +-send_dbus_message (const char *cookie, const char *user) +-{ +- PolkitAuthority *authority; +- PolkitIdentity *identity; +- GError *error; +- gboolean ret; +- +- ret = FALSE; +- +- error = NULL; +- +- g_type_init (); +- +- authority = polkit_authority_get (); +- +- identity = polkit_unix_user_new_for_name (user, &error); +- if (identity == NULL) +- { +- g_printerr ("Error constructing identity: %s\n", error->message); +- g_error_free (error); +- goto out; +- } +- +- if (!polkit_authority_authentication_agent_response_sync (authority, +- cookie, +- identity, +- NULL, +- &error)) +- { +- g_printerr ("polkit-agent-helper-1: error response to PolicyKit daemon: %s\n", error->message); +- g_error_free (error); +- goto out; +- } +- +- ret = TRUE; +- +- out: +- +- if (identity != NULL) +- g_object_unref (identity); +- +- if (authority != NULL) +- g_object_unref (authority); +- +- return ret; +-} +diff --git a/src/polkitagent/polkitagenthelperprivate.c b/src/polkitagent/polkitagenthelperprivate.c +new file mode 100644 +index 0000000..abf5524 +--- /dev/null ++++ b/src/polkitagent/polkitagenthelperprivate.c +@@ -0,0 +1,97 @@ ++/* ++ * Copyright (C) 2009-2010 Red Hat, Inc. ++ * ++ * This library is free software; you can redistribute it and/or ++ * modify it under the terms of the GNU Lesser General Public ++ * License as published by the Free Software Foundation; either ++ * version 2 of the License, or (at your option) any later version. ++ * ++ * This library is distributed in the hope that it will be useful, ++ * but WITHOUT ANY WARRANTY; without even the implied warranty of ++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ++ * Lesser General Public License for more details. ++ * ++ * You should have received a copy of the GNU Lesser General ++ * Public License along with this library; if not, write to the ++ * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, ++ * Boston, MA 02110-1301, USA. ++ * ++ * Authors: David Zeuthen <davidz@redhat.com>, ++ * Andrew Psaltis <ampsaltis@gmail.com> ++ */ ++ ++#include "polkitagenthelperprivate.h" ++#include <stdio.h> ++ ++#ifndef HAVE_CLEARENV ++extern char **environ; ++ ++static int ++clearenv (void) ++{ ++ if (environ != NULL) ++ environ[0] = NULL; ++ return 0; ++} ++#endif ++ ++ ++gboolean ++send_dbus_message (const char *cookie, const char *user) ++{ ++ PolkitAuthority *authority; ++ PolkitIdentity *identity; ++ GError *error; ++ gboolean ret; ++ ++ ret = FALSE; ++ ++ error = NULL; ++ ++ g_type_init (); ++ ++ authority = polkit_authority_get (); ++ ++ identity = polkit_unix_user_new_for_name (user, &error); ++ if (identity == NULL) ++ { ++ g_printerr ("Error constructing identity: %s\n", error->message); ++ g_error_free (error); ++ goto out; ++ } ++ ++ if (!polkit_authority_authentication_agent_response_sync (authority, ++ cookie, ++ identity, ++ NULL, ++ &error)) ++ { ++ g_printerr ("polkit-agent-helper-1: error response to PolicyKit daemon: %s\n", error->message); ++ g_error_free (error); ++ goto out; ++ } ++ ++ ret = TRUE; ++ ++ out: ++ ++ if (identity != NULL) ++ g_object_unref (identity); ++ ++ if (authority != NULL) ++ g_object_unref (authority); ++ ++ return ret; ++} ++ ++/* fflush(3) stdin and stdout and wait a little bit. ++ * This replaces the three-line commands at the bottom of ++ * polkit-agent-helper-1's main() function. ++ */ ++void ++flush_and_wait () ++{ ++ fflush (stdout); ++ fflush (stderr); ++ usleep (10 * 1000); /* since fflush(3) seems buggy */ ++} +diff --git a/src/polkitagent/polkitagenthelperprivate.h b/src/polkitagent/polkitagenthelperprivate.h +new file mode 100644 +index 0000000..16f7ba4 +--- /dev/null ++++ b/src/polkitagent/polkitagenthelperprivate.h +@@ -0,0 +1,42 @@ ++/* ++ * Copyright (C) 2009-2010 Red Hat, Inc. ++ * ++ * This library is free software; you can redistribute it and/or ++ * modify it under the terms of the GNU Lesser General Public ++ * License as published by the Free Software Foundation; either ++ * version 2 of the License, or (at your option) any later version. ++ * ++ * This library is distributed in the hope that it will be useful, ++ * but WITHOUT ANY WARRANTY; without even the implied warranty of ++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ++ * Lesser General Public License for more details. ++ * ++ * You should have received a copy of the GNU Lesser General ++ * Public License along with this library; if not, write to the ++ * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, ++ * Boston, MA 02110-1301, USA. ++ * ++ * Authors: David Zeuthen <davidz@redhat.com>, ++ * Andrew Psaltis <ampsalits@gmail.com> ++ */ ++#ifndef __POLKIT_AGENT_HELPER_PRIVATE_H ++#define __POLKIT_AGENT_HELPER_PRIVATE_H ++ ++#include <polkit/polkit.h> ++ ++/* Development aid: define PAH_DEBUG to get debugging output. Do _NOT_ ++ * enable this in production builds; it may leak passwords and other ++ * sensitive information. ++ */ ++#undef PAH_DEBUG ++// #define PAH_DEBUG ++ ++#ifdef HAVE_SOLARIS ++# define LOG_AUTHPRIV (10<<3) ++#endif ++ ++gboolean send_dbus_message (const char *cookie, const char *user); ++ ++void flush_and_wait (); ++ ++#endif /* __POLKIT_AGENT_HELPER_PRIVATE_H */ +diff --git a/src/programs/pkexec.c b/src/programs/pkexec.c +index 17c191e..3e096bf 100644 +--- a/src/programs/pkexec.c ++++ b/src/programs/pkexec.c +@@ -34,7 +34,11 @@ + #include <grp.h> + #include <pwd.h> + #include <errno.h> ++ ++#ifdef POLKIT_AUTHFW_PAM + #include <security/pam_appl.h> ++#endif /* POLKIT_AUTHFW_PAM */ ++ + #include <syslog.h> + #include <stdarg.h> + +@@ -115,6 +119,7 @@ log_message (gint level, + + /* ---------------------------------------------------------------------------------------------------- */ + ++#ifdef POLKIT_AUTHFW_PAM + static int + pam_conversation_function (int n, + const struct pam_message **msg, +@@ -167,6 +172,7 @@ out: + pam_end (pam_h, rc); + return ret; + } ++#endif /* POLKIT_AUTHFW_PAM */ + + /* ---------------------------------------------------------------------------------------------------- */ + +@@ -741,11 +747,13 @@ main (int argc, char *argv[]) + * TODO: The question here is whether we should clear the limits before applying them? + * As evident above, neither su(1) (and, for that matter, nor sudo(8)) does this. + */ ++#ifdef POLKIT_AUTHW_PAM + if (!open_session (pw->pw_name)) + { + goto out; + } +- ++#endif /* POLKIT_AUTHFW_PAM */ ++ + /* become the user */ + if (setgroups (0, NULL) != 0) + { diff --git a/main/renderproto/APKBUILD b/main/renderproto/APKBUILD index 195a760cff..aba314ac2b 100644 --- a/main/renderproto/APKBUILD +++ b/main/renderproto/APKBUILD @@ -1,6 +1,6 @@ # Maintainer: Natanael Copa <ncopa@alpinelinux.org> pkgname=renderproto -pkgver=0.11 +pkgver=0.11.1 pkgrel=0 pkgdesc="X11 Render extension wire protocol" url="http://xorg.freedesktop.org/" @@ -17,4 +17,4 @@ build () { make DESTDIR="$pkgdir" install || return 1 install -Dm644 COPYING "$pkgdir"/usr/share/licenses/$pkgname/COPYING } -md5sums="b160a9733fe91b666e74fca284333148 renderproto-0.11.tar.bz2" +md5sums="a914ccc1de66ddeb4b611c6b0686e274 renderproto-0.11.1.tar.bz2" diff --git a/main/sg3_utils/APKBUILD b/main/sg3_utils/APKBUILD new file mode 100644 index 0000000000..617fe703e9 --- /dev/null +++ b/main/sg3_utils/APKBUILD @@ -0,0 +1,36 @@ +# Contributor: Carlo Landmeter +# Maintainer: +pkgname=sg3_utils +pkgver=1.29 +pkgrel=0 +pkgdesc="Generic SCSI utilities" +url="http://sg.danny.cz/sg/sg3_utils.html" +license="GPL" +depends= +makedepends= +install= +subpackages="$pkgname-dev $pkgname-doc" +source="http://sg.danny.cz/sg/p/$pkgname-$pkgver.tgz" + +_builddir="$srcdir"/$pkgname-$pkgver + +prepare() { + cd "$_builddir" + # apply patches here +} + +build() { + cd "$_builddir" + ./configure --prefix=/usr \ + --sysconfdir=/etc \ + --mandir=/usr/share/man \ + --infodir=/usr/share/info + make || return 1 +} + +package() { + cd "$_builddir" + make DESTDIR="$pkgdir" install +} + +md5sums="17b8f2bc1b32bd036515683cc87328ea sg3_utils-1.29.tgz" diff --git a/main/udisks/APKBUILD b/main/udisks/APKBUILD new file mode 100644 index 0000000000..40dd1b60c5 --- /dev/null +++ b/main/udisks/APKBUILD @@ -0,0 +1,46 @@ +# Contributor: Carlo Landmeter +# Maintainer: +pkgname=udisks +pkgver=1.0.1 +pkgrel=0 +pkgdesc="Disk Management Service" +url="http://www.freedesktop.org/wiki/Software/udisks" +license="GPL" +depends="" +makedepends="glib-dev polkit-dev parted-dev udev-dev sg3_utils-dev + dbus-dev dbus-glib-dev lvm2-dev pkgconfig libatasmart-dev + intltool eggdbus-dev expat-dev" +install= +subpackages="$pkgname-dev $pkgname-doc" +source="http://hal.freedesktop.org/releases/$pkgname-$pkgver.tar.gz + lvm.patch + no-floppy.patch" + +_builddir="$srcdir"/$pkgname-$pkgver + +prepare() { + cd "$_builddir" + patch -p1 -i "$srcdir"/lvm.patch || return 1 + patch -p1 -i "$srcdir"/no-floppy.patch || return 1 +} + +build() { + cd "$_builddir" + ./configure --prefix=/usr \ + --sysconfdir=/etc \ + --mandir=/usr/share/man \ + --infodir=/usr/share/info \ + --libexecdir=/usr/lib/udisks \ + --disable-static \ + --disable-nls + make || return 1 +} + +package() { + cd "$_builddir" + make DESTDIR="$pkgdir" install +} + +md5sums="3654d994eb43b80c8c2d04fe03da30c4 udisks-1.0.1.tar.gz +d626d05508648cda8afdae71ee46e9e0 lvm.patch +f5a22eca24ec82a87dfa2374e4524b09 no-floppy.patch" diff --git a/main/udisks/lvm.patch b/main/udisks/lvm.patch new file mode 100644 index 0000000000..52d417d756 --- /dev/null +++ b/main/udisks/lvm.patch @@ -0,0 +1,120 @@ +From 2b2fcf80841972b70ad695a5a1ed74487d4fd37a Mon Sep 17 00:00:00 2001 +From: David Zeuthen <davidz@redhat.com> +Date: Wed, 19 May 2010 17:01:31 +0000 +Subject: Update to latest LVM2 API + +See + + http://lists.freedesktop.org/archives/devkit-devel/2010-April/000783.html +--- +diff --git a/configure.ac b/configure.ac +index 469be5f..a9141bf 100644 +--- a/configure.ac ++++ b/configure.ac +@@ -170,7 +170,7 @@ AC_SUBST(DEVMAPPER_LIBS) + have_lvm2=no + AC_ARG_ENABLE(lvm2, AS_HELP_STRING([--disable-lvm2], [disable LVM2 support])) + if test "x$enable_lvm2" != "xno"; then +- PKG_CHECK_MODULES(LVM2, lvm2app >= 2.1, ++ PKG_CHECK_MODULES(LVM2, lvm2app >= 2.2, + [AC_DEFINE(HAVE_LVM2, 1, [Define if LVM2 is available]) have_lvm2=yes], + have_lvm2=no) + AC_SUBST(LVM2_CFLAGS) +diff --git a/src/probers/udisks-lvm-pv-export.c b/src/probers/udisks-lvm-pv-export.c +index 5675fb8..ee6d8ed 100644 +--- a/src/probers/udisks-lvm-pv-export.c ++++ b/src/probers/udisks-lvm-pv-export.c +@@ -47,7 +47,7 @@ find_vg_for_pv_uuid (lvm_t lvm_ctx, + struct lvm_pv_list *pv_list; + dm_list_iterate_items (pv_list, pvs) + { +- char *uuid; ++ const char *uuid; + pv_t pv = pv_list->pv; + + uuid = lvm_pv_get_uuid (pv); +@@ -58,10 +58,8 @@ find_vg_for_pv_uuid (lvm_t lvm_ctx, + if (out_pv != NULL) + *out_pv = pv; + ret = vg; +- dm_free (uuid); + goto out; + } +- dm_free (uuid); + } + } + } +@@ -79,12 +77,12 @@ find_vg_for_pv_uuid (lvm_t lvm_ctx, + static void + print_vg (vg_t vg) + { +- char *s; ++ const char *s; + struct dm_list *pvs; + struct dm_list *lvs; + +- s = lvm_vg_get_uuid (vg); g_print ("UDISKS_LVM2_PV_VG_UUID=%s\n", s); dm_free (s); +- s = lvm_vg_get_name (vg); g_print ("UDISKS_LVM2_PV_VG_NAME=%s\n", s); dm_free (s); ++ s = lvm_vg_get_uuid (vg); g_print ("UDISKS_LVM2_PV_VG_UUID=%s\n", s); ++ s = lvm_vg_get_name (vg); g_print ("UDISKS_LVM2_PV_VG_NAME=%s\n", s); + g_print ("UDISKS_LVM2_PV_VG_SIZE=%" G_GUINT64_FORMAT "\n", lvm_vg_get_size (vg)); + g_print ("UDISKS_LVM2_PV_VG_FREE_SIZE=%" G_GUINT64_FORMAT "\n", lvm_vg_get_free_size (vg)); + g_print ("UDISKS_LVM2_PV_VG_EXTENT_SIZE=%" G_GUINT64_FORMAT "\n", lvm_vg_get_extent_size (vg)); +@@ -117,17 +115,14 @@ print_vg (vg_t vg) + str = g_string_new (NULL); + dm_list_iterate_items (pv_list, pvs) + { +- char *uuid; ++ const char *uuid; + guint64 size; + guint64 free_size; + pv_t pv = pv_list->pv; + + uuid = lvm_pv_get_uuid (pv); + if (uuid != NULL) +- { +- g_string_append_printf (str, "uuid=%s", uuid); +- dm_free (uuid); +- } ++ g_string_append_printf (str, "uuid=%s", uuid); + size = lvm_pv_get_size (pv); + g_string_append_printf (str, ";size=%" G_GUINT64_FORMAT, size); + free_size = lvm_pv_get_free (pv); +@@ -173,8 +168,8 @@ print_vg (vg_t vg) + str = g_string_new (NULL); + dm_list_iterate_items (lv_list, lvs) + { +- char *uuid; +- char *name; ++ const char *uuid; ++ const char *name; + gboolean is_active; + guint64 size; + lv_t lv = lv_list->lv; +@@ -195,11 +190,6 @@ print_vg (vg_t vg) + g_string_append_printf (str, "active=%d", is_active); + g_string_append_c (str, ' '); + } +- +- if (uuid != NULL) +- dm_free (uuid); +- if (name != NULL) +- dm_free (name); + } + g_print ("UDISKS_LVM2_PV_VG_LV_LIST=%s\n", str->str); + g_string_free (str, TRUE); +@@ -212,9 +202,9 @@ print_vg (vg_t vg) + static void + print_pv (pv_t pv) + { +- char *s; ++ const char *s; + +- s = lvm_pv_get_uuid (pv); g_print ("UDISKS_LVM2_PV_UUID=%s\n", s); dm_free (s); ++ s = lvm_pv_get_uuid (pv); g_print ("UDISKS_LVM2_PV_UUID=%s\n", s); + g_print ("UDISKS_LVM2_PV_NUM_MDA=%" G_GUINT64_FORMAT "\n", lvm_pv_get_mda_count (pv)); + + /* TODO: ask for more API in liblvm - pvdisplay(8) suggests more information +-- +cgit v0.8.3-6-g21f6 + diff --git a/main/udisks/no-floppy.patch b/main/udisks/no-floppy.patch new file mode 100644 index 0000000000..3d01dac7ac --- /dev/null +++ b/main/udisks/no-floppy.patch @@ -0,0 +1,31 @@ +From ca93d4e2d9e7f483b2fde1725da086e2cca44164 Mon Sep 17 00:00:00 2001 +From: Martin Pitt <martin.pitt@ubuntu.com> +Date: Wed, 02 Jun 2010 13:56:07 +0000 +Subject: Fix long hangs on probing nonexistant floppy drives + +A lot of modern machines do not have a floppy drive any more, but still have a +floppy controller somewhere (or at least the BIOS pretends to). Trying to +open(/dev/fd0) on these machines causes long hangs, which lead to long desktop +startup times. + +To fix this, avoid probing floppies for media in update_info(). + +https://launchpad.net/bugs/539515 +--- +diff --git a/src/device.c b/src/device.c +index 763385c..0e87f1d 100644 +--- a/src/device.c ++++ b/src/device.c +@@ -4471,7 +4471,8 @@ update_info (Device *device) + { + media_available = FALSE; + +- if (!g_udev_device_get_property_as_boolean (device->priv->d, "ID_CDROM")) ++ if (!g_udev_device_get_property_as_boolean (device->priv->d, "ID_CDROM") && ++ !g_udev_device_get_property_as_boolean (device->priv->d, "ID_DRIVE_FLOPPY")) + { + int fd; + fd = open (device->priv->device_file, O_RDONLY); +-- +cgit v0.8.3-6-g21f6 + |