rpms/kdebase/devel kdebase-3.91.0-consolekit-kdm.patch, NONE, 1.1.2.1 kdebase-3.92.0-redhat-startkde.patch, NONE, 1.1.2.1 kdebase.spec, 1.263.2.11, 1.263.2.12 kdebase-3.91.0-redhat-startkde.patch, 1.1.2.1, NONE
Rex Dieter (rdieter)
fedora-extras-commits at redhat.com
Mon Jul 30 20:22:23 UTC 2007
- Previous message: rpms/firstboot/devel firstboot.spec, 1.104, 1.105 sources, 1.101, 1.102
- Next message: rpms/NetworkManager/OLPC-2 .cvsignore, 1.52, 1.53 NetworkManager.spec, 1.161, 1.162 sources, 1.70, 1.71
- Messages sorted by:
[ date ]
[ thread ]
[ subject ]
[ author ]
Author: rdieter
Update of /cvs/pkgs/rpms/kdebase/devel
In directory cvs-int.fedora.redhat.com:/tmp/cvs-serv15342
Modified Files:
Tag: kdebase-kde4-branch
kdebase.spec
Added Files:
Tag: kdebase-kde4-branch
kdebase-3.91.0-consolekit-kdm.patch
kdebase-3.92.0-redhat-startkde.patch
Removed Files:
Tag: kdebase-kde4-branch
kdebase-3.91.0-redhat-startkde.patch
Log Message:
* Mon Jul 30 2007 Rex Dieter <rdieter[AT]fedoraproject.org> 3.92.0-2
- consolekit_kdm patch (#228111, kde#147790)
- update startkde patch
kdebase-3.91.0-consolekit-kdm.patch:
--- NEW FILE kdebase-3.91.0-consolekit-kdm.patch ---
diff -Nur kdebase-3.91.0/workspace/cmake/modules/FindDBus.cmake kdebase-3.91.0-consolekit/workspace/cmake/modules/FindDBus.cmake
--- kdebase-3.91.0/workspace/cmake/modules/FindDBus.cmake 1970-01-01 01:00:00.000000000 +0100
+++ kdebase-3.91.0-consolekit/workspace/cmake/modules/FindDBus.cmake 2007-07-04 09:23:12.000000000 +0200
@@ -0,0 +1,39 @@
+
+if(DBUS_INCLUDE_DIR AND DBUS_LIBRARY AND DBUS_ARCH_INCLUDE_DIR)
+ # Already in cache, be silent
+ set(DBUS_FIND_QUIETLY TRUE)
+endif(DBUS_INCLUDE_DIR AND DBUS_LIBRARY AND DBUS_ARCH_INCLUDE_DIR)
+
+set(DBUS_LIBRARY)
+set(DBUS_INCLUDE_DIR)
+set(DBUS_ARCH_INCLUDE_DIR)
+
+FIND_PATH(DBUS_INCLUDE_DIR dbus/dbus.h
+ /usr/include
+ /usr/include/dbus-1.0
+ /usr/local/include
+)
+
+FIND_PATH(DBUS_ARCH_INCLUDE_DIR dbus/dbus-arch-deps.h
+ /usr/lib${LIB_SUFFIX}/include
+ /usr/lib${LIB_SUFFIX}/dbus-1.0/include
+ /usr/lib64/include
+ /usr/lib64/dbus-1.0/include
+ /usr/lib/include
+ /usr/lib/dbus-1.0/include
+)
+
+FIND_LIBRARY(DBUS_LIBRARY NAMES dbus-1 dbus
+ PATHS
+ /usr/lib
+ /usr/local/lib
+)
+
+if(DBUS_INCLUDE_DIR AND DBUS_LIBRARY AND DBUS_ARCH_INCLUDE_DIR)
+ MESSAGE( STATUS "dbus found: includes in ${DBUS_INCLUDE_DIR}, library in ${DBUS_LIBRARY}")
+ set(DBUS_FOUND TRUE)
+else(DBUS_INCLUDE_DIR AND DBUS_LIBRARY AND DBUS_ARCH_INCLUDE_DIR)
+ MESSAGE( STATUS "dbus not found")
+endif(DBUS_INCLUDE_DIR AND DBUS_LIBRARY AND DBUS_ARCH_INCLUDE_DIR)
+
+MARK_AS_ADVANCED(DBUS_INCLUDE_DIR DBUS_LIBRARY DBUS_ARCH_INCLUDE_DIR)
diff -Nur kdebase-3.91.0/workspace/kdm/backend/client.c kdebase-3.91.0-consolekit/workspace/kdm/backend/client.c
--- kdebase-3.91.0/workspace/kdm/backend/client.c 2007-06-27 12:46:04.000000000 +0200
+++ kdebase-3.91.0-consolekit/workspace/kdm/backend/client.c 2007-07-04 07:31:01.000000000 +0200
@@ -81,6 +81,10 @@
# include <time.h>
#endif /* USE_PAM || _AIX */
+#ifdef WITH_CONSOLE_KIT
+#include "consolekit.h"
+#endif
+
/*
* Session data, mostly what struct verify_info was for
*/
@@ -1103,8 +1107,13 @@
static int removeCreds;
#endif
+#ifdef WITH_CONSOLE_KIT
+int
+startClient( volatile int *pid, const char *ck_session_cookie )
+#else
int
startClient( volatile int *pid )
+#endif
{
const char *home, *sessargs, *desksess;
char **env, *xma;
@@ -1184,6 +1193,11 @@
if (krbtkfile[0] != '\0')
env = setEnv( env, "KRBTKFILE", krbtkfile );
#endif
+#ifdef WITH_CONSOLE_KIT
+ if (ck_session_cookie != NULL) {
+ env = setEnv ( env, "XDG_SESSION_COOKIE", ck_session_cookie );
+ }
+#endif
userEnviron = inheritEnv( env, envvars );
env = systemEnv( curuser );
systemEnviron = setEnv( env, "HOME", p->pw_dir );
diff -Nur kdebase-3.91.0/workspace/kdm/backend/CMakeLists.txt kdebase-3.91.0-consolekit/workspace/kdm/backend/CMakeLists.txt
--- kdebase-3.91.0/workspace/kdm/backend/CMakeLists.txt 2007-06-27 12:46:04.000000000 +0200
+++ kdebase-3.91.0-consolekit/workspace/kdm/backend/CMakeLists.txt 2007-07-11 11:44:32.000000000 +0200
@@ -1,3 +1,4 @@
+find_package(DBus REQUIRED)
set(kdm_SRCS
greet.h
dm.h
@@ -8,6 +9,7 @@
bootman.c
client.c
ctrl.c
+ consolekit.c
daemon.c
dm.c
dpylist.c
@@ -54,6 +56,7 @@
macro_add_file_dependencies(error.c ${CMAKE_CURRENT_SOURCE_DIR}/printf.c)
kde4_add_executable(kdm NOGUI ${kdm_SRCS})
macro_add_compile_flags(kdm -U_REENTRANT)
+include_directories(${DBUS_INCLUDE_DIR} ${DBUS_ARCH_INCLUDE_DIR})
target_link_libraries( kdm
${X11_LIBRARIES}
${UNIXAUTH_LIBRARIES}
@@ -64,6 +67,7 @@
${RESOLV_LIBRARIES}
${UTIL_LIBRARIES}
${POSIX4_LIBRARIES}
+ ${DBUS_LIBRARY}
)
if(KDE4_ENABLE_FINAL)
macro_add_file_dependencies(${CMAKE_CURRENT_BINARY_DIR}/kdm_final_cpp.cpp ${confci})
diff -Nur kdebase-3.91.0/workspace/kdm/backend/consolekit.c kdebase-3.91.0-consolekit/workspace/kdm/backend/consolekit.c
--- kdebase-3.91.0/workspace/kdm/backend/consolekit.c 1970-01-01 01:00:00.000000000 +0100
+++ kdebase-3.91.0-consolekit/workspace/kdm/backend/consolekit.c 2007-07-04 07:52:32.000000000 +0200
@@ -0,0 +1,539 @@
+/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*-
+ *
+ * Copyright (C) 2006-2007 William Jon McCann <mccann at jhu.edu>
+ * Copyright (C) 2007 Kevin Kofler <Kevin at tigcc.ticalc.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 "dm.h"
+#include "dm_auth.h"
+#include "dm_error.h"
+
+#include <stdlib.h>
+#include <string.h>
+#include <pwd.h>
+
+#define DBUS_API_SUBJECT_TO_CHANGE
+#include <dbus/dbus.h>
+
+#include "consolekit.h"
+
+
+#define CK_NAME "org.freedesktop.ConsoleKit"
+#define CK_PATH "/org/freedesktop/ConsoleKit"
+#define CK_INTERFACE "org.freedesktop.ConsoleKit"
+#define CK_MANAGER_PATH "/org/freedesktop/ConsoleKit/Manager"
+#define CK_MANAGER_INTERFACE "org.freedesktop.ConsoleKit.Manager"
+#define CK_SESSION_INTERFACE "org.freedesktop.ConsoleKit.Session"
+
+static DBusConnection *private_connection = NULL;
+
+static void
+add_param_int (DBusMessageIter *iter_struct,
+ const char *key,
+ int value)
+{
+ DBusMessageIter iter_struct_entry;
+ DBusMessageIter iter_var;
+
+ dbus_message_iter_open_container (iter_struct,
+ DBUS_TYPE_STRUCT,
+ NULL,
+ &iter_struct_entry);
+
+ dbus_message_iter_append_basic (&iter_struct_entry,
+ DBUS_TYPE_STRING,
+ &key);
+
+ dbus_message_iter_open_container (&iter_struct_entry,
+ DBUS_TYPE_VARIANT,
+ DBUS_TYPE_INT32_AS_STRING,
+ &iter_var);
+
+ dbus_message_iter_append_basic (&iter_var,
+ DBUS_TYPE_INT32,
+ &value);
+
+ dbus_message_iter_close_container (&iter_struct_entry,
+ &iter_var);
+
+ dbus_message_iter_close_container (iter_struct, &iter_struct_entry);
+}
+
+static void
+add_param_boolean (DBusMessageIter *iter_struct,
+ const char *key,
+ int value)
+{
+ DBusMessageIter iter_struct_entry;
+ DBusMessageIter iter_var;
+
+ dbus_message_iter_open_container (iter_struct,
+ DBUS_TYPE_STRUCT,
+ NULL,
+ &iter_struct_entry);
+
+ dbus_message_iter_append_basic (&iter_struct_entry,
+ DBUS_TYPE_STRING,
+ &key);
+
+ dbus_message_iter_open_container (&iter_struct_entry,
+ DBUS_TYPE_VARIANT,
+ DBUS_TYPE_BOOLEAN_AS_STRING,
+ &iter_var);
+
+ dbus_message_iter_append_basic (&iter_var,
+ DBUS_TYPE_BOOLEAN,
+ &value);
+
+ dbus_message_iter_close_container (&iter_struct_entry,
+ &iter_var);
+
+ dbus_message_iter_close_container (iter_struct, &iter_struct_entry);
+}
+
+static void
+add_param_string (DBusMessageIter *iter_struct,
+ const char *key,
+ const char *value)
+{
+ DBusMessageIter iter_struct_entry;
+ DBusMessageIter iter_var;
+
+ dbus_message_iter_open_container (iter_struct,
+ DBUS_TYPE_STRUCT,
+ NULL,
+ &iter_struct_entry);
+
+ dbus_message_iter_append_basic (&iter_struct_entry,
+ DBUS_TYPE_STRING,
+ &key);
+
+ dbus_message_iter_open_container (&iter_struct_entry,
+ DBUS_TYPE_VARIANT,
+ DBUS_TYPE_STRING_AS_STRING,
+ &iter_var);
+
+ dbus_message_iter_append_basic (&iter_var,
+ DBUS_TYPE_STRING,
+ &value);
+
+ dbus_message_iter_close_container (&iter_struct_entry,
+ &iter_var);
+
+ dbus_message_iter_close_container (iter_struct, &iter_struct_entry);
+}
+
+static int
+session_get_x11_display (DBusConnection *connection,
+ const char *ssid,
+ char **str)
+{
+ DBusError error;
+ DBusMessage *message;
+ DBusMessage *reply;
+ DBusMessageIter iter;
+ const char *value;
+
+ if (str != NULL) {
+ *str = NULL;
+ }
+
+ message = dbus_message_new_method_call (CK_NAME,
+ ssid,
+ CK_SESSION_INTERFACE,
+ "GetX11Display");
+ if (message == NULL) {
+ debug ("ConsoleKit: Couldn't allocate the D-Bus message");
+ return FALSE;
+ }
+
+ dbus_error_init (&error);
+ reply = dbus_connection_send_with_reply_and_block (connection,
+ message,
+ -1, &error);
+ if (dbus_error_is_set (&error)) {
+ debug ("ConsoleKit: %s raised:\n %s\n\n", error.name, error.message);
+ reply = NULL;
+ }
+
+ dbus_connection_flush (connection);
+ dbus_message_unref (message);
+
+ if (reply == NULL) {
+ return FALSE;
+ }
+
+ dbus_message_iter_init (reply, &iter);
+ dbus_message_iter_get_basic (&iter, &value);
+ if (str != NULL) {
+ *str = strdup (value);
+ }
+ dbus_message_unref (reply);
+
+ return TRUE;
+}
+
+static int
+session_unlock (DBusConnection *connection,
+ const char *ssid)
+{
+ DBusError error;
+ DBusMessage *message;
+ DBusMessage *reply;
+
+ debug ("ConsoleKit: Unlocking session %s", ssid);
+ message = dbus_message_new_method_call (CK_NAME,
+ ssid,
+ CK_SESSION_INTERFACE,
+ "Unlock");
+ if (message == NULL) {
+ debug ("ConsoleKit: Couldn't allocate the D-Bus message");
+ return FALSE;
+ }
+
+ dbus_error_init (&error);
+ reply = dbus_connection_send_with_reply_and_block (connection,
+ message,
+ -1, &error);
+ dbus_message_unref (message);
+ dbus_message_unref (reply);
+ dbus_connection_flush (connection);
+
+ if (dbus_error_is_set (&error)) {
+ debug ("ConsoleKit: %s raised:\n %s\n\n", error.name, error.message);
+ return FALSE;
+ }
+
+ return TRUE;
+}
+
+/* from libhal */
+static char **
+get_path_array_from_iter (DBusMessageIter *iter,
+ int *num_elements)
+{
+ int count;
+ char **buffer;
+
+ count = 0;
+ buffer = (char **)malloc (sizeof (char *) * 8);
+
+ if (buffer == NULL)
+ goto oom;
+
+ buffer[0] = NULL;
+ while (dbus_message_iter_get_arg_type (iter) == DBUS_TYPE_OBJECT_PATH) {
+ const char *value;
+ char *str;
+
+ if ((count % 8) == 0 && count != 0) {
+ buffer = realloc (buffer, sizeof (char *) * (count + 8));
+ if (buffer == NULL)
+ goto oom;
+ }
+
+ dbus_message_iter_get_basic (iter, &value);
+ str = strdup (value);
+ if (str == NULL)
+ goto oom;
+
+ buffer[count] = str;
+
+ dbus_message_iter_next (iter);
+ count++;
+ }
+
+ if ((count % 8) == 0) {
+ buffer = realloc (buffer, sizeof (char *) * (count + 1));
+ if (buffer == NULL)
+ goto oom;
+ }
+
+ buffer[count] = NULL;
+ if (num_elements != NULL)
+ *num_elements = count;
+ return buffer;
+
+oom:
+ logWarn ("%s %d : error allocating memory\n", __FILE__, __LINE__);
+ return NULL;
+
+}
+
+static char **
+get_sessions_for_user (DBusConnection *connection,
+ const char *user,
+ const char *x11_display)
+{
+ DBusError error;
+ DBusMessage *message;
+ DBusMessage *reply;
+ DBusMessageIter iter;
+ DBusMessageIter iter_reply;
+ DBusMessageIter iter_array;
+ struct passwd *pwent;
+ char **sessions;
+
+ sessions = NULL;
+ message = NULL;
+ reply = NULL;
+
+ pwent = getpwnam (user);
+
+ dbus_error_init (&error);
+ message = dbus_message_new_method_call (CK_NAME,
+ CK_MANAGER_PATH,
+ CK_MANAGER_INTERFACE,
+ "GetSessionsForUser");
+ if (message == NULL) {
+ debug ("ConsoleKit: Couldn't allocate the D-Bus message");
+ goto out;
+ }
+
+ dbus_message_iter_init_append (message, &iter);
+ dbus_message_iter_append_basic (&iter,
+ DBUS_TYPE_UINT32,
+ &pwent->pw_uid);
+
+ dbus_error_init (&error);
+ reply = dbus_connection_send_with_reply_and_block (connection,
+ message,
+ -1, &error);
+ dbus_connection_flush (connection);
+
+ if (dbus_error_is_set (&error)) {
+ debug ("ConsoleKit: %s raised:\n %s\n\n", error.name, error.message);
+ goto out;
+ }
+
+ if (reply == NULL) {
+ debug ("ConsoleKit: No reply for GetSessionsForUser");
+ goto out;
+ }
+
+ dbus_message_iter_init (reply, &iter_reply);
+ if (dbus_message_iter_get_arg_type (&iter_reply) != DBUS_TYPE_ARRAY) {
+ debug ("ConsoleKit: Wrong reply for GetSessionsForUser - expecting an array.");
+ goto out;
+ }
+
+ dbus_message_iter_recurse (&iter_reply, &iter_array);
+ sessions = get_path_array_from_iter (&iter_array, NULL);
+
+ out:
+ if (message != NULL) {
+ dbus_message_unref (message);
+ }
+ if (reply != NULL) {
+ dbus_message_unref (reply);
+ }
+
+ return sessions;
+}
+
+void
+unlock_ck_session (const char *user,
+ const char *x11_display)
+{
+ DBusError error;
+ DBusConnection *connection;
+ char **sessions;
+ int i;
+
+ debug ("ConsoleKit: Unlocking session for %s on %s", user, x11_display);
+
+ dbus_error_init (&error);
+ connection = dbus_bus_get (DBUS_BUS_SYSTEM, &error);
+ if (connection == NULL) {
+ debug ("ConsoleKit: Failed to connect to the D-Bus daemon: %s", error.message);
+ dbus_error_free (&error);
+ return;
+ }
+
+ sessions = get_sessions_for_user (connection, user, x11_display);
+ if (sessions == NULL || sessions[0] == NULL) {
+ debug ("ConsoleKit: no sessions found");
+ return;
+ }
+
+ for (i = 0; sessions[i] != NULL; i++) {
+ char *ssid;
+ char *xdisplay;
+
+ ssid = sessions[i];
+ session_get_x11_display (connection, ssid, &xdisplay);
+ debug ("ConsoleKit: session %s has DISPLAY %s", ssid, xdisplay);
+
+ if (xdisplay != NULL
+ && x11_display != NULL
+ && strcmp (xdisplay, x11_display) == 0) {
+ int res;
+
+ res = session_unlock (connection, ssid);
+ if (! res) {
+ logError ("ConsoleKit: Unable to unlock %s", ssid);
+ }
+ }
+
+ free (xdisplay);
+ }
+
+ freeStrArr (sessions);
+}
+
+char *
+open_ck_session (struct passwd *pwent,
+ struct display *d)
+{
+ DBusConnection *connection;
+ DBusError error;
+ DBusMessage *message;
+ DBusMessage *reply;
+ DBusMessageIter iter;
+ DBusMessageIter iter_struct;
+ char *cookie;
+
+ cookie = NULL;
+
+ debug ("ConsoleKit: Opening session for %s", pwent->pw_name);
+
+ dbus_error_init (&error);
+ connection = dbus_bus_get_private (DBUS_BUS_SYSTEM, &error);
+ private_connection = connection;
+
+ if (connection == NULL) {
+ debug ("ConsoleKit: Failed to connect to the D-Bus daemon: %s", error.message);
+ dbus_error_free (&error);
+ return NULL;
+ }
+
+ dbus_connection_set_exit_on_disconnect (connection, FALSE);
+ /* No mainloop integration needed for D-Bus because only blocking calls are used. */
+
+ dbus_error_init (&error);
+ message = dbus_message_new_method_call (CK_NAME,
+ CK_MANAGER_PATH,
+ CK_MANAGER_INTERFACE,
+ "OpenSessionWithParameters");
+ if (message == NULL) {
+ debug ("ConsoleKit: Couldn't allocate the D-Bus message");
+ return NULL;
+ }
+
+ dbus_message_iter_init_append (message, &iter);
+ dbus_message_iter_open_container (&iter,
+ DBUS_TYPE_ARRAY,
+ DBUS_STRUCT_BEGIN_CHAR_AS_STRING
+ DBUS_TYPE_STRING_AS_STRING
+ DBUS_TYPE_VARIANT_AS_STRING
+ DBUS_STRUCT_END_CHAR_AS_STRING,
+ &iter_struct);
+
+ add_param_int (&iter_struct, "user", pwent->pw_uid);
+ add_param_string (&iter_struct, "x11-display", d->name);
+ add_param_boolean (&iter_struct, "is-local", ((d->displayType & d_location) == dLocal));
+#ifdef XDMCP
+ if ((d->displayType & d_location) != dLocal) {
+ add_param_string (&iter_struct, "remote-host-name", d->remoteHost);
+ }
+#endif
+
+#ifdef HAVE_VTS
+ if (d->serverVT > 0) {
+ char device[20];
+
+ /* FIXME: how does xorg construct this */
+ sprintf(device, "/dev/tty%d", d->serverVT);
+ add_param_string (&iter_struct, "x11-display-device", device);
+ }
+#endif
+
+ dbus_message_iter_close_container (&iter, &iter_struct);
+
+ reply = dbus_connection_send_with_reply_and_block (connection,
+ message,
+ -1, &error);
+ if (dbus_error_is_set (&error)) {
+ debug ("ConsoleKit: %s raised:\n %s\n\n", error.name, error.message);
+ reply = NULL;
+ }
+
+ dbus_connection_flush (connection);
+
+ dbus_message_unref (message);
+ dbus_error_free (&error);
+
+ if (reply != NULL) {
+ const char *value;
+
+ dbus_message_iter_init (reply, &iter);
+ dbus_message_iter_get_basic (&iter, &value);
+ cookie = strdup (value);
+ dbus_message_unref (reply);
+ }
+
+ return cookie;
+}
+
+void
+close_ck_session (const char *cookie)
+{
+ DBusError error;
+ DBusMessage *message;
+ DBusMessage *reply;
+ DBusMessageIter iter;
+
+ if (cookie == NULL) {
+ return;
+ }
+
+ if (private_connection == NULL) {
+ return;
+ }
+
+ dbus_error_init (&error);
+ message = dbus_message_new_method_call (CK_NAME,
+ CK_MANAGER_PATH,
+ CK_MANAGER_INTERFACE,
+ "CloseSession");
+ if (message == NULL) {
+ debug ("ConsoleKit: Couldn't allocate the D-Bus message");
+ return;
+ }
+
+ dbus_message_iter_init_append (message, &iter);
+ dbus_message_iter_append_basic (&iter,
+ DBUS_TYPE_STRING,
+ &cookie);
+
+ reply = dbus_connection_send_with_reply_and_block (private_connection,
+ message,
+ -1, &error);
+ if (dbus_error_is_set (&error)) {
+ debug ("ConsoleKit: %s raised:\n %s\n\n", error.name, error.message);
+ reply = NULL;
+ }
+
+ dbus_connection_flush (private_connection);
+
+ dbus_message_unref (message);
+ dbus_error_free (&error);
+
+ dbus_connection_close (private_connection);
+ private_connection = NULL;
+}
diff -Nur kdebase-3.91.0/workspace/kdm/backend/consolekit.h kdebase-3.91.0-consolekit/workspace/kdm/backend/consolekit.h
--- kdebase-3.91.0/workspace/kdm/backend/consolekit.h 1970-01-01 01:00:00.000000000 +0100
+++ kdebase-3.91.0-consolekit/workspace/kdm/backend/consolekit.h 2007-07-04 06:27:27.000000000 +0200
@@ -0,0 +1,36 @@
+/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*-
+ *
+ * Copyright (C) 2006 William Jon McCann <mccann at jhu.edu>
+ * Copyright (C) 2007 Kevin Kofler <Kevin at tigcc.ticalc.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.
+ *
+ */
+
+
+#ifndef __CONSOLE_KIT_H
+#define __CONSOLE_KIT_H
+
+#include <pwd.h>
+
+struct display;
+
+char * open_ck_session (struct passwd *pwent,
+ struct display *display);
+void close_ck_session (const char *cookie);
+void unlock_ck_session (const char *user,
+ const char *x11_display);
+
+#endif /* __CONSOLE_KIT_H */
diff -Nur kdebase-3.91.0/workspace/kdm/backend/dm.h kdebase-3.91.0-consolekit/workspace/kdm/backend/dm.h
--- kdebase-3.91.0/workspace/kdm/backend/dm.h 2007-06-27 12:46:04.000000000 +0200
+++ kdebase-3.91.0-consolekit/workspace/kdm/backend/dm.h 2007-07-04 07:33:41.000000000 +0200
@@ -37,6 +37,8 @@
#ifndef _DM_H_
#define _DM_H_ 1
+#define WITH_CONSOLE_KIT
+
#include "greet.h"
#include <config.ci>
@@ -473,7 +475,11 @@
#define GCONV_BINARY 5
typedef char *(*GConvFunc)( int what, const char *prompt );
int verify( GConvFunc gconv, int rootok );
+#ifdef WITH_CONSOLE_KIT
+int startClient( volatile int *pid, const char *ck_session_cookie );
+#else
int startClient( volatile int *pid );
+#endif
void sessionExit( int status ) ATTR_NORETURN;
int readDmrc( void );
extern char **userEnviron, **systemEnviron;
diff -Nur kdebase-3.91.0/workspace/kdm/backend/Imakefile kdebase-3.91.0-consolekit/workspace/kdm/backend/Imakefile
--- kdebase-3.91.0/workspace/kdm/backend/Imakefile 2006-10-26 04:12:38.000000000 +0200
+++ kdebase-3.91.0-consolekit/workspace/kdm/backend/Imakefile 2007-07-04 06:27:27.000000000 +0200
@@ -155,13 +155,13 @@
netaddr.c reset.c resource.c protodpy.c policy.c \
session.c socket.c streams.c util.c xdmcp.c \
process.c mitauth.c \
- genauth.c access.c choose.c \
+ genauth.c access.c choose.c consolekit.c \
$(XDMAUTHSRCS) $(RPCSRCS) $(KRB5SRCS)
COMMOBJS = auth.o daemon.o server.o dpylist.o dm.o error.o \
netaddr.o reset.o resource.o protodpy.o policy.o \
session.o socket.o streams.o util.o xdmcp.o \
process.o mitauth.o \
- genauth.o access.o choose.o \
+ genauth.o access.o choose.o consolekit.o \
$(XDMAUTHOBJS) $(RPCOBJS) $(KRB5OBJS)
SRCS1 = $(COMMSRCS) client.c
diff -Nur kdebase-3.91.0/workspace/kdm/backend/session.c kdebase-3.91.0-consolekit/workspace/kdm/backend/session.c
--- kdebase-3.91.0/workspace/kdm/backend/session.c 2007-06-27 12:46:04.000000000 +0200
+++ kdebase-3.91.0-consolekit/workspace/kdm/backend/session.c 2007-07-04 07:38:07.000000000 +0200
@@ -45,6 +45,10 @@
#include <ctype.h>
#include <signal.h>
+#ifdef WITH_CONSOLE_KIT
+#include "consolekit.h"
+#endif
+
struct display *td;
const char *td_setup = "auto";
@@ -522,6 +526,9 @@
int ex, cmd;
volatile int clientPid = -1;
volatile time_t tdiff;
+#ifdef WITH_CONSOLE_KIT
+ char *ck_session_cookie;
+#endif
td = d;
debug( "manageSession %s\n", d->name );
@@ -617,7 +624,12 @@
if (td_setup)
setupDisplay( td_setup );
+#ifdef WITH_CONSOLE_KIT
+ ck_session_cookie = open_ck_session (getpwnam(curuser), d);
+ if (!startClient( &clientPid, ck_session_cookie )) {
+#else
if (!startClient( &clientPid )) {
+#endif
logError( "Client start failed\n" );
sessionExit( EX_NORMAL ); /* XXX maybe EX_REMANAGE_DPY? -- enable in dm.c! */
}
@@ -639,6 +651,14 @@
catchTerm( SIGTERM );
}
}
+
+#ifdef WITH_CONSOLE_KIT
+ if (ck_session_cookie != NULL) {
+ close_ck_session (ck_session_cookie);
+ free (ck_session_cookie);
+ }
+#endif
+
/*
* Sometimes the Xsession somehow manages to exit before
* a server crash is noticed - so we sleep a bit and wait
kdebase-3.92.0-redhat-startkde.patch:
--- NEW FILE kdebase-3.92.0-redhat-startkde.patch ---
--- kdebase-3.92.0/workspace/startkde.redhat-startkde 2007-07-30 15:15:29.000000000 -0500
+++ kdebase-3.92.0/workspace/startkde 2007-07-30 15:19:03.000000000 -0500
@@ -2,6 +2,53 @@
#
# DEFAULT KDE STARTUP SCRIPT ( KDE-3.91 )
#
+# Modified for Red Hat Linux
+
+unset BLOCK_SIZE # breaks parsing of df output
+shopt -u -o noclobber # allow overwriting of files with '>'
+
+# set up user environment if not present
+# check for space on /tmp and "$HOME" and for write access
+# error exit, if not
+space_tmp=`LANG=C df /tmp | xargs | cut -d" " -f11`
+homedir_mount=`LANG=C df "$HOME" | xargs | cut -d" " -f8`
+
+if [ "$homedir_mount" = "AFS" -a -x "`which fs 2>/dev/null`" ] ; then
+ # check for AFS
+ space_home=`LANG=C fs df "$HOME" | xargs | cut -d" " -f10`
+else
+ # check regular mounts
+ space_home=`LANG=C df "$HOME" | xargs | cut -d" " -f11`
+fi
+
+if [ $space_tmp -lt 50 ]; then
+ echo $"Not enough free disk space on /tmp"
+ exit 1
+fi
+
+if [ $space_home -lt 25 ]; then
+ echo $"Not enough free disk space on "$HOME""
+ exit 1
+fi
+testfile_tmp=`mktemp /tmp/KDE.startkde.XXXXXX`
+testfile_home=`mktemp "$HOME"/KDE.startkde.XXXXXX`
+
+if ! echo TEST_TEXT >$testfile_tmp 2>/dev/null ; then
+ echo $"You don't have write permissions for /tmp"
+ exit 1
+fi
+rm -f $testfile_tmp
+
+if ! echo TEST_TEXT >$testfile_home 2>/dev/null ; then
+ echo $"You don't have write permissions for "$HOME""
+ exit 1
+fi
+rm -f $testfile_home
+
+[ -d "$HOME"/.kde/share/config ] || mkdir -p "$HOME"/.kde/share/config
+if [ ! -e "$HOME"/.kde/share/config/emaildefaults ]; then
+ /usr/bin/mailsettings >"$HOME"/.kde/share/config/emaildefaults
+fi
# When the X server dies we get a HUP signal from xinit. We must ignore it
# because we still need to do some cleanup.
@@ -14,12 +61,12 @@ if kcheckrunning >/dev/null 2>&1; then
exit 1
fi
-# Set the background to plain grey.
+# Set the background to the Red Hat default
# The standard X background is nasty, causing moire effects and exploding
# people's heads. We use colours from the standard KDE palette for those with
# palettised displays.
if test -z "$XDM_MANAGED" || echo "$XDM_MANAGED" | grep ",auto" > /dev/null; then
- xsetroot -solid "#000000"
+ xsetroot -solid "#5477A0"
fi
# we have to unset this for Darwin since it will screw up KDE's dynamic-loading
@@ -180,9 +227,10 @@ fi
# better use the Autostart folder.
exepath=`kde4-config --path exe | tr : '\n'`
+envpath=/etc/kde/env/
-for prefix in `echo "$exepath" | sed -n -e 's,/bin[^/]*/,/env/,p'`; do
- for file in "$prefix"*.sh; do
+for prefix in `echo "$exepath" | sed -n -e 's,/bin[^/]*/,/env/,p'` $envpath ; do
+ for file in "$prefix"*.sh ; do
test -r "$file" && . "$file"
done
done
@@ -369,7 +417,8 @@ kdeinit4_shutdown
echo 'startkde: Running shutdown scripts...' 1>&2
# Run scripts found in $KDE4DIRS/shutdown
-for prefix in `echo "$exepath" | sed -n -e 's,/bin[^/]*/,/shutdown/,p'`; do
+shutdownpath=/etc/kde/shutdown/
+for prefix in `echo "$exepath" | sed -n -e 's,/bin[^/]*/,/shutdown/,p'` $shutdownpath; do
for file in `ls "$prefix" 2> /dev/null | egrep -v '(~|\.bak)$'`; do
test -x "$prefix$file" && "$prefix$file"
done
Index: kdebase.spec
===================================================================
RCS file: /cvs/pkgs/rpms/kdebase/devel/kdebase.spec,v
retrieving revision 1.263.2.11
retrieving revision 1.263.2.12
diff -u -r1.263.2.11 -r1.263.2.12
--- kdebase.spec 30 Jul 2007 12:26:07 -0000 1.263.2.11
+++ kdebase.spec 30 Jul 2007 20:21:50 -0000 1.263.2.12
@@ -1,7 +1,7 @@
Summary: K Desktop Environment 4 - Core Files
Version: 3.92.0
-Release: 1%{?dist}
+Release: 2%{?dist}
%if 0%{?fedora} > 7
Name: kdebase
@@ -37,7 +37,9 @@
# use ~/.kde4 instead of ~/.kde
Patch0: kdebase-%{version}-kde4home.diff
-Patch1: kdebase-3.91.0-redhat-startkde.patch
+Patch1: kdebase-%{version}-redhat-startkde.patch
+# see http://bugzilla.redhat.com/228111 , http://bugs.kde.org/147790
+Patch2: kdebase-3.91.0-consolekit-kdm.patch
Requires(post): /sbin/ldconfig xdg-utils
Requires(postun): /sbin/ldconfig xdg-utils
@@ -55,6 +57,7 @@
BuildRequires: bzip2-devel
BuildRequires: cdparanoia-devel cdparanoia
BuildRequires: cmake
+BuildRequires: ConsoleKit-devel
BuildRequires: cyrus-sasl-devel
BuildRequires: doxygen
BuildRequires: imake
@@ -129,6 +132,8 @@
%patch0 -p1 -b .kde4home
%endif
%patch1 -p1 -b .redhat-startkde
+%patch2 -p1 -b .consolekit_kdm
+
%build
@@ -249,6 +254,10 @@
%changelog
+* Mon Jul 30 2007 Rex Dieter <rdieter[AT]fedoraproject.org> 3.92.0-2
+- consolekit_kdm patch (#228111, kde#147790)
+- update startkde patch
+
* Sat Jul 28 2007 Rex Dieter <rdieter[AT]fedoraproject.org> 3.92.0-1
- kde-3.92 (kde-4-beta1)
--- kdebase-3.91.0-redhat-startkde.patch DELETED ---
- Previous message: rpms/firstboot/devel firstboot.spec, 1.104, 1.105 sources, 1.101, 1.102
- Next message: rpms/NetworkManager/OLPC-2 .cvsignore, 1.52, 1.53 NetworkManager.spec, 1.161, 1.162 sources, 1.70, 1.71
- Messages sorted by:
[ date ]
[ thread ]
[ subject ]
[ author ]
More information about the scm-commits
mailing list