summaryrefslogtreecommitdiff
path: root/sys-auth/consolekit/files
diff options
context:
space:
mode:
authorV3n3RiX <venerix@redcorelinux.org>2017-10-09 18:53:29 +0100
committerV3n3RiX <venerix@redcorelinux.org>2017-10-09 18:53:29 +0100
commit4f2d7949f03e1c198bc888f2d05f421d35c57e21 (patch)
treeba5f07bf3f9d22d82e54a462313f5d244036c768 /sys-auth/consolekit/files
reinit the tree, so we can have metadata
Diffstat (limited to 'sys-auth/consolekit/files')
-rw-r--r--sys-auth/consolekit/files/90-consolekit-332
-rw-r--r--sys-auth/consolekit/files/consolekit-0.2.rc25
-rw-r--r--sys-auth/consolekit/files/consolekit-0.4.5-polkit-automagic.patch30
-rw-r--r--sys-auth/consolekit/files/consolekit-1.0.0.initd16
-rw-r--r--sys-auth/consolekit/files/consolekit-1.1.0-Remove-the-root-restriction-for-runtime-dirs.patch57
-rw-r--r--sys-auth/consolekit/files/consolekit-1.1.1-0001-Fix-enable-libudev-configure-flag.patch41
-rw-r--r--sys-auth/consolekit/files/consolekit-cleanup_console_tags.patch67
-rw-r--r--sys-auth/consolekit/files/consolekit-shutdown-reboot-without-policies.patch26
-rw-r--r--sys-auth/consolekit/files/consolekit-udev-acl-install_to_usr.patch28
-rw-r--r--sys-auth/consolekit/files/pam-foreground-compat.ck17
10 files changed, 339 insertions, 0 deletions
diff --git a/sys-auth/consolekit/files/90-consolekit-3 b/sys-auth/consolekit/files/90-consolekit-3
new file mode 100644
index 000000000000..358fc24f1a72
--- /dev/null
+++ b/sys-auth/consolekit/files/90-consolekit-3
@@ -0,0 +1,32 @@
+# -*- sh -*-
+# Xsession.d script for ck-launch-session.
+#
+#
+# This file is sourced by Xsession(5), not executed.
+
+CK_LAUNCH_SESSION=/usr/bin/ck-launch-session
+
+is_on_console() {
+ session=$(dbus-send --system --dest=org.freedesktop.ConsoleKit \
+ --type=method_call --print-reply --reply-timeout=2000 \
+ /org/freedesktop/ConsoleKit/Manager \
+ org.freedesktop.ConsoleKit.Manager.GetCurrentSession \
+ | grep path | awk '{print $3}' | sed s/\"//g)
+ x11_display=$(dbus-send --system --dest=org.freedesktop.ConsoleKit \
+ --type=method_call --print-reply --reply-timeout=2000 \
+ $session org.freedesktop.ConsoleKit.Session.GetX11Display \
+ | grep string | awk '{print $2}' | sed s/\"//g)
+
+ if [ -z "$x11_display" ] ; then
+ return 0
+ else
+ return 1
+ fi
+}
+
+# gdm already creates a CK session for us, so do not run the expensive D-Bus
+# calls if we have $GDMSESSION
+if [ -z "$GDMSESSION" ] && [ -x "$CK_LAUNCH_SESSION" ] && \
+ ( [ -z "$XDG_SESSION_COOKIE" ] || is_on_console ) ; then
+ command="$CK_LAUNCH_SESSION $command"
+fi
diff --git a/sys-auth/consolekit/files/consolekit-0.2.rc b/sys-auth/consolekit/files/consolekit-0.2.rc
new file mode 100644
index 000000000000..e2be0de6e1aa
--- /dev/null
+++ b/sys-auth/consolekit/files/consolekit-0.2.rc
@@ -0,0 +1,25 @@
+#!/sbin/openrc-run
+# Copyright 1999-2016 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License, v2 or later
+
+depend() {
+ need dbus
+ use logger
+}
+
+start() {
+ ebegin "Starting ConsoleKit daemon"
+
+ checkpath -q -d -m 0755 /var/run/ConsoleKit
+
+ start-stop-daemon --start -q \
+ --pidfile /var/run/ConsoleKit/pid \
+ --exec /usr/sbin/console-kit-daemon --
+ eend $?
+}
+
+stop() {
+ ebegin "Stopping ConsoleKit daemon"
+ start-stop-daemon --stop -q --pidfile /var/run/ConsoleKit/pid
+ eend $?
+}
diff --git a/sys-auth/consolekit/files/consolekit-0.4.5-polkit-automagic.patch b/sys-auth/consolekit/files/consolekit-0.4.5-polkit-automagic.patch
new file mode 100644
index 000000000000..b896089d4485
--- /dev/null
+++ b/sys-auth/consolekit/files/consolekit-0.4.5-polkit-automagic.patch
@@ -0,0 +1,30 @@
+http://bugs.freedesktop.org/show_bug.cgi?id=47587
+
+--- configure.ac
++++ configure.ac
+@@ -56,10 +56,21 @@
+ gthread-2.0 >= $GLIB_REQUIRED_VERSION
+ )
+
+-PKG_CHECK_MODULES(POLKIT,
+- polkit-gobject-1 >= $POLKIT_REQUIRED_VERSION,
+- have_polkit=yes,
+- have_polkit=no)
++AC_ARG_ENABLE([polkit],
++ AC_HELP_STRING([--enable-polkit], [Enable PolicyKit support (default auto)]),
++ enable_polkit=$enableval,
++ enable_polkit=auto)
++
++if test "x$enable_polkit" != "xno"; then
++ PKG_CHECK_MODULES(POLKIT,
++ polkit-gobject-1 >= $POLKIT_REQUIRED_VERSION,
++ have_polkit=yes,
++ have_polkit=no)
++ if test "x$enable_polkit" = "xyes" -a "x$have_polkit" = "xno"; then
++ AC_MSG_ERROR([PolicyKit support explicitly requested but dependencies not found])
++ fi
++fi
++
+ if test "x$have_polkit" = "xyes" ; then
+ AC_DEFINE(HAVE_POLKIT, [], [Define if we have polkit])
+ fi
diff --git a/sys-auth/consolekit/files/consolekit-1.0.0.initd b/sys-auth/consolekit/files/consolekit-1.0.0.initd
new file mode 100644
index 000000000000..4fd1140fe209
--- /dev/null
+++ b/sys-auth/consolekit/files/consolekit-1.0.0.initd
@@ -0,0 +1,16 @@
+#!/sbin/openrc-run
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License, v2 or later
+
+description="consolekit - tracks login sessions and seats"
+pidfile="/run/ConsoleKit/pid"
+command="/usr/sbin/console-kit-daemon"
+
+depend() {
+ need dbus
+ use logger
+}
+
+start_pre() {
+ checkpath -q -d -m 0755 /run/ConsoleKit
+}
diff --git a/sys-auth/consolekit/files/consolekit-1.1.0-Remove-the-root-restriction-for-runtime-dirs.patch b/sys-auth/consolekit/files/consolekit-1.1.0-Remove-the-root-restriction-for-runtime-dirs.patch
new file mode 100644
index 000000000000..301c68f5d904
--- /dev/null
+++ b/sys-auth/consolekit/files/consolekit-1.1.0-Remove-the-root-restriction-for-runtime-dirs.patch
@@ -0,0 +1,57 @@
+From 664d2fdbd966764836b1f4da2dbc5750c7f01f0f Mon Sep 17 00:00:00 2001
+From: Eric Koegel <eric.koegel@gmail.com>
+Date: Sun, 10 Apr 2016 11:20:24 +0300
+Subject: [PATCH] Remove the root restriction for runtime dirs
+
+---
+ src/ck-sysdeps-unix.c | 5 -----
+ tools/ck-remove-directory.c | 10 ----------
+ 2 files changed, 15 deletions(-)
+
+diff --git a/src/ck-sysdeps-unix.c b/src/ck-sysdeps-unix.c
+index 67d8eac..ecd176a 100644
+--- a/src/ck-sysdeps-unix.c
++++ b/src/ck-sysdeps-unix.c
+@@ -409,11 +409,6 @@ ck_generate_runtime_dir_for_user (guint uid)
+
+ TRACE ();
+
+- if (uid < 1) {
+- g_debug ("We do not create runtime dirs for root");
+- return NULL;
+- }
+-
+ errno = 0;
+ pwent = getpwuid (uid);
+ if (pwent == NULL) {
+diff --git a/tools/ck-remove-directory.c b/tools/ck-remove-directory.c
+index cf44fd6..b1a5722 100644
+--- a/tools/ck-remove-directory.c
++++ b/tools/ck-remove-directory.c
+@@ -51,11 +51,6 @@ become_user (uid_t uid, const gchar* dest)
+ int res;
+ struct passwd *pwent;
+
+- if (uid < 1) {
+- g_critical ("invalid UID");
+- exit (1);
+- }
+-
+ if (dest == NULL) {
+ g_critical ("invalid dest");
+ exit (1);
+@@ -148,11 +143,6 @@ main (int argc,
+ exit (1);
+ }
+
+- if (user_id < 1) {
+- g_warning ("Invalid UID");
+- exit (1);
+- }
+-
+ /* Ensure we have a dest and that it starts with the correct prefix
+ * so we don't remove something important.
+ */
+--
+2.7.3
+
diff --git a/sys-auth/consolekit/files/consolekit-1.1.1-0001-Fix-enable-libudev-configure-flag.patch b/sys-auth/consolekit/files/consolekit-1.1.1-0001-Fix-enable-libudev-configure-flag.patch
new file mode 100644
index 000000000000..c6cc61d47843
--- /dev/null
+++ b/sys-auth/consolekit/files/consolekit-1.1.1-0001-Fix-enable-libudev-configure-flag.patch
@@ -0,0 +1,41 @@
+From 91f517bb6e19315c3a9971b2449f2b2e049e785b Mon Sep 17 00:00:00 2001
+From: Eric Koegel <eric.koegel@gmail.com>
+Date: Wed, 10 May 2017 07:13:23 +0300
+Subject: [PATCH] Fix --enable-libudev configure flag
+
+Thanks for perfinion to pointing this out.
+---
+ configure.ac | 10 +++++-----
+ 1 file changed, 5 insertions(+), 5 deletions(-)
+
+diff --git a/configure.ac b/configure.ac
+index 2d927fe..b17801a 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -364,10 +364,10 @@ AM_CONDITIONAL([ENABLE_UDEV_ACL], [test "x$enable_udev_acl" = "xyes"])
+ # libudev - use udev as a device manager for ck-device-udev.c
+ have_libudev=no
+ AC_ARG_ENABLE([libudev],
+- AS_HELP_STRING([--enable-udev], [Enable udev support @<:@default=auto@:>@]),
+- [enable_udev=$enableval],
+- [enable_udev=auto])
+-AS_IF([test "x$enable_udev" != "xno"], [
++ AS_HELP_STRING([--enable-libudev], [Enable udev support @<:@default=auto@:>@]),
++ [enable_libudev=$enableval],
++ [enable_libudev=auto])
++AS_IF([test "x$enable_libudev" != "xno"], [
+ PKG_CHECK_MODULES([LIBUDEV], [libudev], [have_libudev=yes], [have_libudev=no])
+ PKG_CHECK_MODULES([LIBDRM], [libdrm], [have_libdrm=yes], [have_libdrm=no])
+ AC_CHECK_LIB([prop], [prop_dictionary_get_cstring], [have_libprop=yes], [have_libprop=no])
+@@ -384,7 +384,7 @@ AS_IF([test "x$enable_udev" != "xno"], [
+ LIBUDEV_LIBS="$LIBUDEV_LIBS -lprop"
+ fi
+
+- if test "x$enable_udev" = "xyes" -a "x$have_udev" = "xno"; then
++ if test "x$enable_libudev" = "xyes" -a "x$have_libudev" = "xno"; then
+ AC_MSG_ERROR([udev support explicitly requested but dependencies not found])
+ fi
+ ])
+--
+2.10.2
+
diff --git a/sys-auth/consolekit/files/consolekit-cleanup_console_tags.patch b/sys-auth/consolekit/files/consolekit-cleanup_console_tags.patch
new file mode 100644
index 000000000000..c02411ebded5
--- /dev/null
+++ b/sys-auth/consolekit/files/consolekit-cleanup_console_tags.patch
@@ -0,0 +1,67 @@
+http://bugs.gentoo.org/257761
+http://patches.ubuntu.com/by-release/extracted/ubuntu/c/consolekit/
+
+--- src/main.c
++++ src/main.c
+@@ -148,6 +148,43 @@
+ unlink (CONSOLE_KIT_PID_FILE);
+ }
+
++#define CONSOLE_TAGS_DIR "/var/run/console"
++
++static void
++delete_console_tags (void)
++{
++ GDir *dir;
++ GError *error = NULL;
++ const gchar *name;
++
++ g_debug ("Cleaning up %s", CONSOLE_TAGS_DIR);
++
++ dir = g_dir_open (CONSOLE_TAGS_DIR, 0, &error);
++ if (dir == NULL) {
++ g_debug ("Couldn't open directory %s: %s", CONSOLE_TAGS_DIR,
++ error->message);
++ g_error_free (error);
++ return;
++ }
++ while ((name = g_dir_read_name (dir)) != NULL) {
++ gchar *file;
++ file = g_build_filename (CONSOLE_TAGS_DIR, name, NULL);
++
++ g_debug ("Removing tag file: %s", file);
++ if (unlink (file) == -1) {
++ g_warning ("Couldn't delete tag file: %s", file);
++ }
++ g_free (file);
++ }
++}
++
++static void
++cleanup (void)
++{
++ delete_console_tags ();
++ delete_pid ();
++}
++
+ /* copied from nautilus */
+ static int debug_log_pipes[2];
+
+@@ -228,7 +265,7 @@
+ snprintf (pid, sizeof (pid), "%lu\n", (long unsigned) getpid ());
+ written = write (pf, pid, strlen (pid));
+ close (pf);
+- g_atexit (delete_pid);
++ g_atexit (cleanup);
+ } else {
+ g_warning ("Unable to write pid file %s: %s",
+ CONSOLE_KIT_PID_FILE,
+@@ -317,6 +354,8 @@
+ goto out;
+ }
+
++ delete_console_tags ();
++
+ create_pid_file ();
+
+ loop = g_main_loop_new (NULL, FALSE);
diff --git a/sys-auth/consolekit/files/consolekit-shutdown-reboot-without-policies.patch b/sys-auth/consolekit/files/consolekit-shutdown-reboot-without-policies.patch
new file mode 100644
index 000000000000..6a46649f7587
--- /dev/null
+++ b/sys-auth/consolekit/files/consolekit-shutdown-reboot-without-policies.patch
@@ -0,0 +1,26 @@
+From: Romain Perier <mrpouet@gentoo.org>
+Date: Sat, 24 Oct 2009 18:43:43 +0200
+Subject: [PATCH] Be able to shutdown or reboot even without polkit or RBAC supports
+
+Ck does NOTHING at the origin if its built without polkit or RBAC supports, except
+display a warning using g_warning() (which does not make sense).
+The trick is to to call do_stop()/do_restart() in the #else directive :)
+
+--- src/ck-manager.c
++++ src/ck-manager.c
+@@ -1131,6 +1131,7 @@
+ check_rbac_permissions (manager, context, RBAC_SHUTDOWN_KEY, do_restart);
+ #else
+ g_warning ("Compiled without PolicyKit or RBAC support!");
++ do_restart(manager, context);
+ #endif
+
+ return TRUE;
+@@ -1207,6 +1208,7 @@
+ check_rbac_permissions (manager, context, RBAC_SHUTDOWN_KEY, do_stop);
+ #else
+ g_warning ("Compiled without PolicyKit or RBAC support!");
++ do_stop(manager, context);
+ #endif
+
+ return TRUE;
diff --git a/sys-auth/consolekit/files/consolekit-udev-acl-install_to_usr.patch b/sys-auth/consolekit/files/consolekit-udev-acl-install_to_usr.patch
new file mode 100644
index 000000000000..3ef39873dbd6
--- /dev/null
+++ b/sys-auth/consolekit/files/consolekit-udev-acl-install_to_usr.patch
@@ -0,0 +1,28 @@
+http://bugs.gentoo.org/398049
+
+--- tools/Makefile.am
++++ tools/Makefile.am
+@@ -144,11 +144,10 @@
+ $(NULL)
+
+ if ENABLE_UDEV_ACL
+-udevdir = $(UDEVDIR)
+ udevrulesdir = $(UDEVDIR)/rules.d
+
+ dist_udevrules_DATA = 70-udev-acl.rules
+-udev_PROGRAMS = udev-acl
++libexec_PROGRAMS = udev-acl
+
+ udev_acl_SOURCES = udev-acl.c
+ udev_acl_LDADD = $(UDEV_ACL_LIBS)
+@@ -156,7 +155,9 @@
+
+ install-exec-hook:
+ mkdir -p $(DESTDIR)$(prefix)/lib/ConsoleKit/run-seat.d
+- ln -sf $(UDEVDIR)/udev-acl $(DESTDIR)$(prefix)/lib/ConsoleKit/run-seat.d/udev-acl.ck
++ mkdir -p $(DESTDIR)$(UDEVDIR)
++ ln -sf $(libexecdir)/udev-acl $(DESTDIR)$(prefix)/lib/ConsoleKit/run-seat.d/udev-acl.ck
++ ln -sf $(libexecdir)/udev-acl $(DESTDIR)$(UDEVDIR)/udev-acl
+ endif
+
+ EXTRA_DIST = \
diff --git a/sys-auth/consolekit/files/pam-foreground-compat.ck b/sys-auth/consolekit/files/pam-foreground-compat.ck
new file mode 100644
index 000000000000..0697ca81ba45
--- /dev/null
+++ b/sys-auth/consolekit/files/pam-foreground-compat.ck
@@ -0,0 +1,17 @@
+#!/bin/sh
+TAGDIR=/var/run/console
+
+[ -n "$CK_SESSION_USER_UID" ] || exit 1
+
+TAGFILE="$TAGDIR/`getent passwd $CK_SESSION_USER_UID | cut -f 1 -d:`"
+
+if [ "$1" = "session_added" ]; then
+ mkdir -p "$TAGDIR"
+ echo "$CK_SESSION_ID" >> "$TAGFILE"
+fi
+
+if [ "$1" = "session_removed" ] && [ -e "$TAGFILE" ]; then
+ sed -i "\%^$CK_SESSION_ID\$%d" "$TAGFILE"
+ [ -s "$TAGFILE" ] || rm -f "$TAGFILE"
+fi
+