summaryrefslogtreecommitdiffstats
path: root/main/consolekit
diff options
context:
space:
mode:
Diffstat (limited to 'main/consolekit')
-rw-r--r--main/consolekit/APKBUILD8
-rw-r--r--main/consolekit/pam-foreground-compat.ck17
2 files changed, 23 insertions, 2 deletions
diff --git a/main/consolekit/APKBUILD b/main/consolekit/APKBUILD
index b5ff6878c..dfda9d30a 100644
--- a/main/consolekit/APKBUILD
+++ b/main/consolekit/APKBUILD
@@ -1,7 +1,7 @@
# Maintainer: Natanael Copa <ncopa@alpinelinux.org>
pkgname=consolekit
pkgver=0.4.4
-pkgrel=1
+pkgrel=2
pkgdesc="Framework for defining and tracking users, login sessions, and seats"
url="http://www.freedesktop.org/wiki/Software/ConsoleKit"
arch="all"
@@ -13,6 +13,7 @@ install=
subpackages="$pkgname-dev $pkgname-doc"
source="http://www.freedesktop.org/software/ConsoleKit/dist/ConsoleKit-$pkgver.tar.bz2
0001-busybox-reboot-and-poweroff-support.patch
+ pam-foreground-compat.ck
"
_builddir="$srcdir"/ConsoleKit-$pkgver
@@ -40,7 +41,10 @@ build() {
package() {
cd "$_builddir"
make DESTDIR="$pkgdir" install || return 1
+ install -m 755 "$srcdir"/pam-foreground-compat.ck \
+ "$pkgdir"/usr/lib/ConsoleKit/run-session.d/
}
md5sums="b57eb18eae8c4d3631d5f4f030218a29 ConsoleKit-0.4.4.tar.bz2
-acc4f44190cd677f95fd529d528c9cef 0001-busybox-reboot-and-poweroff-support.patch"
+acc4f44190cd677f95fd529d528c9cef 0001-busybox-reboot-and-poweroff-support.patch
+d75ed3438dab01552304c06fd9a967b1 pam-foreground-compat.ck"
diff --git a/main/consolekit/pam-foreground-compat.ck b/main/consolekit/pam-foreground-compat.ck
new file mode 100644
index 000000000..ce221c974
--- /dev/null
+++ b/main/consolekit/pam-foreground-compat.ck
@@ -0,0 +1,17 @@
+#!/bin/sh
+TAGDIR=/var/run/console
+
+[ -n "$CK_SESSION_USER_UID" ] || exit 1
+[ "$CK_SESSION_IS_LOCAL" = "true" ] || exit 0
+
+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