rpms/ConsoleKit/F-8 ConsoleKit-0.2.3-badaddr.patch, NONE, 1.1 ConsoleKit.spec, 1.17, 1.18 ConsoleKit-0.2.0-daemonize-properly.patch, 1.1, NONE

Lubomir Kundrak (lkundrak) fedora-extras-commits at redhat.com
Fri Feb 29 19:15:36 UTC 2008


Author: lkundrak

Update of /cvs/pkgs/rpms/ConsoleKit/F-8
In directory cvs-int.fedora.redhat.com:/tmp/cvs-serv20704/F-8

Modified Files:
	ConsoleKit.spec 
Added Files:
	ConsoleKit-0.2.3-badaddr.patch 
Removed Files:
	ConsoleKit-0.2.0-daemonize-properly.patch 
Log Message:
VT_GETSTATE patch from Peter Jones (#359361)

ConsoleKit-0.2.3-badaddr.patch:

--- NEW FILE ConsoleKit-0.2.3-badaddr.patch ---
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;


Index: ConsoleKit.spec
===================================================================
RCS file: /cvs/pkgs/rpms/ConsoleKit/F-8/ConsoleKit.spec,v
retrieving revision 1.17
retrieving revision 1.18
diff -u -r1.17 -r1.18
--- ConsoleKit.spec	5 Feb 2008 18:06:06 -0000	1.17
+++ ConsoleKit.spec	29 Feb 2008 19:14:45 -0000	1.18
@@ -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 @@
 %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 @@
 %doc %{_datadir}/doc/%{name}-%{version}/spec/*
 
 %changelog
+* Fri Feb 29 2008 Lubomir Kundrak <lkundrak at redhat.com> - 0.2.3-3.1
+- Keep track of active sessions correctly (#359361)
+
 * Tue Feb  5 2008 Jon McCann  <jmccann at redhat.com> - 0.2.3-3
 - Ask D-Bus not to change SIGPIPE handling  (#430431)
 


--- ConsoleKit-0.2.0-daemonize-properly.patch DELETED ---




More information about the fedora-extras-commits mailing list