--- consolekit-0.2.10.orig/debian/consolekit.preinst +++ consolekit-0.2.10/debian/consolekit.preinst @@ -0,0 +1,62 @@ +#!/bin/sh -e +# This script can be called in the following ways: +# +# Before the package is installed: +# install +# +# Before removed package is upgraded: +# install +# +# Before the package is upgraded: +# upgrade +# +# +# If postrm fails during upgrade or fails on failed upgrade: +# abort-upgrade + + +# 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 + # renamed to 90consolekit + 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# +exit 0 --- consolekit-0.2.10.orig/debian/changelog +++ consolekit-0.2.10/debian/changelog @@ -0,0 +1,245 @@ +consolekit (0.2.10-1ubuntu7) intrepid; urgency=low + + * debian/patches/09-directory-handle-leak.patch: close the directory + handle when we're done with it, so that we aren't leaking file + descriptors. Thanks to Chris Jones for noticing this! LP: #276918. + + -- Steve Langasek Fri, 03 Oct 2008 19:06:41 +0000 + +consolekit (0.2.10-1ubuntu6) intrepid; urgency=low + + * Add 08-fix-double-close.patch: Fix double close()ing of the log file which + sometimes causes not only close() to fail, but to segfault. (LP: #263245) + + -- Martin Pitt Thu, 02 Oct 2008 13:01:48 +0200 + +consolekit (0.2.10-1ubuntu5) intrepid; urgency=low + + * Patches pulled from Fedora that will are in 0.3: + - Correctly shutdown event logger threads (LP: #196724) + - Return PolicyKit results when the action is denied (LP: #268944) + + -- James Westby Thu, 11 Sep 2008 12:09:17 +0100 + +consolekit (0.2.10-1ubuntu4) intrepid; urgency=low + + * Enable PolicyKit controlled shutdown/reboot functionality (LP: #250506): + - Disable 01-dbus_policy.patch. + - Add libpolkit-dev build dependency. + - debian/consolekit.install: Install .policy file. + + -- Martin Pitt Wed, 03 Sep 2008 15:44:43 +0200 + +consolekit (0.2.10-1ubuntu3) intrepid; urgency=low + + * 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-2ubuntu1) for the + above. + + -- Steve Langasek Wed, 27 Aug 2008 19:22:52 +0000 + +consolekit (0.2.10-1ubuntu2) intrepid; urgency=low + + * Add 05-pam-add-nox11.patch: Add "nox11" option to the PAM module, which + ignores PAM sessions where PAM_TTY is an X11 display. This allows adding + pam_ck_connector to PAM's "common-session" without interfering + with the already existing ConsoleKit operations in gdm, the + Xsession script, etc. (FD #16746) + + -- Martin Pitt Mon, 04 Aug 2008 18:26:37 +0200 + +consolekit (0.2.10-1ubuntu1) intrepid; urgency=low + + * Merge with Debian unstable. Remaining Ubuntu changes: + - 04-consolekit_park.patch: Allow {g,k}dm to allocate a VT (they do not + run a proper session). + * debian/consolekit.preinst: Remove obsolete configuration file + /etc/X11/Xsession.d/90-console-kit on upgrade(Debian named it 90consolekit + for consistency with other Xsession.d/ scripts). + * 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. + + -- Martin Pitt Mon, 28 Jul 2008 09:16:16 +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 Sat, 26 Jul 2008 00:29:46 +0200 + +consolekit (0.2.10-0ubuntu4) intrepid; urgency=low + + * debian/rules: Fix path of run-session.d directory to actually chmod the + .ck script correctly. + + -- Martin Pitt Thu, 17 Jul 2008 17:44:42 +0100 + +consolekit (0.2.10-0ubuntu3) intrepid; urgency=low + + * debian/consolekit.dirs: Add /usr/lib/ConsoleKit/run-session.d/ to quiesce + the frequent warnings about it. + * Drop pam_console-compat.patch. Add debian/pam-foreground-compat.ck + which is installed as a run-session.d script instead. This is less + intrusive and the proper place for things like this. Upstream rejected the + former patch, too. + + -- Martin Pitt Wed, 16 Jul 2008 23:08:09 +0100 + +consolekit (0.2.10-0ubuntu2) intrepid; urgency=low + + * Add missing zlib1g-dev build dependency. + + -- Martin Pitt Tue, 15 Jul 2008 17:16:32 +0100 + +consolekit (0.2.10-0ubuntu1) intrepid; urgency=low + + * New upstream release. Update patches for this. + * Drop ck-launch-session.patch and zzz_automake.patch, those were backports + from this upstream version. + * For the record, remaining Ubuntu changes: + - XSession ConsoleKit integration: Add debian/90-console-kit, an Xsession + startup script, to prepend ck-launch-session to $STARTUP. Install it in + debian/consolekit.install. (LP #199486) + - pam_console-compat.patch: Create pam_console compatible tag files + (/var/run/console/). Necessary until all dbus policy files + stop using "at_console". + - consolekit-park.patch: Allow {g,k}dm to allocate a VT (they do not run a + proper session). + - debian/consolekit.install: Install ck-history. + + -- Martin Pitt Tue, 15 Jul 2008 16:24:40 +0100 + +consolekit (0.2.3-3ubuntu5) hardy; urgency=low + + * Fix typo in bug id in 0.2.3-3ubuntu4. + + -- Loic Minier Fri, 21 Mar 2008 10:22:39 +0100 + +consolekit (0.2.3-3ubuntu4) hardy; urgency=low + + * Add XSession ConsoleKit integration; LP: #199486. + - New patch, debian/patches/ck-launch-session.patch, backport + of the ck-launch-session binary from consolekit-0.2.10. + - New patch, debian/patches/zzz_automake.patch, update autotools generated + files patches by the previous patch. + - Added debian/90-console-kit, an Xsession startup script, to prepend + ck-launch-session to $STARTUP. + + -- Michael Frey Fri, 14 Mar 2008 11:04:49 -0400 + +consolekit (0.2.3-3ubuntu3) hardy; urgency=low + + * debian/patches/pam_console-compat.patch: Only create PAM console tags for + local CK sessions. + + -- Martin Pitt Wed, 30 Jan 2008 15:41:45 +0100 + +consolekit (0.2.3-3ubuntu2) hardy; urgency=low + + * Add debian/patches/pam_console-compat.patch: + - Create pam_console like tag files in /var/run/console. dbus can use them + instead of the ones created by libpam-foreground, so that we can get rid + of the latter. (See policykit-integration spec) + - Forwarded to upstream: FD #14053 + * debian/rules: Include simple-patchsys.mk, so that this and + consolekit-park.patch actually get applied. + + -- Martin Pitt Sun, 13 Jan 2008 13:56:16 +0100 + +consolekit (0.2.3-3ubuntu1) hardy; urgency=low + + * Sync with Debian + * debian/control: + - updated maintainer information + * debian/patches/consolekit-park.patch: + - use the initial gdm server, updated patch using the gutsy version + (LP: #131751) + + -- Sebastien Bacher Wed, 12 Dec 2007 17:37:23 +0100 + +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 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 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 Wed, 19 Sep 2007 21:34:38 +0200 + +consolekit (0.2.1-2) unstable; urgency=low + + * Upload to unstable. + + -- Michael Biebl Fri, 10 Aug 2007 00:22:56 +0200 + +consolekit (0.2.1-1) experimental; urgency=low + + * Initial release. (Closes: #416568) + + -- Michael Biebl Thu, 29 Mar 2007 01:38:27 +0200 + --- consolekit-0.2.10.orig/debian/libpam-ck-connector.install +++ consolekit-0.2.10/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 --- consolekit-0.2.10.orig/debian/consolekit.install +++ consolekit-0.2.10/debian/consolekit.install @@ -0,0 +1,9 @@ +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/PolicyKit/policy/ +debian/tmp/usr/lib/ConsoleKit/ +debian/tmp/var/log/ConsoleKit/ +debian/tmp/usr/sbin/ +debian/tmp/usr/bin/ +debian/90consolekit etc/X11/Xsession.d/ --- consolekit-0.2.10.orig/debian/libck-connector-dev.install +++ consolekit-0.2.10/debian/libck-connector-dev.install @@ -0,0 +1,4 @@ +debian/tmp/usr/lib/libck-connector.so +debian/tmp/usr/lib/pkgconfig/ +debian/tmp/usr/include/ConsoleKit/ck-connector/ +debian/tmp/usr/share/doc/ConsoleKit/spec/ usr/share/doc/libck-connector-dev/ --- consolekit-0.2.10.orig/debian/90consolekit +++ consolekit-0.2.10/debian/90consolekit @@ -0,0 +1,11 @@ +# -*- 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 + +if [ -z "$XDG_SESSION_COOKIE" ] && [ -x "$CK_LAUNCH_SESSION" ]; then + STARTUP="$CK_LAUNCH_SESSION $STARTUP" +fi --- consolekit-0.2.10.orig/debian/compat +++ consolekit-0.2.10/debian/compat @@ -0,0 +1 @@ +5 --- consolekit-0.2.10.orig/debian/watch +++ consolekit-0.2.10/debian/watch @@ -0,0 +1,2 @@ +version=3 +http://people.freedesktop.org/~mccann/dist/ConsoleKit-(.*)\.tar\.gz --- consolekit-0.2.10.orig/debian/libpam-ck-connector.postinst +++ consolekit-0.2.10/debian/libpam-ck-connector.postinst @@ -0,0 +1,6 @@ +#!/bin/sh +set -e + +pam-auth-update --package + +#DEBHELPER# --- consolekit-0.2.10.orig/debian/rules +++ consolekit-0.2.10/debian/rules @@ -0,0 +1,16 @@ +#!/usr/bin/make -f + +include /usr/share/cdbs/1/rules/debhelper.mk +include /usr/share/cdbs/1/class/autotools.mk +include /usr/share/cdbs/1/rules/utils.mk +include /usr/share/cdbs/1/rules/patchsys-quilt.mk + +DEB_CONFIGURE_LIBEXECDIR := "\$$(prefix)/lib/ConsoleKit" + +DEB_CONFIGURE_EXTRA_FLAGS := --enable-pam-module \ + --enable-docbook-docs \ + --with-pid-file=/var/run/console-kit-daemon.pid + +install/consolekit:: + 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 --- consolekit-0.2.10.orig/debian/pam-foreground-compat.ck +++ consolekit-0.2.10/debian/pam-foreground-compat.ck @@ -0,0 +1,16 @@ +#!/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 --- consolekit-0.2.10.orig/debian/libck-connector0.install +++ consolekit-0.2.10/debian/libck-connector0.install @@ -0,0 +1 @@ +debian/tmp/usr/lib/libck-connector.so.* --- consolekit-0.2.10.orig/debian/libpam-ck-connector.pam-auth-update +++ consolekit-0.2.10/debian/libpam-ck-connector.pam-auth-update @@ -0,0 +1,6 @@ +Name: ConsoleKit Session Management +Default: yes +Priority: 0 +Session-Type: Additional +Session-Final: + optional pam_ck_connector.so nox11 --- consolekit-0.2.10.orig/debian/libpam-ck-connector.prerm +++ consolekit-0.2.10/debian/libpam-ck-connector.prerm @@ -0,0 +1,11 @@ +#!/bin/sh + +set -e + +if [ "$1" = remove ]; then + pam-auth-update --package --remove consolekit +fi + +#DEBHELPER# + +exit 0 --- consolekit-0.2.10.orig/debian/libck-connector0.symbols +++ consolekit-0.2.10/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 --- consolekit-0.2.10.orig/debian/README.Debian +++ consolekit-0.2.10/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 Thu, 29 Mar 2007 01:38:27 +0200 --- consolekit-0.2.10.orig/debian/consolekit.docs +++ consolekit-0.2.10/debian/consolekit.docs @@ -0,0 +1 @@ +doc/ConsoleKit.html --- consolekit-0.2.10.orig/debian/control +++ consolekit-0.2.10/debian/control @@ -0,0 +1,61 @@ +Source: consolekit +Section: admin +Priority: optional +Maintainer: Ubuntu Core Developers +XSBC-Original-Maintainer: Utopia Maintenance Team +Uploaders: Michael Biebl +Build-Depends: cdbs, debhelper (>= 5), autotools-dev, pkg-config, ,quilt, libdbus-glib-1-dev (>= 0.30), libglib2.0-dev (>= 2.7.0), libx11-dev (>= 1.0.0), xmlto, libpam0g-dev, zlib1g-dev, libpolkit-dev (>= 0.8) +Standards-Version: 3.8.0 +Vcs-Svn: svn://svn.debian.org/svn/pkg-utopia/packages/unstable/consolekit +Vcs-Browser: http://svn.debian.org/wsvn/pkg-utopia/packages/unstable/consolekit +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 +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}), 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-2ubuntu1) +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. + --- consolekit-0.2.10.orig/debian/copyright +++ consolekit-0.2.10/debian/copyright @@ -0,0 +1,67 @@ +This package was debianized by Michael Biebl on +Thu, 29 Mar 2007 01:38:27 +0200. + +It was downloaded from http://people.freedesktop.org/~mccann/dist/. + +Upstream Author: + William Jon McCann + +Copyright: + Copyright (C) 2006 William Jon McCann + +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'. + +=============================================================================== + +libck-connector/* +pam-ck-connector/* + +Copyright: + Copyright (c) 2007 David Zeuthen + Copyright (c) 2007 William Jon McCann + +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 and +is licensed under the GPL, see above. + --- consolekit-0.2.10.orig/debian/patches/08-fix-double-close.patch +++ consolekit-0.2.10/debian/patches/08-fix-double-close.patch @@ -0,0 +1,15 @@ +# Description: Fix double close of the log file (->file is an fdopen(->priv), which occasionally causes segfaults. +# Ubuntu: https://bugs.launchpad.net/bugs/263245 +# Upstream: https://bugs.freedesktop.org/show_bug.cgi?id=17866 +Index: consolekit-0.2.10/src/ck-event-logger.c +=================================================================== +--- consolekit-0.2.10.orig/src/ck-event-logger.c 2008-10-02 12:59:41.000000000 +0200 ++++ consolekit-0.2.10/src/ck-event-logger.c 2008-10-02 12:59:50.000000000 +0200 +@@ -180,7 +180,6 @@ + static void + reopen_file_stream (CkEventLogger *event_logger) + { +- close (event_logger->priv->fd); + fclose (event_logger->priv->file); + + /* FIXME: retries */ --- consolekit-0.2.10.orig/debian/patches/series +++ consolekit-0.2.10/debian/patches/series @@ -0,0 +1,9 @@ +#01-dbus_policy.patch +02-exit_with_dbus.patch +03-cleanup_console_tags.patch +04-consolekit_park.patch +05-pam-add-nox11.patch +06-polkit-result.patch +07-fix-thread-shutdown.patch +08-fix-double-close.patch +09-directory-handle-leak.patch --- consolekit-0.2.10.orig/debian/patches/05-pam-add-nox11.patch +++ consolekit-0.2.10/debian/patches/05-pam-add-nox11.patch @@ -0,0 +1,54 @@ +# Description: Add "nox11" option to the PAM module, which ignores PAM +# sessions where PAM_TTY is an X11 display. This allows adding +# pam_ck_connector to PAM's "common-session" without interfering +# with the already existing ConsoleKit operations in gdm, the +# Xsession script, etc. +# Upstream: https://bugs.freedesktop.org/show_bug.cgi?id=16746 + +Index: consolekit-0.2.10/pam-ck-connector/pam-ck-connector.c +=================================================================== +--- consolekit-0.2.10.orig/pam-ck-connector/pam-ck-connector.c 2008-08-04 18:23:37.000000000 +0200 ++++ consolekit-0.2.10/pam-ck-connector/pam-ck-connector.c 2008-08-04 18:23:49.000000000 +0200 +@@ -63,6 +63,7 @@ + #include "ck-connector.h" + + static int opt_debug = FALSE; ++static int opt_nox11 = FALSE; + + #ifndef HAVE_PAM_SYSLOG + +@@ -145,6 +146,8 @@ + for (i = 0; i < argc && argv[i] != NULL; i++) { + if (strcmp (argv[i] , "debug") == 0) { + opt_debug = TRUE; ++ } else if (strcmp (argv[i] , "nox11") == 0) { ++ opt_nox11 = TRUE; + } else { + ck_pam_syslog (pamh, LOG_ERR, "unknown option: %s", argv[i]); + } +@@ -276,6 +279,10 @@ + x11_display = NULL; + /* interpret any tty with a colon as a DISPLAY */ + if (strchr (display_device, ':') != NULL) { ++ if (opt_nox11) { ++ ck_pam_syslog (pamh, LOG_WARNING, "nox11 mode, ignoring PAM_TTY %s", display_device); ++ goto out; ++ } + x11_display = display_device; + display_device = ""; + } else if (strncmp (_PATH_DEV, display_device, 5) != 0) { +Index: consolekit-0.2.10/pam-ck-connector/pam_ck_connector.8 +=================================================================== +--- consolekit-0.2.10.orig/pam-ck-connector/pam_ck_connector.8 2008-08-04 18:23:44.000000000 +0200 ++++ consolekit-0.2.10/pam-ck-connector/pam_ck_connector.8 2008-08-04 18:23:49.000000000 +0200 +@@ -66,6 +66,10 @@ + .TP 3n + \fBdebug\fR + Print debug information. ++.TP 3n ++\fBnox11\fR ++Do not create a session if PAM specifies an X11 display instead of a ++/dev/tty terminal. + .fi + .RE + .sp --- consolekit-0.2.10.orig/debian/patches/07-fix-thread-shutdown.patch +++ consolekit-0.2.10/debian/patches/07-fix-thread-shutdown.patch @@ -0,0 +1,97 @@ +diff --git a/src/ck-event-logger.c b/src/ck-event-logger.c +index 2fded87..92bf987 100644 +--- a/src/ck-event-logger.c ++++ b/src/ck-event-logger.c +@@ -254,12 +254,16 @@ writer_thread_start (CkEventLogger *event_logger) + { + CkLogEvent *event; + +- while ((event = g_async_queue_pop (event_logger->priv->event_queue)) != NULL) { ++ while (1) { ++ event = g_async_queue_pop (event_logger->priv->event_queue); ++ if (event == NULL || event->type == CK_LOG_EVENT_NONE) { ++ break; ++ } + write_log_for_event (event_logger, event); + ck_log_event_free (event); + } + +- g_thread_exit (NULL); ++ g_debug ("Writer thread received None event - exiting"); + return NULL; + } + +@@ -274,7 +278,7 @@ create_writer_thread (CkEventLogger *event_logger) + event_logger->priv->writer_thread = g_thread_create_full ((GThreadFunc)writer_thread_start, + event_logger, + 65536, +- FALSE, ++ TRUE, + TRUE, + G_THREAD_PRIORITY_NORMAL, + &error); +@@ -284,6 +288,22 @@ create_writer_thread (CkEventLogger *event_logger) + } + } + ++static void ++destroy_writer_thread (CkEventLogger *event_logger) ++{ ++ CkLogEvent event; ++ ++ event.type = CK_LOG_EVENT_NONE; ++ ++ g_debug ("Destroying writer thread"); ++ g_async_queue_push (event_logger->priv->event_queue, ++ &event); ++#if 1 ++ g_debug ("Joining writer thread"); ++ g_thread_join (event_logger->priv->writer_thread); ++#endif ++} ++ + static GObject * + ck_event_logger_constructor (GType type, + guint n_construct_properties, +@@ -394,6 +414,8 @@ ck_event_logger_finalize (GObject *object) + + g_return_if_fail (event_logger->priv != NULL); + ++ destroy_writer_thread (event_logger); ++ + if (event_logger->priv->event_queue != NULL) { + g_async_queue_unref (event_logger->priv->event_queue); + } +diff --git a/src/ck-log-event.h b/src/ck-log-event.h +index 149f49b..64dec58 100644 +--- a/src/ck-log-event.h ++++ b/src/ck-log-event.h +@@ -27,7 +27,8 @@ G_BEGIN_DECLS + + typedef enum + { +- CK_LOG_EVENT_START = 0, ++ CK_LOG_EVENT_NONE = 0, ++ CK_LOG_EVENT_START, + CK_LOG_EVENT_STOP, + CK_LOG_EVENT_SYSTEM_START, + CK_LOG_EVENT_SYSTEM_STOP, +@@ -44,6 +45,10 @@ typedef enum + + typedef struct + { ++} CkLogNoneEvent; ++ ++typedef struct ++{ + } CkLogSystemStopEvent; + + typedef struct +@@ -117,6 +122,7 @@ typedef struct + typedef struct + { + union { ++ CkLogNoneEvent none; + CkLogSystemRestartEvent system_start; + CkLogSystemStopEvent system_stop; + CkLogSystemRestartEvent system_restart; --- consolekit-0.2.10.orig/debian/patches/09-directory-handle-leak.patch +++ consolekit-0.2.10/debian/patches/09-directory-handle-leak.patch @@ -0,0 +1,12 @@ +Index: consolekit-0.2.10/src/ck-run-programs.c +=================================================================== +--- consolekit-0.2.10.orig/src/ck-run-programs.c ++++ consolekit-0.2.10/src/ck-run-programs.c +@@ -225,6 +225,7 @@ + out_loop: + g_free (child_argv[0]); + } ++ g_dir_close (dir); + out: + g_strfreev (env_for_child); + } --- consolekit-0.2.10.orig/debian/patches/06-polkit-result.patch +++ consolekit-0.2.10/debian/patches/06-polkit-result.patch @@ -0,0 +1,14 @@ +diff -up ConsoleKit-0.2.10/src/ck-manager.c.polkit-result ConsoleKit-0.2.10/src/ck-manager.c +--- ConsoleKit-0.2.10/src/ck-manager.c.polkit-result 2008-04-05 19:01:36.000000000 -0400 ++++ ConsoleKit-0.2.10/src/ck-manager.c 2008-04-05 19:01:41.000000000 -0400 +@@ -1123,8 +1123,8 @@ _check_polkit_for_action (CkManager + if (pk_result != POLKIT_RESULT_YES) { + error = g_error_new (CK_MANAGER_ERROR, + CK_MANAGER_ERROR_NOT_PRIVILEGED, +- "Not privileged for action: %s", +- action); ++ "Not privileged for action: %s %s", ++ action, polkit_result_to_string_representation (pk_result)); + dbus_error_free (&dbus_error); + dbus_g_method_return_error (context, error); + g_error_free (error); --- consolekit-0.2.10.orig/debian/patches/03-cleanup_console_tags.patch +++ consolekit-0.2.10/debian/patches/03-cleanup_console_tags.patch @@ -0,0 +1,66 @@ +Index: ConsoleKit-0.2.10/src/main.c +=================================================================== +--- ConsoleKit-0.2.10.orig/src/main.c 2008-07-25 03:19:34.000000000 +0200 ++++ ConsoleKit-0.2.10/src/main.c 2008-07-26 00:25:13.000000000 +0200 +@@ -149,6 +149,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]; + +@@ -229,7 +266,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, +@@ -312,6 +349,8 @@ + + g_debug ("initializing console-kit-daemon %s", VERSION); + ++ delete_console_tags (); ++ + create_pid_file (); + + manager = ck_manager_new (); --- consolekit-0.2.10.orig/debian/patches/01-dbus_policy.patch +++ consolekit-0.2.10/debian/patches/01-dbus_policy.patch @@ -0,0 +1,27 @@ +Index: ConsoleKit-0.2.10/data/ConsoleKit.conf +=================================================================== +--- ConsoleKit-0.2.10.orig/data/ConsoleKit.conf 2008-02-12 16:45:04.000000000 +0100 ++++ ConsoleKit-0.2.10/data/ConsoleKit.conf 2008-07-25 00:34:44.000000000 +0200 +@@ -22,10 +22,6 @@ + send_interface="org.freedesktop.DBus.Properties" /> + + +- +- + +@@ -91,4 +87,11 @@ + send_member="GetIdleSinceHint"/> + + ++ ++ ++ ++ ++ + --- consolekit-0.2.10.orig/debian/patches/02-exit_with_dbus.patch +++ consolekit-0.2.10/debian/patches/02-exit_with_dbus.patch @@ -0,0 +1,113 @@ +From 8ec523138671a8fe93748a0b75adaaca96e2392e Mon Sep 17 00:00:00 2001 +From: William Jon McCann +Date: Mon, 5 May 2008 13:34:08 -0400 +Subject: [PATCH] exit with the bus now that we're activated by the bus + +--- + src/main.c | 65 +++++++---------------------------------------------------- + 1 files changed, 8 insertions(+), 57 deletions(-) + +Index: ConsoleKit-0.2.10/src/main.c +=================================================================== +--- ConsoleKit-0.2.10.orig/src/main.c 2008-07-25 03:17:18.000000000 +0200 ++++ ConsoleKit-0.2.10/src/main.c 2008-07-25 03:17:26.000000000 +0200 +@@ -44,9 +44,6 @@ + + #define CK_DBUS_NAME "org.freedesktop.ConsoleKit" + +-static void bus_proxy_destroyed_cb (DBusGProxy *bus_proxy, +- CkManager *manager); +- + static gboolean + timed_exit_cb (GMainLoop *loop) + { +@@ -138,60 +135,12 @@ + return bus; + } + +-static gboolean +-bus_reconnect (CkManager *manager) +-{ +- DBusGConnection *bus; +- DBusGProxy *bus_proxy; +- gboolean ret; +- +- ret = TRUE; +- +- bus = get_system_bus (); +- if (bus == NULL) { +- goto out; +- } +- +- bus_proxy = get_bus_proxy (bus); +- if (bus_proxy == NULL) { +- g_warning ("Could not construct bus_proxy object; will retry"); +- goto out; +- } +- +- if (! acquire_name_on_proxy (bus_proxy) ) { +- g_warning ("Could not acquire name; will retry"); +- goto out; +- } +- +- manager = ck_manager_new (); +- if (manager == NULL) { +- g_warning ("Could not construct manager object"); +- exit (1); +- } +- +- g_signal_connect (bus_proxy, +- "destroy", +- G_CALLBACK (bus_proxy_destroyed_cb), +- manager); +- +- g_debug ("Successfully reconnected to D-Bus"); +- +- ret = FALSE; +- +- out: +- return ret; +-} +- + static void + bus_proxy_destroyed_cb (DBusGProxy *bus_proxy, +- CkManager *manager) ++ GMainLoop *loop) + { + g_debug ("Disconnected from D-Bus"); +- +- g_object_unref (manager); +- manager = NULL; +- +- g_timeout_add (3000, (GSourceFunc)bus_reconnect, manager); ++ g_main_loop_quit (loop); + } + + static void +@@ -371,12 +320,12 @@ + goto out; + } + ++ loop = g_main_loop_new (NULL, FALSE); ++ + g_signal_connect (bus_proxy, + "destroy", + G_CALLBACK (bus_proxy_destroyed_cb), +- manager); +- +- loop = g_main_loop_new (NULL, FALSE); ++ loop); + + if (do_timed_exit) { + g_timeout_add (1000 * 30, (GSourceFunc) timed_exit_cb, loop); +@@ -384,7 +333,9 @@ + + g_main_loop_run (loop); + +- g_object_unref (manager); ++ if (manager != NULL) { ++ g_object_unref (manager); ++ } + + g_main_loop_unref (loop); + --- consolekit-0.2.10.orig/debian/patches/04-consolekit_park.patch +++ consolekit-0.2.10/debian/patches/04-consolekit_park.patch @@ -0,0 +1,186 @@ +# +# Upstream: https://bugs.freedesktop.org/show_bug.cgi?id=11786 +# +diff -Nur -x '*.orig' -x '*~' consolekit-0.2.10/src/ck-manager.c consolekit-0.2.10.new/src/ck-manager.c +--- consolekit-0.2.10/src/ck-manager.c 2008-02-25 23:56:33.000000000 +0000 ++++ consolekit-0.2.10.new/src/ck-manager.c 2008-07-15 15:56:51.000000000 +0100 +@@ -30,6 +30,13 @@ + #include + #include + #include ++ #ifdef HAVE_PATHS_H ++ #include ++ #endif /* HAVE_PATHS_H */ ++ ++ #ifndef _PATH_TTY ++ #define _PATH_TTY "/dev/tty" ++ #endif + + #include + #include +@@ -2365,6 +2372,41 @@ + CkManager *manager; + } RemoveLeaderData; + ++gboolean ++ck_manager_set_x11_parking_place (CkManager *manager, ++ const char *x11display, ++ const char *x11displaydevice, ++ DBusGMethodInvocation *context) ++{ ++ CkSeat *seat; ++ guint num; ++ gboolean res = FALSE; ++ ++ g_debug ("x11display=%s device=%s", x11display, x11displaydevice); ++ ++ seat = g_hash_table_lookup (manager->priv->seats, ++ CK_DBUS_PATH "/Seat1"); ++ /* FIXME: this is rather unpleasantly hardcoded, but it ++ * mirrors the code in find_seat_for_session - iwj */ ++ if (seat == NULL) { ++ g_debug ("no seat"); ++ goto xit; ++ } ++ ++ if (sscanf (x11displaydevice, _PATH_TTY "%u", &num) != 1) { ++ g_debug ("bad device"); ++ goto xit; ++ } ++ ++ ck_seat_set_park_vt (seat, num); ++ res = TRUE; ++ ++xit: ++ dbus_g_method_return (context, res); ++ ++ return TRUE; ++} ++ + static gboolean + remove_leader_for_connection (const char *cookie, + CkSessionLeader *leader, +diff -Nur -x '*.orig' -x '*~' consolekit-0.2.10/src/ck-manager.h consolekit-0.2.10.new/src/ck-manager.h +--- consolekit-0.2.10/src/ck-manager.h 2008-01-23 16:00:22.000000000 +0000 ++++ consolekit-0.2.10.new/src/ck-manager.h 2008-07-15 15:53:35.000000000 +0100 +@@ -94,6 +94,10 @@ + gboolean ck_manager_close_session (CkManager *manager, + const char *cookie, + DBusGMethodInvocation *context); ++gboolean ck_manager_set_x11_parking_place (CkManager *manager, ++ const char *x11display, ++ const char *x11displaydevice, ++ DBusGMethodInvocation *context); + gboolean ck_manager_get_current_session (CkManager *manager, + DBusGMethodInvocation *context); + gboolean ck_manager_get_session_for_cookie (CkManager *manager, +diff -Nur -x '*.orig' -x '*~' consolekit-0.2.10/src/ck-manager.xml consolekit-0.2.10.new/src/ck-manager.xml +--- consolekit-0.2.10/src/ck-manager.xml 2008-01-23 16:01:48.000000000 +0000 ++++ consolekit-0.2.10.new/src/ck-manager.xml 2008-07-15 15:53:35.000000000 +0100 +@@ -21,6 +21,11 @@ + + + ++ ++ ++ ++ ++ + + + +diff -Nur -x '*.orig' -x '*~' consolekit-0.2.10/src/ck-seat.c consolekit-0.2.10.new/src/ck-seat.c +--- consolekit-0.2.10/src/ck-seat.c 2008-02-25 20:17:02.000000000 +0000 ++++ consolekit-0.2.10.new/src/ck-seat.c 2008-07-15 15:56:24.000000000 +0100 +@@ -61,6 +61,8 @@ + CkSession *active_session; + + CkVtMonitor *vt_monitor; ++ guint vt_park_num; ++ gboolean vt_park_enable; + + DBusGConnection *connection; + }; +@@ -498,9 +500,17 @@ + g_object_ref (session); + ck_session_get_id (session, &ssid, NULL); + ck_session_set_active (session, TRUE, NULL); ++ g_debug ("Active session changed: %s", ssid); ++ } else if (seat->priv->vt_park_enable) { ++ ck_seat_park (seat); ++ g_debug ("Active session: none - parking"); ++ } else { ++ g_debug ("Active session: none and no parking"); + } + +- g_debug ("Active session changed: %s", ssid ? ssid : "(null)"); ++ /* We park only once: enable is set when a session exits ++ * and cleared here when we choose a new session. */ ++ seat->priv->vt_park_enable = FALSE; + + g_signal_emit (seat, signals [ACTIVE_SESSION_CHANGED], 0, ssid); + +@@ -549,6 +559,33 @@ + return TRUE; + } + ++void ++ck_seat_park (CkSeat *seat) ++{ ++ GError *vt_error; ++ guint num; ++ gboolean ret; ++ ++ num = seat->priv->vt_park_num; ++ g_debug ("Parking on VT %u", num); ++ if (num < 0) return; ++ ++ vt_error = NULL; ++ ret = ck_vt_monitor_set_active (seat->priv->vt_monitor, num, &vt_error); ++ if (! ret) { ++ g_debug ("Unable to park: %s", vt_error->message); ++ g_error_free (vt_error); ++ } ++} ++ ++void ++ck_seat_set_park_vt (CkSeat *seat, guint num) ++{ ++ g_debug ("Parking place is VT %u", num); ++ ++ seat->priv->vt_park_num = num; ++} ++ + gboolean + ck_seat_remove_session (CkSeat *seat, + CkSession *session, +@@ -592,6 +629,7 @@ + g_signal_emit (seat, signals [SESSION_REMOVED], 0, ssid); + + /* try to change the active session */ ++ seat->priv->vt_park_enable = TRUE; + maybe_update_active_session (seat); + + if (orig_session != NULL) { +@@ -988,6 +1026,8 @@ + g_str_equal, + g_free, + (GDestroyNotify) g_object_unref); ++ seat->priv->vt_park_num = -1; ++ seat->priv->vt_park_enable = FALSE; + seat->priv->devices = g_ptr_array_new (); + } + +diff -Nur -x '*.orig' -x '*~' consolekit-0.2.10/src/ck-seat.h consolekit-0.2.10.new/src/ck-seat.h +--- consolekit-0.2.10/src/ck-seat.h 2008-01-23 14:30:44.000000000 +0000 ++++ consolekit-0.2.10.new/src/ck-seat.h 2008-07-15 15:53:35.000000000 +0100 +@@ -133,6 +133,9 @@ + gboolean ck_seat_activate_session (CkSeat *seat, + const char *ssid, + DBusGMethodInvocation *context); ++void ck_seat_park (CkSeat *seat); ++void ck_seat_set_park_vt (CkSeat *seat, ++ guint num); + + G_END_DECLS +