diff --git a/ConsoleKit-0.2.0-daemonize-properly.patch b/ConsoleKit-0.2.0-daemonize-properly.patch deleted file mode 100644 index 38f0cb0..0000000 --- a/ConsoleKit-0.2.0-daemonize-properly.patch +++ /dev/null @@ -1,13 +0,0 @@ -diff --git a/src/main.c b/src/main.c -index 446b291..9ae9e10 100644 ---- a/src/main.c -+++ b/src/main.c -@@ -256,7 +256,7 @@ main (int argc, - ck_debug ("initializing console-kit-daemon %s", VERSION); - - /* Don't close stdout and stderr for now */ -- if (! no_daemon && daemon (0, 1)) { -+ if (! no_daemon && daemon (0, 0)) { - g_error ("Could not daemonize: %s", g_strerror (errno)); - } - diff --git a/ConsoleKit-0.2.3-badaddr.patch b/ConsoleKit-0.2.3-badaddr.patch new file mode 100644 index 0000000..68eed6c --- /dev/null +++ b/ConsoleKit-0.2.3-badaddr.patch @@ -0,0 +1,58 @@ +Peter Jones: + +Description of problem: ConsoleKit tries to find a valid fd it can issue +VT_WAITACTIVE against by iterating across a file list and issuing +ioctl(fd, KDGKBTYPE, &arg), then checking the return value. Not all console +devices support this ioctl, so in some cases it never finds a valid file +descriptor to use, and from then on never marks any session active. + +We probably ought to be using something like VT_GETSTATE instead of a keyboard +ioctl, but that's not sufficient to fix it. One fix that seems to work, though +I'm not completely sure if it's the best answer, is to add /dev/tty0 to the list +of files to try before /dev/console. + +https://bugzilla.redhat.com/show_bug.cgi?id=359361 + +diff -urpN ConsoleKit-0.2.3/src/ck-sysdeps-unix.c.badaddr ConsoleKit-0.2.3/src/ck-sysdeps-unix.c +--- ConsoleKit-0.2.3/src/ck-sysdeps-unix.c.badaddr 2007-08-28 13:19:17.000000000 -0400 ++++ ConsoleKit-0.2.3/src/ck-sysdeps-unix.c 2007-10-30 18:40:55.000000000 -0400 +@@ -124,15 +124,15 @@ gboolean + ck_fd_is_a_console (int fd) + { + #ifdef __linux__ +- char arg = 0; ++ struct vt_stat vts; + #elif defined(__FreeBSD__) + int vers; + #endif + int kb_ok; + ++ errno = 0; + #ifdef __linux__ +- kb_ok = (ioctl (fd, KDGKBTYPE, &arg) == 0 +- && ((arg == KB_101) || (arg == KB_84))); ++ kb_ok = (ioctl (fd, VT_GETSTATE, &vts) == 0); + #elif defined(__FreeBSD__) + kb_ok = (ioctl (fd, CONS_GETVERS, &vers) == 0); + #else +@@ -193,6 +193,11 @@ ck_get_a_console_fd (void) + goto done; + } + ++ fd = open_a_console("/dev/tty0"); ++ if (fd >= 0) { ++ goto done; ++ } ++ + #ifdef _PATH_CONSOLE + fd = open_a_console (_PATH_CONSOLE); + if (fd >= 0) { +@@ -256,7 +261,7 @@ ck_wait_for_active_console_num (int co + errno = 0; + res = ioctl (console_fd, VT_WAITACTIVE, num); + +- g_debug ("VT_WAITACTIVE for vt %d returned %d", num, ret); ++ g_debug ("VT_WAITACTIVE for vt %d returned %d (%m)", num, res); + + if (res == ERROR) { + const char *errmsg; diff --git a/ConsoleKit.spec b/ConsoleKit.spec index 23dbb43..4cc10fe 100644 --- a/ConsoleKit.spec +++ b/ConsoleKit.spec @@ -5,13 +5,14 @@ Summary: System daemon for tracking users, sessions and seats Name: ConsoleKit Version: 0.2.3 -Release: 3%{?dist} +Release: 3%{?dist}.1 License: GPLv2+ Group: System Environment/Libraries URL: http://www.freedesktop.org/wiki/Software/ConsoleKit Source0: http://people.freedesktop.org/~mccann/dist/ConsoleKit-%{version}.tar.gz Patch0: ConsoleKit-0.2.1-lsb.patch Patch1: ConsoleKit-0.2.3-dbus-change-sigpipe.patch +Patch2: ConsoleKit-0.2.3-badaddr.patch BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) Requires: dbus >= %{dbus_version} @@ -78,6 +79,7 @@ Developer documentation docs for HAL. %setup -q %patch0 -p1 -b .lsb %patch1 -p1 -b .sigpipe +%patch2 -p1 -b .badaddr %build %configure --with-pid-file=%{_localstatedir}/run/console-kit-daemon.pid --enable-pam-module --with-pam-module-dir=/%{_lib}/security --enable-docbook-docs --docdir=%{_datadir}/doc/%{name}-%{version} @@ -146,6 +148,9 @@ fi %doc %{_datadir}/doc/%{name}-%{version}/spec/* %changelog +* Fri Feb 29 2008 Lubomir Kundrak - 0.2.3-3.1 +- Keep track of active sessions correctly (#359361) + * Tue Feb 5 2008 Jon McCann - 0.2.3-3 - Ask D-Bus not to change SIGPIPE handling (#430431)