diff options
27 files changed, 1415 insertions, 0 deletions
diff --git a/debian/90consolekit b/debian/90consolekit new file mode 100644 index 0000000..f0082a7 --- /dev/null +++ b/debian/90consolekit @@ -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 + STARTUP="$CK_LAUNCH_SESSION $STARTUP" +fi diff --git a/debian/README.Debian b/debian/README.Debian new file mode 100644 index 0000000..31cd315 --- /dev/null +++ b/debian/README.Debian @@ -0,0 +1,8 @@ +ConsoleKit for Debian +--------------------- + +ConsoleKit allows to track seats and sessions. It either needs integration +into the login manager, like gdm, or it can go through a pam module. +Install the package libpam-ck-connector for that. + + -- Michael Biebl <biebl@debian.org> Thu, 29 Mar 2007 01:38:27 +0200 diff --git a/debian/changelog b/debian/changelog new file mode 100644 index 0000000..4d2bc8e --- /dev/null +++ b/debian/changelog @@ -0,0 +1,403 @@ +consolekit (0.4.4-2) UNRELEASED; urgency=low + + * Bump Standards-Version to 3.9.2. No further changes. + * Bump debhelper compatibility level to 8. + + -- Michael Biebl <biebl@debian.org> Tue, 19 Apr 2011 10:48:03 +0200 + +consolekit (0.4.4-1) unstable; urgency=low + + * New upstream release. + + -- Michael Biebl <biebl@debian.org> Fri, 25 Feb 2011 21:06:58 +0100 + +consolekit (0.4.3-2) unstable; urgency=low + + * Add 01-retry-console-open-on-EIO.patch: As reported in LP: #544139, + ConsoleKit sometimes fails to track the active VT. This particular case + was tracked down to a race condition that happens if you try to open + /dev/console while the current TTY is currently being closed. This yields + an -EIO error, in which case CK should just try again. Thanks Colin Watson + for the patch! + + -- Martin Pitt <mpitt@debian.org> Sat, 20 Nov 2010 18:17:28 +0100 + +consolekit (0.4.3-1) unstable; urgency=low + + * New upstream release. + - The VT_WAITEVENT mechanism proved to be racy and e.g. caused events + being lost on suspend/resume. So this change was reverted again. + (Closes: #600756) + * Remove patches + - d/p/01-fallback_no_vt_waitevent.patch (obsolete) + - d/p/80-gnukfreebsd_support_configure.ac.patch (merged upstream) + - d/p/debian/patches/99-autoreconf.patch (use dh-autoreconf instead) + * Use dh-autoreconf to update the build system + - Add Build-Depends on dh-autoreconf. + - Run autoreconf dh addon in debian/rules. + * Switch to source format 3.0 (quilt) + - Add debian/source/format. + - Drop quilt from Build-Depends. + - Remove /usr/share/cdbs/1/rules/patchsys-quilt.mk include. + - Remove debian/README.source. + * Move from cdbs to dh + - Drop Build-Depends on cdbs. + - Bump Build-Depends on debhelper to (>= 7.0.50~) for override targets. + - Convert debian/rules to use dh. + * debian/libck-connector-dev.install + - Install D-Bus interfaces files. + * Install systemd unit files. + * debian/consolekit.docs + - Install AUTHORS, NEWS, README and TODO. cdbs did this automatically for + us, with dh we have to list them explicitly. + + -- Michael Biebl <biebl@debian.org> Wed, 17 Nov 2010 08:40:58 +0100 + +consolekit (0.4.2-1) unstable; urgency=low + + * New upstream release. + - Use VT_WAITEVENT ioctl to monitor VT switches to avoid spawning a thread + for each possible VT. This requires a Linux kernel 2.6.32 or newer. + (Closes: #526499) + * debian/control + - Bump Standards-Version to 3.9.1. + - Use architecture wildcard kfreebsd-any for the libkvm-dev Build-Depends. + - Bump Build-Depends on libglib2.0-dev to (>= 2.14.0) for GRegex. + * Remove patches which have been merged upstream. + - debian/patches/01-dont_daemonize_when_activated.patch + - debian/patches/02-dont_take_bus_name_until_ready.patch + - debian/patches/04-dont_fail_with_invalid_seats_file.patch + * debian/patches/01-fallback_no_vt_waitevent.patch + - Add runtime check for VT_WAITEVENT and fallback to old behaviour of + creating a thread for every possible VT. + * debian/patches/82-hurd_support.patch + - Updated for 0.4.2. + - Check return value of malloc() to correctly handle OOM situations. + Thanks Pino Toscano for the updated patch. + + -- Michael Biebl <biebl@debian.org> Tue, 21 Sep 2010 05:52:04 +0200 + +consolekit (0.4.1-4) unstable; urgency=low + + [ Martin Pitt ] + * debian/90consolekit: gdm already creates a CK session for us, so do not + run the expensive D-Bus calls if we have $GDMSESSION. + * Bump Standards-Version to 3.8.4 (no changes necessary). + + -- Michael Biebl <biebl@debian.org> Wed, 24 Feb 2010 23:47:23 +0100 + +consolekit (0.4.1-3) unstable; urgency=low + + [ Martin Pitt ] + * Bump Breaks to udev to << 147, since 147-1 is in unstable now. + + [ Michael Biebl ] + * debian/patches/01-dont_daemonize_when_activated.patch + - Don't daemonize when being activated by D-Bus. D-Bus service activation + does not (yet) handle forking daemons properly. + Patch pulled from upstream Git. + * debian/patches/04-defer_daemonizing.patch + - Drop this patch, obsoleted by 01-dont_daemonize_when_activated.patch. + * debian/patches/02-dont_take_bus_name_until_ready.patch + - Claim bus name after registering the manager object. This fixes a race + when being activated by a method call on the manager object, where + ConsoleKit gets started but the method call fails. (Closes: #561592) + Patch pulled from upstream Git. + * debian/patches/04-dont_fail_with_invalid_seats_file.patch + - Don't segfault when reading an invalid seats file and + ck_seat_new_from_file returns NULL. (Closes: #561106) + + -- Michael Biebl <biebl@debian.org> Tue, 12 Jan 2010 13:48:08 +0100 + +consolekit (0.4.1-2) unstable; urgency=low + + * Upload to unstable. + + -- Michael Biebl <biebl@debian.org> Tue, 10 Nov 2009 00:12:42 +0100 + +consolekit (0.4.1-1) experimental; urgency=low + + * New upstream release. + * The 'session_active_changed' type has been removed for session.d/ + callouts. Tools relying on that need to be ported to the new seat.d/ + infrastructure and use 'seat_active_session_changed' instead. + This breaks older versions of udev-acl, so add a Breaks: udev (<< 147~). + + -- Michael Biebl <biebl@debian.org> Thu, 05 Nov 2009 17:38:31 +0100 + +consolekit (0.3.1-2) unstable; urgency=low + + [ Martin Pitt ] + * debian/consolekit.preinst: Remove obsolete 90-console-kit conffile for + upgrades from Ubuntu 8.04. (Can be dropped after 10.04 LTS release.) + + [ Michael Biebl ] + * debian/patches/82-hurd_support.patch + - Add support for GNU/Hurd. (Closes: #552393) + The patch adds a sysdeps-gnu backend, which implements the process + management using Hurd's libps, the *ttyent API for the part of the + console implementation and the rest using similar (valid) approaches of + other backends. + Also, it fixes the PATH_MAX usage in pam-ck-connector/pam-ck-connector.c + by using a variable-length malloc'ed buffer. + Thanks to Pino Toscano for the patch. + * debian/patches/99-autoreconf.patch + - Run autoreconf as 82-hurd_support.patch changes the build system. + * debian/patches/81-gnukfreebsd_support_pseudo_run_autoconf.patch + - Remove, made obsolete by 99-autoreconf.patch. + + -- Michael Biebl <biebl@debian.org> Mon, 26 Oct 2009 00:52:52 +0100 + +consolekit (0.3.1-1) unstable; urgency=low + + * New upstream release: + - port to PolicyKit 1.0 + - D-Bus policy updates + - better diagnostic information for unimplemented backends + - file monitoring fixes + - get VT from X display if no controlling tty is available + - add "nox11" option to PAM module + - parse log entries with no body correctly + - fix zero-sized struct/unions + - solaris build fixes + - parse gecos field for real name + - leak fixes + - compile warning fixes + - fix doc xml validation errors + - fix doc generation when srcdir != builddir + - add example upstart events for logging + - fix ChangeLog generation script to work with git-log moved to libexecdir + * debian/control + - Add Build-Depends on libpolkit-gobject-1-dev (>= 0.92). + * debian/consolekit.install + - Install policy definitions for ConsoleKit. + * Drop patches + - 04-consolekit_park.patch (obsolete, not used) + - 05-dbus_policy.patch (merged upstream) + - 05-pam-add-nox11.patch (merged upstream) + - 06-xmlto_skip_validation.patch (fixed upstream, doc is valid xml now) + - 08-fix-double-close.patch (merged upstream) + - 09-directory-handle-leak.patch (merged upstream) + - 10-file_monitor_remove_watch_crash.patch (merged upstream) + - 11-unref-dbus-proxy.patch (merged upstream) + - 12-allow-get-sessions.patch (merged upstream) + * debian/pam-foreground-compat.ck + - Don't create tag files for remote users. (Closes: #547347) + + -- Michael Biebl <biebl@debian.org> Fri, 02 Oct 2009 02:58:05 +0200 + +consolekit (0.3.0-4) unstable; urgency=low + + * debian/consolekit.logrotate: Install a logrotate configuration file for + /var/log/ConsoleKit/history so that it doesn't get huge and cause + ck-history to take a long while to run on login. ck-history already + handles reading from rotated logs. (Closes: #537833) + Thanks to James Westby for the patch. + * debian/libpam-ck-connector.pam-auth-update: Mark this module as applying + only to interactive sessions. (Closes: #543306) + Thanks to Steve Langasek for the patch. + * Add README.source which refers to the quilt documentation. + * Bump Standards-Version to 3.8.3. + + -- Michael Biebl <biebl@debian.org> Wed, 02 Sep 2009 18:04:01 +0200 + +consolekit (0.3.0-3) unstable; urgency=low + + * debian/control + - Update Vcs-* fields. Package is now managed with Git on git.debian.org. + - Bump Standards-Version to 3.8.2. No further changes. + * debian/copyright + - Misc whitespace cleanups. + - Refer to versioned GPL-2 file. + * debian/consolekit.preinst + - Use "set -e" instead of "#!/bin/sh -e". + * debian/90consolekit + - If an X session is started from the console using startx, make sure to + register a CK session, even if XDG_SESSION_COOKIE is already set. + (Closes: #520720) + + -- Michael Biebl <biebl@debian.org> Tue, 14 Jul 2009 20:09:54 +0200 + +consolekit (0.3.0-2) unstable; urgency=low + + * debian/consolekit.prerm + - Stop console-kit-daemon upon package removal (using start-stop-daemon). + (Closes: #518346) + + -- Michael Biebl <biebl@debian.org> Tue, 10 Mar 2009 17:15:35 +0100 + +consolekit (0.3.0-1) unstable; urgency=low + + * New upstream release. + * debian/patches/01-dbus_policy.patch + - Removed, the access to the restart and stop actions is now properly + restricted by checks in the source code. + * debian/patches/02-exit_with_dbus.patch + - Removed, merged upstream. + * debian/patches/05-dbus_policy.patch + - Updated by pulling latest patch from upstream Git. + * debian/patches/06-xmlto_skip_validation.patch + - Skip XML validation when generating the documentation. (Closes: #516253) + A proper fix will be, to make ConsoleKit.xml actually valid XML. + * debian/consolekit.docs + - Update path to spec html file. + * Merge patches from Ubuntu + - debian/patches/04-consolekit_park.patch (Closes: #489032) + - debian/patches/05-pam-add-nox11.patch + - debian/patches/08-fix-double-close.patch + - debian/patches/09-directory-handle-leak.patch (Closes: #516532) + - debian/patches/10-file_monitor_remove_watch_crash.patch + - debian/patches/11-unref-dbus-proxy.patch + - debian/patches/12-allow-get-sessions.patch + * debian/control + - Wrap Build-Depends. + - Bump Build-Depends on debhelper to (>= 7). + * debian/compat + - Bump debhelper compat level to 7. + * Fix FTBFS on GNU/kFreeBSD. (Closes: #511270) + - debian/patches/80-gnukfreebsd_support_configure.ac.patch + debian/patches/81-gnukfreebsd_support_pseudo_run_autoconf.patch + + Add kfreebsd target to configure(.ac) script + - debian/control + + Add libkvm-dev to Build-Depends on kfreebsd ports. + Patch by Luca Favatella, thanks. + * debian/libpam-ck-connector.{pam-auth-update,install,postinst,prerm}, + debian/rules: enable pam_ck_connector by default using the new + pam-auth-update support. + * debian/control: depend on libpam-runtime (>= 1.0.1-6) for the above. + + -- Michael Biebl <biebl@debian.org> Tue, 10 Mar 2009 12:48:43 +0100 + +consolekit (0.2.10-5) unstable; urgency=high + + * debian/watch + - Fix the regex to not use the second Perl group. + * Urgency high as it still blocks #503532. + + -- Michael Biebl <biebl@debian.org> Thu, 08 Jan 2009 16:56:40 +0100 + +consolekit (0.2.10-4) unstable; urgency=high + + [ Michael Biebl ] + * debian/watch + - Check for both .gz and .bz2 tarballs. + * debian/control + - Add ${misc:Depends} to libck-connector-dev. + + [ Simon McVittie ] + * debian/patches/05-dbus_policy.patch: patch from + Colin Walters so ConsoleKit introspection and SetIdleHint still work + after CVE-2008-4311 is fixed in dbus-daemon. (Closes: #510645) + * Urgency high for bugfix that blocks CVE-2008-4311 upload. + + -- Michael Biebl <biebl@debian.org> Wed, 07 Jan 2009 17:58:29 +0100 + +consolekit (0.2.10-3) unstable; urgency=low + + * debian/patches/04-defer_daemonizing.patch + - Daemonize after registering the dbus name to avoid a race condition + where dbus-daemon thinks that console-kit-daemon has failed to start + properly and returns an error to the caller. (Closes: #507815) + * Document all patches to make lintian happy. + + -- Michael Biebl <biebl@debian.org> Fri, 05 Dec 2008 01:28:46 +0100 + +consolekit (0.2.10-2) unstable; urgency=high + + * debian/patches/03-cleanup_console_tags.patch + - Properly initialize GError to avoid daemon crash if /var/run/console/ + does not exist. Also, demote message about it from warning to debug, + since it is not an error condition at all. (Closes: #492686) + Patch by Martin Pitt, thanks. + + -- Michael Biebl <biebl@debian.org> Mon, 28 Jul 2008 11:09:28 +0200 + +consolekit (0.2.10-1) unstable; urgency=low + + * New upstream release. (Closes: #464005, #489030) + * debian/control + - Add Build-Depends on pkg-config. + - Add Build-Depends on zlib1g-dev. + - Add Build-Depends on quilt. + - Bump Standards-Version to 3.8.0. No further changes. + * debian/org.freedesktop.ConsoleKit.service + - Removed, merged upstream. + * debian/libck-connector0.symbols + - Add symbols file for libck-connector library. + * consolekit.install + - Install all binaries in /usr/bin and /usr/sbin instead of listing them + individually. + - Update the list of installed directories. + - Install 90consolekit into /etc/X11/Xsession.d. + * debian/pam-foreground-compat.ck + - Add run-session.d script which creates pam_console compatible tag files. + Script shamelessly taken from Ubuntu. (Closes: #422349) + * debian/rules + - Install pam-foreground-compat.ck into /usr/lib/ConsoleKit/run-session.d. + - Include patchsys-quilt.mk for patch management. + * debian/90consolekit + - Xsession ConsoleKit integration. Script is taken from Ubuntu but renamed + to better fit with the existing naming conventions for Xsession scripts. + (Closes: #452627) + * debian/patches/01-dbus_policy.patch + - Allow only root to call the Restart and Stop D-Bus methods since we are + not using PolicyKit to restrict the access to those methods. + * debian/patches/02-exit_with_dbus.patch + - Pulled from upstream git. Exit when D-Bus system bus is stopped. + * debian/patches/03-cleanup_console_tags.patch + - Cleanup console tag files on application startup and shutdown. + + -- Michael Biebl <biebl@debian.org> Sat, 26 Jul 2008 00:29:46 +0200 + +consolekit (0.2.3-3) unstable; urgency=low + + * debian/control + - The Vcs-* fields are now officially supported, so remove the XS- prefix. + - Bump Standards-Version to 3.7.3. No further changes required. + - Drop dependency on lsb-base, as we no longer install a SysV init script. + - Tighten dependency on dbus (>= 1.1.2). This is required for the D-Bus + system activation support. + * debian/consolekit.init + - Deleted, no longer required. + * debian/consolekit.install + - Install the D-Bus service file debian/org.freedesktop.ConsoleKit.service + into /usr/share/dbus-1/system-services. This allows to start the + ConsoleKit service on demand. + * debian/consolekit.preinst + - Make sure the conffile /etc/init.d/consolekit and its symlinks in + /etc/rc?.d are properly removed on package upgrades. + + -- Michael Biebl <biebl@debian.org> Tue, 11 Dec 2007 23:14:14 +0100 + +consolekit (0.2.3-2) unstable; urgency=low + + * debian/control + - Add Depends: lsb-base (>= 3.0-6) as the init script uses the LSB logging + functions. + - Use the new "Homepage:" field to specify the upstream URL. + + -- Michael Biebl <biebl@debian.org> Sun, 21 Oct 2007 20:04:16 +0200 + +consolekit (0.2.3-1) unstable; urgency=low + + * New upstream release. + * debian/consolekit.install + - Install the ck-get-x11-display-device binary. + - Install the configuration files in /etc/ConsoleKit/. + * debian/consolekit.docs + - Install the ConsoleKit specification document. + + -- Michael Biebl <biebl@debian.org> Wed, 19 Sep 2007 21:34:38 +0200 + +consolekit (0.2.1-2) unstable; urgency=low + + * Upload to unstable. + + -- Michael Biebl <biebl@debian.org> Fri, 10 Aug 2007 00:22:56 +0200 + +consolekit (0.2.1-1) experimental; urgency=low + + * Initial release. (Closes: #416568) + + -- Michael Biebl <biebl@debian.org> Thu, 29 Mar 2007 01:38:27 +0200 + diff --git a/debian/compat b/debian/compat new file mode 100644 index 0000000..45a4fb7 --- /dev/null +++ b/debian/compat @@ -0,0 +1 @@ +8 diff --git a/debian/consolekit.docs b/debian/consolekit.docs new file mode 100644 index 0000000..7bb1580 --- /dev/null +++ b/debian/consolekit.docs @@ -0,0 +1,5 @@ +debian/tmp/usr/share/doc/ConsoleKit/spec/ConsoleKit.html +AUTHORS +NEWS +README +TODO diff --git a/debian/consolekit.install b/debian/consolekit.install new file mode 100644 index 0000000..8386ffc --- /dev/null +++ b/debian/consolekit.install @@ -0,0 +1,17 @@ +debian/tmp/etc/dbus-1/system.d/ConsoleKit.conf +debian/tmp/etc/ConsoleKit/ +debian/tmp/usr/share/dbus-1/system-services/ +debian/tmp/usr/share/polkit-1/ +debian/tmp/usr/lib/ConsoleKit/ +debian/tmp/var/log/ConsoleKit/ +debian/tmp/usr/sbin/ +debian/tmp/usr/bin/ +debian/90consolekit etc/X11/Xsession.d/ +debian/tmp/lib/systemd/system/console-kit-daemon.service +debian/tmp/lib/systemd/system/console-kit-log-system-start.service +debian/tmp/lib/systemd/system/console-kit-log-system-stop.service +debian/tmp/lib/systemd/system/console-kit-log-system-restart.service +debian/tmp/lib/systemd/system/basic.target.wants/console-kit-log-system-start.service +debian/tmp/lib/systemd/system/halt.target.wants/console-kit-log-system-stop.service +debian/tmp/lib/systemd/system/poweroff.target.wants/console-kit-log-system-stop.service +debian/tmp/lib/systemd/system/reboot.target.wants/console-kit-log-system-restart.service diff --git a/debian/consolekit.logrotate b/debian/consolekit.logrotate new file mode 100644 index 0000000..6e63e41 --- /dev/null +++ b/debian/consolekit.logrotate @@ -0,0 +1,8 @@ +/var/log/ConsoleKit/history { + monthly + rotate 6 + delaycompress + compress + notifempty + missingok +} diff --git a/debian/consolekit.preinst b/debian/consolekit.preinst new file mode 100644 index 0000000..57f334a --- /dev/null +++ b/debian/consolekit.preinst @@ -0,0 +1,68 @@ +#!/bin/sh + +set -e + +# This script can be called in the following ways: +# +# Before the package is installed: +# <new-preinst> install +# +# Before removed package is upgraded: +# <new-preinst> install <old-version> +# +# Before the package is upgraded: +# <new-preinst> upgrade <old-version> +# +# +# If postrm fails during upgrade or fails on failed upgrade: +# <old-preinst> abort-upgrade <new-version> + + +# remove a no-longer used conffile +rm_conffile() +{ + PKGNAME="$1" + CONFFILE="$2" + + if [ -e "$CONFFILE" ]; then + md5sum="`md5sum \"$CONFFILE\" | sed -e \"s/ .*//\"`" + old_md5sum="`dpkg-query -W -f='${Conffiles}' $PKGNAME | sed -n -e \"\\\\' $CONFFILE'{s/ obsolete$//;s/.* //p}\"`" + if [ "$md5sum" != "$old_md5sum" ]; then + echo "Obsolete conffile $CONFFILE has been modified by you." + echo "Saving as $CONFFILE.dpkg-bak ..." + mv -f "$CONFFILE" "$CONFFILE".dpkg-bak + else + echo "Removing obsolete conffile $CONFFILE ..." + rm -f "$CONFFILE" + fi + fi +} + + +case "$1" in + install|upgrade) + # Upgrade from previous versions + if dpkg --compare-versions "$2" lt "0.2.3-3"; then + rm_conffile consolekit /etc/init.d/consolekit + update-rc.d consolekit remove >/dev/null + fi + if dpkg --compare-versions "$2" lt-nl "0.2.10-1"; then + # Ubuntu versions prior to 8.04 LTS introduced this script as + # "90-console-kit", Debian/Ubuntu later settled for + # "90consolekit"; needs to be kept until April 2010 (Ubuntu 10.04 + # LTS release) + rm_conffile consolekit /etc/X11/Xsession.d/90-console-kit + fi + + ;; + + abort-upgrade) + ;; + + *) + echo "$0 called with unknown argument \`$1'" 1>&2 + exit 1 + ;; +esac + +#DEBHELPER# diff --git a/debian/consolekit.prerm b/debian/consolekit.prerm new file mode 100644 index 0000000..22a87b8 --- /dev/null +++ b/debian/consolekit.prerm @@ -0,0 +1,12 @@ +#!/bin/sh + +set -e + +DAEMON=/usr/sbin/console-kit-daemon +PIDFILE=/var/run/console-kit-daemon.pid + +if [ "$1" = remove ]; then + start-stop-daemon --stop --quiet --oknodo --exec $DAEMON --pidfile $PIDFILE +fi + +#DEBHELPER# diff --git a/debian/control b/debian/control new file mode 100644 index 0000000..be4c0b3 --- /dev/null +++ b/debian/control @@ -0,0 +1,72 @@ +Source: consolekit +Section: admin +Priority: optional +Maintainer: Utopia Maintenance Team <pkg-utopia-maintainers@lists.alioth.debian.org> +Uploaders: Michael Biebl <biebl@debian.org> +Build-Depends: debhelper (>= 8), + autotools-dev, + pkg-config, + libdbus-glib-1-dev (>= 0.30), + libglib2.0-dev (>= 2.14.0), + libx11-dev (>= 1.0.0), + libkvm-dev [kfreebsd-any], + xmlto, + libpam0g-dev, + libpolkit-gobject-1-dev (>= 0.92), + zlib1g-dev, + dh-autoreconf +Standards-Version: 3.9.2 +Vcs-Git: git://git.debian.org/git/pkg-utopia/consolekit.git +Vcs-Browser: http://git.debian.org/?p=pkg-utopia/consolekit.git;a=summary +Homepage: http://www.freedesktop.org/wiki/Software/ConsoleKit + +Package: consolekit +Section: admin +Architecture: any +Depends: ${shlibs:Depends}, ${misc:Depends}, dbus (>= 1.1.2) +Recommends: libpam-ck-connector +Breaks: udev (<< 147) +Description: framework for defining and tracking users, sessions and seats + ConsoleKit is a system daemon for tracking what users are logged + into the system and how they interact with the computer (e.g. + which keyboard and mouse they use). + . + It provides asynchronous notification via the system message bus. + . + This package provides the system daemon and tools to interact with it. + +Package: libck-connector0 +Section: libs +Architecture: any +Depends: ${shlibs:Depends}, ${misc:Depends} +Description: ConsoleKit libraries + ConsoleKit is a system daemon for tracking what users are logged + into the system and how they interact with the computer (e.g. + which keyboard and mouse they use). + . + This package provides a convenience library which simplifies the access to + ConsoleKit. + +Package: libck-connector-dev +Section: libdevel +Architecture: any +Depends: libck-connector0 (= ${binary:Version}), ${misc:Depends}, libdbus-1-dev +Description: ConsoleKit development files + ConsoleKit is a system daemon for tracking what users are logged + into the system and how they interact with the computer (e.g. + which keyboard and mouse they use). + . + This package provides the development libraries and headers. + +Package: libpam-ck-connector +Section: admin +Architecture: any +Depends: ${shlibs:Depends}, ${misc:Depends}, libpam-runtime (>= 1.0.1-6) +Description: ConsoleKit PAM module + ConsoleKit is a system daemon for tracking what users are logged + into the system and how they interact with the computer (e.g. + which keyboard and mouse they use). + . + This package provides a PAM module which can be used for console logins. + Graphical login managers should talk to ConsoleKit directly. + diff --git a/debian/copyright b/debian/copyright new file mode 100644 index 0000000..5073614 --- /dev/null +++ b/debian/copyright @@ -0,0 +1,67 @@ +This package was debianized by Michael Biebl <biebl@debian.org> on +Thu, 29 Mar 2007 01:38:27 +0200. + +It was downloaded from http://people.freedesktop.org/~mccann/dist/. + +Upstream Author: + William Jon McCann <mccann@jhu.edu> + +Copyright: + Copyright (C) 2006 William Jon McCann <mccann@jhu.edu> + +License: GPL v2 or later + + This package is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This package 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 General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this package; if not, write to the Free Software + Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + +On Debian systems, the complete text of the GNU General +Public License can be found in `/usr/share/common-licenses/GPL-2'. + +=============================================================================== + +libck-connector/* +pam-ck-connector/* + +Copyright: + Copyright (c) 2007 David Zeuthen <davidz@redhat.com> + Copyright (c) 2007 William Jon McCann <mccann@jhu.edu> + +License: MIT license + + Permission is hereby granted, free of charge, to any person + obtaining a copy of this software and associated documentation + files (the "Software"), to deal in the Software without + restriction, including without limitation the rights to use, + copy, modify, merge, publish, distribute, sublicense, and/or sell + copies of the Software, and to permit persons to whom the + Software is furnished to do so, subject to the following + conditions: + + The above copyright notice and this permission notice shall be + included in all copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES + OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT + HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + OTHER DEALINGS IN THE SOFTWARE. + +=============================================================================== + +The Debian packaging is (C) 2007, Michael Biebl <biebl@debian.org> and +is licensed under the GPL, see above. + diff --git a/debian/gbp.conf b/debian/gbp.conf new file mode 100644 index 0000000..cec628c --- /dev/null +++ b/debian/gbp.conf @@ -0,0 +1,2 @@ +[DEFAULT] +pristine-tar = True diff --git a/debian/libck-connector-dev.install b/debian/libck-connector-dev.install new file mode 100644 index 0000000..f8780f5 --- /dev/null +++ b/debian/libck-connector-dev.install @@ -0,0 +1,5 @@ +debian/tmp/usr/lib/libck-connector.so +debian/tmp/usr/lib/pkgconfig/ +debian/tmp/usr/include/ConsoleKit/ck-connector/ +debian/tmp/usr/share/dbus-1/interfaces/org.freedesktop.ConsoleKit.*.xml +debian/tmp/usr/share/doc/ConsoleKit/spec/ usr/share/doc/libck-connector-dev/ diff --git a/debian/libck-connector0.install b/debian/libck-connector0.install new file mode 100644 index 0000000..1ba911b --- /dev/null +++ b/debian/libck-connector0.install @@ -0,0 +1 @@ +debian/tmp/usr/lib/libck-connector.so.* diff --git a/debian/libck-connector0.symbols b/debian/libck-connector0.symbols new file mode 100644 index 0000000..7401150 --- /dev/null +++ b/debian/libck-connector0.symbols @@ -0,0 +1,9 @@ +libck-connector.so.0 libck-connector0 #MINVER# + ck_connector_close_session@Base 0.2.1 + ck_connector_get_cookie@Base 0.2.1 + ck_connector_new@Base 0.2.1 + ck_connector_open_session@Base 0.2.1 + ck_connector_open_session_for_user@Base 0.2.1 + ck_connector_open_session_with_parameters@Base 0.2.1 + ck_connector_ref@Base 0.2.1 + ck_connector_unref@Base 0.2.1 diff --git a/debian/libpam-ck-connector.install b/debian/libpam-ck-connector.install new file mode 100644 index 0000000..07bff8b --- /dev/null +++ b/debian/libpam-ck-connector.install @@ -0,0 +1,3 @@ +debian/tmp/lib/security/pam_ck_connector.so +debian/tmp/usr/share/man/man8/pam_ck_connector.8 +debian/tmp/usr/share/pam-configs/consolekit diff --git a/debian/libpam-ck-connector.pam-auth-update b/debian/libpam-ck-connector.pam-auth-update new file mode 100644 index 0000000..48aaa51 --- /dev/null +++ b/debian/libpam-ck-connector.pam-auth-update @@ -0,0 +1,7 @@ +Name: ConsoleKit Session Management +Default: yes +Priority: 0 +Session-Interactive-Only: yes +Session-Type: Additional +Session-Final: + optional pam_ck_connector.so nox11 diff --git a/debian/libpam-ck-connector.postinst b/debian/libpam-ck-connector.postinst new file mode 100644 index 0000000..7e37590 --- /dev/null +++ b/debian/libpam-ck-connector.postinst @@ -0,0 +1,7 @@ +#!/bin/sh + +set -e + +pam-auth-update --package + +#DEBHELPER# diff --git a/debian/libpam-ck-connector.prerm b/debian/libpam-ck-connector.prerm new file mode 100644 index 0000000..9d28a3e --- /dev/null +++ b/debian/libpam-ck-connector.prerm @@ -0,0 +1,9 @@ +#!/bin/sh + +set -e + +if [ "$1" = remove ]; then + pam-auth-update --package --remove consolekit +fi + +#DEBHELPER# diff --git a/debian/pam-foreground-compat.ck b/debian/pam-foreground-compat.ck new file mode 100644 index 0000000..ce221c9 --- /dev/null +++ b/debian/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 diff --git a/debian/patches/01-retry-console-open-on-EIO.patch b/debian/patches/01-retry-console-open-on-EIO.patch new file mode 100644 index 0000000..5f81f94 --- /dev/null +++ b/debian/patches/01-retry-console-open-on-EIO.patch @@ -0,0 +1,61 @@ +From 3665e8094e50f1f70b02a34d96c005ce152d62a6 Mon Sep 17 00:00:00 2001 +From: Colin Watson <cjwatson@ubuntu.com> +Date: Sat, 20 Nov 2010 17:57:22 +0100 +Subject: [PATCH] Retry opening console device on EIO + +As reported in https://launchpad.net/bugs/544139, ConsoleKit sometimes fails to +track the active VT. This particular case was tracked down to a race condition +that happens if you try to open /dev/console while the current TTY is currently +being closed. This yields an -EIO error, in which case CK should just try +again. + +For a more detailled summary of the problem from a kernel perspective, please +see https://bugs.launchpad.net/ubuntu/+source/linux/+bug/554172/comments/245 . + +Bug: https://bugs.freedesktop.org/show_bug.cgi?id=31790 +Bug-Ubuntu: https://launchpad.net/bugs/544139 +--- + src/ck-sysdeps-unix.c | 17 +++++++++++++++++ + 1 files changed, 17 insertions(+), 0 deletions(-) + +diff --git a/src/ck-sysdeps-unix.c b/src/ck-sysdeps-unix.c +index e4ab16b..4a1736c 100644 +--- a/src/ck-sysdeps-unix.c ++++ b/src/ck-sysdeps-unix.c +@@ -26,6 +26,7 @@ + #include <unistd.h> + #include <string.h> + #include <errno.h> ++#include <time.h> + #include <sys/types.h> + #include <sys/stat.h> + #include <sys/socket.h> +@@ -150,9 +151,25 @@ open_a_console (char *fnam) + { + int fd; + ++again: + fd = open (fnam, O_RDONLY | O_NOCTTY); + if (fd < 0 && errno == EACCES) + fd = open (fnam, O_WRONLY | O_NOCTTY); ++#ifdef __linux__ ++ if (fd < 0 && errno == EIO) { ++ /* Linux can return EIO if the tty is currently closing, ++ * which can happen if multiple processes are opening and ++ * closing the console in parallel. Unfortunately it can ++ * also return EIO in more serious situations too (see ++ * https://bugs.launchpad.net/bugs/554172), but there isn't ++ * much we can do about that since we really need a console ++ * fd. ++ */ ++ struct timespec ts = { 0, 100000000 }; /* 0.1 seconds */ ++ nanosleep (&ts, NULL); ++ goto again; ++ } ++#endif + + if (fd < 0) + return -1; +-- +1.7.2.3 + diff --git a/debian/patches/03-cleanup_console_tags.patch b/debian/patches/03-cleanup_console_tags.patch new file mode 100644 index 0000000..2ceb955 --- /dev/null +++ b/debian/patches/03-cleanup_console_tags.patch @@ -0,0 +1,68 @@ +Cleanup console tag files on application startup and shutdown. + +Index: consolekit/src/main.c +=================================================================== +--- consolekit.orig/src/main.c 2010-11-17 07:02:23.030817878 +0100 ++++ consolekit/src/main.c 2010-11-17 07:03:17.434814872 +0100 +@@ -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/debian/patches/82-hurd_support.patch b/debian/patches/82-hurd_support.patch new file mode 100644 index 0000000..b86720c --- /dev/null +++ b/debian/patches/82-hurd_support.patch @@ -0,0 +1,509 @@ +Description: Add support for GNU/Hurd + currently consolekit fails to build on GNU/Hurd mainly because there's no + sysdeps backend for the GNU OS implemented. Also there is an unconditional + PATH_MAX usage. + The attached patch proposes a sysdeps-gnu backend, which implements the process + management using Hurd's libps, the *ttyent API for the part of the console + implementation and the rest using similar (valid) approaches of other backends. + Also, it fixes the PATH_MAX usage in pam-ck-connector/pam-ck-connector.c by + using a variable-length malloc'ed buffer. +Author: Pino Toscano <pino@kde.org> +Bug-Debian: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=552393 +Bug: https://bugs.freedesktop.org/show_bug.cgi?id=24738 +Last-Update: 2010-09-20 + +Index: consolekit/configure.ac +=================================================================== +--- consolekit.orig/configure.ac 2010-09-20 03:07:20.969097019 +0200 ++++ consolekit/configure.ac 2010-09-20 03:07:22.189095438 +0200 +@@ -190,6 +190,9 @@ + *-*-solaris*) + CK_BACKEND="solaris" + ;; ++ *-*-gnu*) ++ CK_BACKEND="gnu" ++ ;; + *) + AC_MSG_ERROR([No sysdeps back-end implemented for host $host]) + ;; +@@ -200,6 +203,7 @@ + AM_CONDITIONAL(CK_COMPILE_LINUX, test x$CK_BACKEND = xlinux, [Compiling for Linux]) + AM_CONDITIONAL(CK_COMPILE_FREEBSD, test x$CK_BACKEND = xfreebsd, [Compiling for FreeBSD]) + AM_CONDITIONAL(CK_COMPILE_SOLARIS, test x$CK_BACKEND = xsolaris, [Compiling for Solaris]) ++AM_CONDITIONAL(CK_COMPILE_GNU, test x$CK_BACKEND = xgnu, [Compiling for GNU]) + AC_SUBST(CK_BACKEND) + + dnl --------------------------------------------------------------------------- +Index: consolekit/src/Makefile.am +=================================================================== +--- consolekit.orig/src/Makefile.am 2010-09-20 03:07:09.397095424 +0200 ++++ consolekit/src/Makefile.am 2010-09-20 03:07:22.189095438 +0200 +@@ -57,11 +57,18 @@ + $(NULL) + libck_la_LIBADD = $(KVM_LIBS) + endif ++if CK_COMPILE_GNU ++libck_la_SOURCES += \ ++ ck-sysdeps-gnu.c \ ++ $(NULL) ++libck_la_LIBADD = -lps ++endif + + EXTRA_libck_la_SOURCES = \ + ck-sysdeps-linux.c \ + ck-sysdeps-solaris.c \ + ck-sysdeps-freebsd.c \ ++ ck-sysdeps-gnu.c \ + $(NULL) + + sbin_PROGRAMS = \ +Index: consolekit/src/ck-sysdeps-gnu.c +=================================================================== +--- /dev/null 1970-01-01 00:00:00.000000000 +0000 ++++ consolekit/src/ck-sysdeps-gnu.c 2010-09-20 03:07:22.189095438 +0200 +@@ -0,0 +1,402 @@ ++/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*- ++ * ++ * Copyright (C) 2009 Pino Toscano <pino@kde.org> ++ * ++ * This program is free software; you can redistribute it and/or modify ++ * it under the terms of the GNU General Public License as published by ++ * the Free Software Foundation; either version 2 of the License, or ++ * (at your option) any later version. ++ * ++ * This program 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 General Public License for more details. ++ * ++ * You should have received a copy of the GNU General Public License ++ * along with this program; if not, write to the Free Software ++ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. ++ * ++ */ ++ ++#include "config.h" ++ ++#include <stdlib.h> ++#include <stdio.h> ++#include <unistd.h> ++#include <string.h> ++#include <errno.h> ++ ++#include <hurd.h> ++#include <dirent.h> ++#include <ps.h> ++#include <ttyent.h> ++ ++#ifdef HAVE_PATHS_H ++#include <paths.h> ++#endif /* HAVE_PATHS_H */ ++ ++#include "ck-sysdeps.h" ++ ++struct _CkProcessStat ++{ ++ struct proc_stat *ps; /* the statistics of a process */ ++}; ++ ++static struct ps_context *pc = NULL; ++ ++static gboolean ++get_proc_stat_from_pid (pid_t pid, ++ ps_flags_t flags, ++ struct proc_stat **res_ps) ++{ ++ error_t err; ++ struct proc_stat *ps; ++ ++ g_assert (pid >= 0); ++ g_assert (res_ps != NULL); ++ ++ if (pc == NULL) { ++ err = ps_context_create (getproc (), &pc); ++ if (err) { ++ return FALSE; ++ } ++ } ++ ++ err = _proc_stat_create (pid, pc, &ps); ++ if (err) { ++ return FALSE; ++ } ++ ++ err = proc_stat_set_flags (ps, PSTAT_PID | flags); ++ if (err) { ++ return FALSE; ++ } ++ ++ *res_ps = ps; ++ return TRUE; ++} ++ ++ ++pid_t ++ck_process_stat_get_ppid (CkProcessStat *stat) ++{ ++ g_return_val_if_fail (stat != NULL, -1); ++ ++ return proc_stat_pid (stat->ps); ++} ++ ++char * ++ck_process_stat_get_cmd (CkProcessStat *stat) ++{ ++ g_return_val_if_fail (stat != NULL, NULL); ++ ++ return g_strdup (proc_stat_args (stat->ps)); ++} ++ ++char * ++ck_process_stat_get_tty (CkProcessStat *stat) ++{ ++ struct ps_tty *tty; ++ ++ g_return_val_if_fail (stat != NULL, NULL); ++ ++ tty = proc_stat_tty (stat->ps); ++ ++ return tty ? g_strdup (ps_tty_name (tty)) : NULL; ++} ++ ++gboolean ++ck_process_stat_new_for_unix_pid (pid_t pid, ++ CkProcessStat **stat, ++ GError **error) ++{ ++ gboolean res; ++ struct proc_stat *ps; ++ CkProcessStat *proc; ++ ++ g_return_val_if_fail (pid > 1, FALSE); ++ ++ if (stat == NULL) { ++ return FALSE; ++ } ++ ++ *stat = NULL; ++ ++ res = get_proc_stat_from_pid (pid, PSTAT_ARGS | PSTAT_TTY, &ps); ++ if (!res) { ++ return FALSE; ++ } ++ ++ proc = g_new0 (CkProcessStat, 1); ++ proc->ps = ps; ++ *stat = proc; ++ ++ return TRUE; ++} ++ ++void ++ck_process_stat_free (CkProcessStat *stat) ++{ ++ _proc_stat_free (stat->ps); ++ ++ g_free (stat); ++} ++ ++GHashTable * ++ck_unix_pid_get_env_hash (pid_t pid) ++{ ++ struct proc_stat *ps; ++ char *env_p; ++ size_t env_index; ++ size_t env_l; ++ gboolean res; ++ GHashTable *hash; ++ ++ g_return_val_if_fail (pid > 1, NULL); ++ ++ res = get_proc_stat_from_pid (pid, PSTAT_ENV, &ps); ++ if (!res) { ++ return NULL; ++ } ++ ++ hash = g_hash_table_new_full (g_str_hash, ++ g_str_equal, ++ g_free, ++ g_free); ++ ++ env_index = 0; ++ env_l = 0; ++ env_p = proc_stat_env (ps); ++ while (env_index < proc_stat_env_len (ps)) { ++ env_l = strlen (env_p); ++ env_index += env_l + 1; ++ if (env_l) { ++ char **vals; ++ vals = g_strsplit (env_p, "=", 2); ++ if (vals != NULL) { ++ g_hash_table_insert (hash, ++ g_strdup (vals[0]), ++ g_strdup (vals[1])); ++ g_strfreev (vals); ++ } ++ } ++ env_p = env_p + env_l + 1; ++ } ++ ++ _proc_stat_free (ps); ++ ++ return hash; ++} ++ ++char * ++ck_unix_pid_get_env (pid_t pid, ++ const char *var) ++{ ++ struct proc_stat *ps; ++ char *env_p; ++ size_t env_index; ++ size_t env_l; ++ char *prefix; ++ int prefix_len; ++ char *val; ++ gboolean res; ++ ++ g_return_val_if_fail (pid > 1, NULL); ++ ++ val = NULL; ++ ++ res = get_proc_stat_from_pid (pid, PSTAT_ENV, &ps); ++ if (!res) { ++ return NULL; ++ } ++ ++ prefix = g_strdup_printf ("%s=", var); ++ prefix_len = strlen (prefix); ++ ++ env_index = 0; ++ env_l = 0; ++ env_p = proc_stat_env (ps); ++ while (env_index < proc_stat_env_len (ps)) { ++ env_l = strlen (env_p); ++ env_index += env_l + 1; ++ if (env_l && g_str_has_prefix (env_p, prefix)) { ++ val = g_strdup (env_p + prefix_len); ++ break; ++ } ++ env_p = env_p + env_l + 1; ++ } ++ ++ g_free (prefix); ++ ++ _proc_stat_free (ps); ++ ++ return val; ++} ++ ++uid_t ++ck_unix_pid_get_uid (pid_t pid) ++{ ++ struct proc_stat *ps; ++ gboolean res; ++ uid_t uid; ++ ++ g_return_val_if_fail (pid > 1, 0); ++ ++ res = get_proc_stat_from_pid (pid, PSTAT_OWNER_UID, &ps); ++ if (!res) { ++ return 0; ++ } ++ ++ uid = proc_stat_owner_uid (ps); ++ ++ _proc_stat_free (ps); ++ ++ return uid; ++} ++ ++pid_t ++ck_unix_pid_get_ppid (pid_t pid) ++{ ++ struct proc_stat *ps; ++ gboolean res; ++ pid_t ppid; ++ ++ g_return_val_if_fail (pid > 1, 0); ++ ++ res = get_proc_stat_from_pid (pid, PSTAT_PROC_INFO, &ps); ++ if (!res) { ++ return 0; ++ } ++ ++ ppid = proc_stat_proc_info (ps)->ppid; ++ ++ _proc_stat_free (ps); ++ ++ return ppid; ++} ++ ++gboolean ++ck_unix_pid_get_login_session_id (pid_t pid, ++ char **idp) ++{ ++ g_return_val_if_fail (pid > 1, FALSE); ++ ++ return FALSE; ++} ++ ++gboolean ++ck_get_max_num_consoles (guint *num) ++{ ++ int max_consoles; ++ int res; ++ gboolean ret; ++ struct ttyent *t; ++ ++ ret = FALSE; ++ max_consoles = 0; ++ ++ res = setttyent (); ++ if (res == 0) { ++ goto done; ++ } ++ ++ while ((t = getttyent ()) != NULL) { ++ if (t->ty_status & TTY_ON && strncmp (t->ty_name, "tty", 3) == 0) ++ max_consoles++; ++ } ++ ++ /* Increment one more so that all consoles are properly counted ++ * this is arguable a bug in vt_add_watches(). ++ */ ++ max_consoles++; ++ ++ ret = TRUE; ++ ++ endttyent (); ++ ++done: ++ if (num != NULL) { ++ *num = max_consoles; ++ } ++ ++ return ret; ++} ++ ++gboolean ++ck_supports_activatable_consoles (void) ++{ ++ return TRUE; ++} ++ ++char * ++ck_get_console_device_for_num (guint num) ++{ ++ char *device; ++ ++ device = g_strdup_printf (_PATH_TTY "%u", num); ++ ++ return device; ++} ++ ++gboolean ++ck_get_console_num_from_device (const char *device, ++ guint *num) ++{ ++ guint n; ++ gboolean ret; ++ ++ n = 0; ++ ret = FALSE; ++ ++ if (device == NULL) { ++ return FALSE; ++ } ++ ++ if (sscanf (device, _PATH_TTY "%u", &n) == 1) { ++ ret = TRUE; ++ } ++ ++ if (num != NULL) { ++ *num = n; ++ } ++ ++ return ret; ++} ++ ++gboolean ++ck_get_active_console_num (int console_fd, ++ guint *num) ++{ ++ gboolean ret; ++ int res; ++ long cur_active; ++ char buf[30]; ++ guint active; ++ ++ g_assert (console_fd != -1); ++ ++ active = 0; ++ ret = FALSE; ++ ++ res = readlink ("/dev/cons/vcs", buf, sizeof (buf)); ++ if (res > 0) { ++ /* the resolved path is like "/dev/vcs/$number", so skip ++ the non-number part at the start */ ++ const char *p = buf; ++ while ((*p) && ((*p < '0') || (*p > '9'))) { ++ ++p; ++ } ++ if (*p) { ++ cur_active = strtol (p, NULL, 10); ++ g_debug ("Current VT: tty%ld", cur_active); ++ active = cur_active; ++ ret = TRUE; ++ } ++ } ++ ++ if (num != NULL) { ++ *num = active; ++ } ++ ++ return ret; ++} +Index: consolekit/pam-ck-connector/pam-ck-connector.c +=================================================================== +--- consolekit.orig/pam-ck-connector/pam-ck-connector.c 2010-09-20 17:15:53.000000000 +0200 ++++ consolekit/pam-ck-connector/pam-ck-connector.c 2010-09-20 17:33:54.000000000 +0200 +@@ -244,12 +244,12 @@ + const char *s; + uid_t uid; + char buf[256]; +- char ttybuf[PATH_MAX]; ++ char *ttybuf; + DBusError error; + dbus_bool_t is_local; + + ret = PAM_IGNORE; +- ++ ttybuf = NULL; + is_local = TRUE; + + _parse_pam_args (pamh, flags, argc, argv); +@@ -295,7 +295,13 @@ + x11_display = display_device; + display_device = ""; + } else if (strncmp (_PATH_DEV, display_device, 5) != 0) { +- snprintf (ttybuf, sizeof (ttybuf), _PATH_DEV "%s", display_device); ++ int len = strlen (_PATH_DEV) + strlen (display_device) + 1; ++ ttybuf = malloc (len); ++ if (ttybuf == NULL) { ++ ck_pam_syslog (pamh, LOG_ERR, "oom allocating ttybuf"); ++ goto out; ++ } ++ snprintf (ttybuf, len, _PATH_DEV "%s", display_device); + display_device = ttybuf; + } + +@@ -411,6 +417,8 @@ + ret = PAM_SUCCESS; + + out: ++ free (ttybuf); ++ + return ret; + } + diff --git a/debian/patches/series b/debian/patches/series new file mode 100644 index 0000000..ce23ce9 --- /dev/null +++ b/debian/patches/series @@ -0,0 +1,4 @@ +# Debian patches for consolekit +01-retry-console-open-on-EIO.patch +03-cleanup_console_tags.patch +82-hurd_support.patch diff --git a/debian/rules b/debian/rules new file mode 100755 index 0000000..3a4c677 --- /dev/null +++ b/debian/rules @@ -0,0 +1,17 @@ +#!/usr/bin/make -f + +%: + dh $@ --with autoreconf + +override_dh_auto_configure: + dh_auto_configure -- \ + --libexecdir="\$$(prefix)/lib/ConsoleKit" \ + --enable-pam-module \ + --enable-docbook-docs \ + --with-pid-file=/var/run/console-kit-daemon.pid \ + --with-systemdsystemunitdir=/lib/systemd/system + +override_dh_auto_install: + dh_auto_install + install -m 755 debian/pam-foreground-compat.ck debian/tmp/usr/lib/ConsoleKit/run-session.d/ + install -D -m 644 debian/libpam-ck-connector.pam-auth-update debian/tmp/usr/share/pam-configs/consolekit diff --git a/debian/source/format b/debian/source/format new file mode 100644 index 0000000..163aaf8 --- /dev/null +++ b/debian/source/format @@ -0,0 +1 @@ +3.0 (quilt) diff --git a/debian/watch b/debian/watch new file mode 100644 index 0000000..c52efc8 --- /dev/null +++ b/debian/watch @@ -0,0 +1,2 @@ +version=3 +http://www.freedesktop.org/software/ConsoleKit/dist/ConsoleKit-(.*)\.tar\.(?:gz|bz2) |