summaryrefslogtreecommitdiff
path: root/pcr/elogind
diff options
context:
space:
mode:
authorOmar Vega Ramos <ovruni@gnu.org.pe>2017-02-05 12:27:45 -0500
committerOmar Vega Ramos <ovruni@gnu.org.pe>2017-02-05 12:27:45 -0500
commit6f865f9e82240661b408a208943cb4688c59b3cb (patch)
treec5e5b9d832efa01ee9b7dd68364ad4bc8c77f461 /pcr/elogind
parentc8e5162dfe65e09cf8dd1472ac25d19ef60b1051 (diff)
elogind-219.12-2: rebuild
Diffstat (limited to 'pcr/elogind')
-rw-r--r--pcr/elogind/PKGBUILD69
-rw-r--r--pcr/elogind/elogind-219.12-glibc.patch44
-rw-r--r--pcr/elogind/elogind-219.12-gperf.patch109
-rw-r--r--pcr/elogind/elogind-219.12-login1-perms.patch129
-rw-r--r--pcr/elogind/elogind-219.12-session.patch45
-rw-r--r--pcr/elogind/elogind.conf7
-rw-r--r--pcr/elogind/elogind.init32
-rw-r--r--pcr/elogind/elogind.install5
8 files changed, 411 insertions, 29 deletions
diff --git a/pcr/elogind/PKGBUILD b/pcr/elogind/PKGBUILD
index 07a2fa6cb..dfc9c65ee 100644
--- a/pcr/elogind/PKGBUILD
+++ b/pcr/elogind/PKGBUILD
@@ -2,48 +2,63 @@
# Maintainer: Omar Vega Ramos <ovruni@gnu.org.pe>
pkgname=elogind
-pkgver=219.14
-pkgrel=1
+pkgver=219.12
+pkgrel=2
pkgdesc="The systemd project's logind, extracted to a standalone package"
arch=('i686' 'x86_64' 'armv7h')
url="https://github.com/wingo/elogind"
license=('GPL')
-groups=('openrc-desktop')
depends=('dbus' 'polkit' 'libudev.so')
-makedepends=('libcap' 'intltool' 'libtool' 'gperf' 'gtk-doc')
-conflicts=('systemd' 'systemd-sysvcompat')
+makedepends=('libcap' 'intltool' 'libtool' 'gperf' 'gtk-doc' 'libseccomp')
+conflicts=('systemd-sysvcompat')
options=('!libtool')
install=elogind.install
-_commit=6d224ff665195f47c942599b21e0d959bc07ca8f
-source=("$pkgname-${pkgver}.tar.gz::${url}/archive/${_commit}.tar.gz"
- #"$pkgname-${pkgver}.tar.gz::${url}/archive/v${pkgver}.tar.gz"
- 'elogind-docs.patch'
- 'elogind-lrt.patch')
-sha256sums=('52be61c26bcac7a34b91b6de997b403822c0626dad258ecf146018977b0c034f'
+source=("${pkgname}-${pkgver}.tar.gz::${url}/archive/v${pkgver}.tar.gz"
+ 'elogind-docs.patch'
+ 'elogind-lrt.patch'
+ "elogind-219.12-session.patch"
+ "elogind-219.12-login1-perms.patch"
+ "elogind-219.12-gperf.patch"
+ "elogind-219.12-glibc.patch"
+ "elogind.conf"
+ "elogind.init")
+sha256sums=('80241494f5c794e8501ccf570ac805275ace368755780f38a18762fd06243f95'
'cafea7a13159dee700902e3837aab015d9521dfe122840faf2d909b5dc02229e'
- 'a9227ed4e97117ab5751de38c19813560a12f51379ccd882a89e7ef9842659ac')
+ 'a9227ed4e97117ab5751de38c19813560a12f51379ccd882a89e7ef9842659ac'
+ 'c63ef9869fa4bc38075dc9f9ef113b6b8c05ae2af2616da68219e0a364dea574'
+ 'cef5dda99a51a42bc36d1a946d5a21a830bf0f44ed3f447542ec57c1424e0053'
+ '9f6437abeba2f17d378482e262504f269998d54c6adb16eb16c4eda738065074'
+ '5e7dfcf695c15a02d8151541c50e26c9e3140f5626d95bbec366aada5ce095d5'
+ '344db76bf8aadfba4363c63aacd93c945a647bd5e425d756cbfd9cb4453afc66'
+ '3e3ca3d384b9ced34360e697b2a6102b173731c8cf4f91e2901df68b33d73d44')
prepare() {
- cd $srcdir/$pkgname-${_commit} #$pkgver
- patch -Np 1 -i $srcdir/elogind-docs.patch
- patch -Np 1 -i $srcdir/elogind-lrt.patch
- sed -e "s|/bin/false|/usr/lib/elogind/elogind|" \
- -i src/login/org.freedesktop.login1.service
- autoreconf -vim
+ cd ${srcdir}/${pkgname}-${pkgver}
+ patch -Np 1 -i ${srcdir}/elogind-docs.patch
+ patch -Np 1 -i ${srcdir}/elogind-lrt.patch
+ patch -Np 1 -i ${srcdir}/elogind-219.12-session.patch
+ patch -Np 1 -i ${srcdir}/elogind-219.12-login1-perms.patch
+ patch -Np 1 -i ${srcdir}/elogind-219.12-gperf.patch
+ patch -Np 1 -i ${srcdir}/elogind-219.12-glibc.patch
+
+ autoreconf -vim
}
build() {
- cd $srcdir/${pkgname}-${_commit} #${pkgver}
- intltoolize
- ./configure \
- --sysconfdir=/etc \
- --prefix=/usr \
- --libexecdir=/usr/lib
+ cd ${srcdir}/${pkgname}-${pkgver}
+ intltoolize
+ ./configure \
+ --sysconfdir=/etc \
+ --prefix=/usr \
+ --libexecdir=/usr/lib
- make
+ make
}
package() {
- cd $srcdir/${pkgname}-${_commit} #${pkgver}
- make DESTDIR="${pkgdir}" install
+ cd ${srcdir}/${pkgname}-${pkgver}
+ make DESTDIR="${pkgdir}" install
+
+ install -Dm755 ${srcdir}/elogind.init ${pkgdir}/etc/init.d/elogind
+ install -Dm755 ${srcdir}/elogind.conf ${pkgdir}/etc/conf.d/elogind
}
diff --git a/pcr/elogind/elogind-219.12-glibc.patch b/pcr/elogind/elogind-219.12-glibc.patch
new file mode 100644
index 000000000..05477c3e3
--- /dev/null
+++ b/pcr/elogind/elogind-219.12-glibc.patch
@@ -0,0 +1,44 @@
+commit 27d13af71c3af6b2f9b60556d2c046dbb6e36e23
+Author: Mike Frysinger <vapier@gentoo.org>
+Date: Mon Mar 14 17:44:49 2016 -0400
+
+ include sys/sysmacros.h in more places
+
+ Since glibc is moving away from implicitly including sys/sysmacros.h
+ all the time via sys/types.h, include the header directly in more
+ places. This seems to cover most makedev/major/minor usage.
+
+diff --git a/src/shared/macro.h b/src/shared/macro.h
+index c34441d..b36a956 100644
+--- a/src/shared/macro.h
++++ b/src/shared/macro.h
+@@ -23,6 +23,7 @@
+ #include <inttypes.h>
+ #include <stdbool.h>
+ #include <sys/param.h>
++#include <sys/sysmacros.h>
+ #include <sys/types.h>
+
+ #define _printf_(a,b) __attribute__ ((format (printf, a, b)))
+diff --git a/src/shared/util.h b/src/shared/util.h
+--- a/src/shared/util.h
++++ b/src/shared/util.h
+@@ -36,6 +36,7 @@
+ #include <sys/types.h>
+ #include <sys/socket.h>
+ #include <sys/stat.h>
++#include <sys/sysmacros.h>
+ #include <dirent.h>
+ #include <stddef.h>
+ #include <unistd.h>
+diff --git a/src/systemd/sd-device.h b/src/systemd/sd-device.h
+--- a/src/systemd/sd-device.h
++++ b/src/systemd/sd-device.h
+@@ -22,6 +22,7 @@
+ ***/
+
++#include <sys/sysmacros.h>
+ #include <sys/types.h>
+ #include <stdint.h>
+
+ #include "_sd-common.h"
diff --git a/pcr/elogind/elogind-219.12-gperf.patch b/pcr/elogind/elogind-219.12-gperf.patch
new file mode 100644
index 000000000..8342b8b3e
--- /dev/null
+++ b/pcr/elogind/elogind-219.12-gperf.patch
@@ -0,0 +1,109 @@
+commit c9f7b4d356a453a01aa77a6bb74ca7ef49732c08
+Author: Mike Gilbert <floppymaster@gmail.com>
+Date: Tue Jan 10 02:39:05 2017 -0500
+
+ build-sys: add check for gperf lookup function signature (#5055)
+
+ gperf-3.1 generates lookup functions that take a size_t length
+ parameter instead of unsigned int. Test for this at configure time.
+
+ Fixes: https://github.com/systemd/systemd/issues/5039
+
+diff --git a/configure.ac b/configure.ac
+index 11bd46c..d58fff5 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -255,6 +255,28 @@ AC_CHECK_SIZEOF(rlim_t,,[
+ #include <sys/resource.h>
+ ])
+
++GPERF_TEST="$(echo foo,bar | ${GPERF} -L ANSI-C)"
++
++AC_COMPILE_IFELSE(
++ [AC_LANG_PROGRAM([
++ #include <string.h>
++ const char * in_word_set(const char *, size_t);
++ $GPERF_TEST]
++ )],
++ [GPERF_LEN_TYPE=size_t],
++ [AC_COMPILE_IFELSE(
++ [AC_LANG_PROGRAM([
++ #include <string.h>
++ const char * in_word_set(const char *, unsigned);
++ $GPERF_TEST]
++ )],
++ [GPERF_LEN_TYPE=unsigned],
++ [AC_MSG_ERROR([** unable to determine gperf len type])]
++ )]
++)
++
++AC_DEFINE_UNQUOTED([GPERF_LEN_TYPE], [$GPERF_LEN_TYPE], [gperf len type])
++
+ # ------------------------------------------------------------------------------
+ # we use python to build the man page index
+ have_python=no
+diff --git a/src/shared/af-list.c b/src/shared/af-list.c
+index 3fac9c5..4b291d1 100644
+--- a/src/shared/af-list.c
++++ b/src/shared/af-list.c
+@@ -23,7 +23,7 @@
+ #include "af-list.h"
+ #include "macro.h"
+
+-static const struct af_name* lookup_af(register const char *str, register unsigned int len);
++static const struct af_name* lookup_af(register const char *str, register GPERF_LEN_TYPE len);
+
+ #include "af-from-name.h"
+ #include "af-to-name.h"
+diff --git a/src/shared/arphrd-list.c b/src/shared/arphrd-list.c
+index 6792d1e..2d598dc 100644
+--- a/src/shared/arphrd-list.c
++++ b/src/shared/arphrd-list.c
+@@ -23,7 +23,7 @@
+ #include "arphrd-list.h"
+ #include "macro.h"
+
+-static const struct arphrd_name* lookup_arphrd(register const char *str, register unsigned int len);
++static const struct arphrd_name* lookup_arphrd(register const char *str, register GPERF_LEN_TYPE len);
+
+ #include "arphrd-from-name.h"
+ #include "arphrd-to-name.h"
+diff --git a/src/shared/cap-list.c b/src/shared/cap-list.c
+index 3e773a0..d68cc78 100644
+--- a/src/shared/cap-list.c
++++ b/src/shared/cap-list.c
+@@ -26,7 +26,7 @@
+ #include "parse-util.h"
+ #include "util.h"
+
+-static const struct capability_name* lookup_capability(register const char *str, register unsigned int len);
++static const struct capability_name* lookup_capability(register const char *str, register GPERF_LEN_TYPE len);
+
+ #include "cap-from-name.h"
+ #include "cap-to-name.h"
+diff --git a/src/shared/errno-list.c b/src/shared/errno-list.c
+index 31b66ba..c6a01ee 100644
+--- a/src/shared/errno-list.c
++++ b/src/shared/errno-list.c
+@@ -23,7 +23,7 @@
+ #include "errno-list.h"
+
+ static const struct errno_name* lookup_errno(register const char *str,
+- register unsigned int len);
++ register GPERF_LEN_TYPE len);
+
+ #include "errno-to-name.h"
+ #include "errno-from-name.h"
+diff --git a/src/login/logind.h b/src/login/logind.h
+index 086fa1e..7556ee2 100644
+--- a/src/login/logind.h
++++ b/src/login/logind.h
+@@ -182,7 +182,7 @@ int manager_unit_is_active(Manager *manager, const char *unit);
+ int manager_job_is_active(Manager *manager, const char *path);
+
+ /* gperf lookup function */
+-const struct ConfigPerfItem* logind_gperf_lookup(const char *key, unsigned length);
++const struct ConfigPerfItem* logind_gperf_lookup(const char *key, GPERF_LEN_TYPE length);
+
+ int manager_set_lid_switch_ignore(Manager *m, usec_t until);
+
diff --git a/pcr/elogind/elogind-219.12-login1-perms.patch b/pcr/elogind/elogind-219.12-login1-perms.patch
new file mode 100644
index 000000000..eecf38ee1
--- /dev/null
+++ b/pcr/elogind/elogind-219.12-login1-perms.patch
@@ -0,0 +1,129 @@
+From 1ca40c077cd9a08f96a559ba51e8dba230298c4d Mon Sep 17 00:00:00 2001
+From: Michael Palimaka <kensington@gentoo.org>
+Date: Sun, 19 Jun 2016 01:56:56 +1000
+Subject: [PATCH] Update org.freedesktop.login1.conf
+
+This mirrors an upstream change opening up all of logind's bus calls to
+unprivileged users via polkit.
+
+See systemd/systemd/issues/471.
+Closes #3.
+---
+ src/login/org.freedesktop.login1.conf | 68 +++++++++++++++++++++++++++++++++++
+ 1 file changed, 68 insertions(+)
+
+diff --git a/src/login/org.freedesktop.login1.conf b/src/login/org.freedesktop.login1.conf
+index 1318328..2e67e3d 100644
+--- a/src/login/org.freedesktop.login1.conf
++++ b/src/login/org.freedesktop.login1.conf
+@@ -90,6 +90,42 @@
+
+ <allow send_destination="org.freedesktop.login1"
+ send_interface="org.freedesktop.login1.Manager"
++ send_member="LockSession"/>
++
++ <allow send_destination="org.freedesktop.login1"
++ send_interface="org.freedesktop.login1.Manager"
++ send_member="UnlockSession"/>
++
++ <allow send_destination="org.freedesktop.login1"
++ send_interface="org.freedesktop.login1.Manager"
++ send_member="LockSessions"/>
++
++ <allow send_destination="org.freedesktop.login1"
++ send_interface="org.freedesktop.login1.Manager"
++ send_member="UnlockSessions"/>
++
++ <allow send_destination="org.freedesktop.login1"
++ send_interface="org.freedesktop.login1.Manager"
++ send_member="KillSession"/>
++
++ <allow send_destination="org.freedesktop.login1"
++ send_interface="org.freedesktop.login1.Manager"
++ send_member="KillUser"/>
++
++ <allow send_destination="org.freedesktop.login1"
++ send_interface="org.freedesktop.login1.Manager"
++ send_member="TerminateSession"/>
++
++ <allow send_destination="org.freedesktop.login1"
++ send_interface="org.freedesktop.login1.Manager"
++ send_member="TerminateUser"/>
++
++ <allow send_destination="org.freedesktop.login1"
++ send_interface="org.freedesktop.login1.Manager"
++ send_member="TerminateSeat"/>
++
++ <allow send_destination="org.freedesktop.login1"
++ send_interface="org.freedesktop.login1.Manager"
+ send_member="PowerOff"/>
+
+ <allow send_destination="org.freedesktop.login1"
+@@ -130,6 +166,10 @@
+
+ <allow send_destination="org.freedesktop.login1"
+ send_interface="org.freedesktop.login1.Manager"
++ send_member="SetWallMessage"/>
++
++ <allow send_destination="org.freedesktop.login1"
++ send_interface="org.freedesktop.login1.Manager"
+ send_member="AttachDevice"/>
+
+ <allow send_destination="org.freedesktop.login1"
+@@ -138,6 +178,10 @@
+
+ <allow send_destination="org.freedesktop.login1"
+ send_interface="org.freedesktop.login1.Seat"
++ send_member="Terminate"/>
++
++ <allow send_destination="org.freedesktop.login1"
++ send_interface="org.freedesktop.login1.Seat"
+ send_member="ActivateSession"/>
+
+ <allow send_destination="org.freedesktop.login1"
+@@ -154,14 +198,30 @@
+
+ <allow send_destination="org.freedesktop.login1"
+ send_interface="org.freedesktop.login1.Session"
++ send_member="Terminate"/>
++
++ <allow send_destination="org.freedesktop.login1"
++ send_interface="org.freedesktop.login1.Session"
+ send_member="Activate"/>
+
+ <allow send_destination="org.freedesktop.login1"
+ send_interface="org.freedesktop.login1.Session"
++ send_member="Lock"/>
++
++ <allow send_destination="org.freedesktop.login1"
++ send_interface="org.freedesktop.login1.Session"
++ send_member="Unlock"/>
++
++ <allow send_destination="org.freedesktop.login1"
++ send_interface="org.freedesktop.login1.Session"
+ send_member="SetIdleHint"/>
+
+ <allow send_destination="org.freedesktop.login1"
+ send_interface="org.freedesktop.login1.Session"
++ send_member="Kill"/>
++
++ <allow send_destination="org.freedesktop.login1"
++ send_interface="org.freedesktop.login1.Session"
+ send_member="TakeControl"/>
+
+ <allow send_destination="org.freedesktop.login1"
+@@ -180,6 +240,14 @@
+ send_interface="org.freedesktop.login1.Session"
+ send_member="PauseDeviceComplete"/>
+
++ <allow send_destination="org.freedesktop.login1"
++ send_interface="org.freedesktop.login1.User"
++ send_member="Terminate"/>
++
++ <allow send_destination="org.freedesktop.login1"
++ send_interface="org.freedesktop.login1.User"
++ send_member="Kill"/>
++
+ <allow receive_sender="org.freedesktop.login1"/>
+ </policy>
+
diff --git a/pcr/elogind/elogind-219.12-session.patch b/pcr/elogind/elogind-219.12-session.patch
new file mode 100644
index 000000000..82cbebdea
--- /dev/null
+++ b/pcr/elogind/elogind-219.12-session.patch
@@ -0,0 +1,45 @@
+From b5c5dd2ad43a3bf4fa0fb21139f8d16959b5d14e Mon Sep 17 00:00:00 2001
+From: Andy Wingo <wingo@pobox.com>
+Date: Sun, 6 Mar 2016 16:56:33 +0100
+Subject: [PATCH] Fixes to user and session saving
+
+* src/login/logind-dbus.c (method_create_session): No need to save
+ session here, as session_send_create_reply will do it.
+* src/login/logind-session-dbus.c (session_send_create_reply): On the
+ other hand we do need to save the user here, so the file marks them as
+ being active.
+---
+ src/login/logind-dbus.c | 2 --
+ src/login/logind-session-dbus.c | 5 +++--
+ 2 files changed, 3 insertions(+), 4 deletions(-)
+
+diff --git a/src/login/logind-dbus.c b/src/login/logind-dbus.c
+index 5e6952d..6f7e569 100644
+--- a/src/login/logind-dbus.c
++++ b/src/login/logind-dbus.c
+@@ -801,8 +801,6 @@ static int method_create_session(sd_bus *bus, sd_bus_message *message, void *use
+ if (r < 0)
+ goto fail;
+
+- session_save(session);
+-
+ return 1;
+
+ fail:
+diff --git a/src/login/logind-session-dbus.c b/src/login/logind-session-dbus.c
+index f71798b..337bbbb 100644
+--- a/src/login/logind-session-dbus.c
++++ b/src/login/logind-session-dbus.c
+@@ -721,9 +721,10 @@ int session_send_create_reply(Session *s, sd_bus_error *error) {
+ if (fifo_fd < 0)
+ return fifo_fd;
+
+- /* Update the session state file before we notify the client
+- * about the result. */
++ /* Update the session and user state files before we notify
++ * the client about the result. */
+ session_save(s);
++ user_save(s->user);
+
+ p = session_bus_path(s);
+ if (!p)
diff --git a/pcr/elogind/elogind.conf b/pcr/elogind/elogind.conf
new file mode 100644
index 000000000..167260a42
--- /dev/null
+++ b/pcr/elogind/elogind.conf
@@ -0,0 +1,7 @@
+# /etc/conf.d/elogind: config file for /etc/init.d/elogind
+
+# this is the elogind executable
+ELOGIND_EXEC="/usr/lib/elogind/elogind"
+
+# this is where elogind will store its pid file
+ELOGIND_PIDFILE="/run/elogind.pid"
diff --git a/pcr/elogind/elogind.init b/pcr/elogind/elogind.init
new file mode 100644
index 000000000..65a28e9c7
--- /dev/null
+++ b/pcr/elogind/elogind.init
@@ -0,0 +1,32 @@
+#!/usr/bin/openrc-run
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+depend() {
+ need dbus
+
+ # Make sure elogind is up before xdm starts any dm
+ before xdm
+}
+
+start() {
+ ebegin "Starting elogind"
+
+ # elogind needs a /run/systemd directory
+ if [[ ! -e /run/systemd ]]; then
+ mkdir -p /run/systemd
+ chmod 644 /run/systemd
+ fi
+
+ start-stop-daemon --start --quiet --background \
+ --make-pidfile --pidfile "${ELOGIND_PIDFILE}" \
+ --exec "${ELOGIND_EXEC}"
+ eend $?
+}
+
+stop() {
+ ebegin "Stopping elogind"
+ start-stop-daemon --stop --quiet --pidfile "${ELOGIND_PIDFILE}"
+ eend $?
+}
diff --git a/pcr/elogind/elogind.install b/pcr/elogind/elogind.install
index d5a5ec515..28cd5b59c 100644
--- a/pcr/elogind/elogind.install
+++ b/pcr/elogind/elogind.install
@@ -1,6 +1,7 @@
post_install() {
- echo "Add to /etc/pam.d/sddm-greeter"
- echo "session optional pam_elogind.so"
+ echo " ==> /etc/pam.d/system-login"
+ echo " ==> Replace pam_systemd.so in your pam config with:"
+ echo ' session optional pam_elogind.so'
}
post_upgrade() {