Login
[x]
Log in using an account from:
Fedora Account System
Red Hat Associate
Red Hat Customer
Or login using a Red Hat Bugzilla account
Forgot Password
Login:
Hide Forgot
Create an Account
Red Hat Bugzilla – Attachment 153524 Details for
Bug 228111
kdm needs to use ConsoleKit
[?]
New
Simple Search
Advanced Search
My Links
Browse
Requests
Reports
Current State
Search
Tabular reports
Graphical reports
Duplicates
Other Reports
User Changes
Plotly Reports
Bug Status
Bug Severity
Non-Defaults
|
Product Dashboard
Help
Page Help!
Bug Writing Guidelines
What's new
Browser Support Policy
5.0.4.rh83 Release notes
FAQ
Guides index
User guide
Web Services
Contact
Legal
This site requires JavaScript to be enabled to function correctly, please enable it.
[patch]
Diff between GDM ConsoleKit code and my KDM one
consolekit.c.diff (text/plain), 9.36 KB, created by
Kevin Kofler
on 2007-04-26 15:43:32 UTC
(
hide
)
Description:
Diff between GDM ConsoleKit code and my KDM one
Filename:
MIME Type:
Creator:
Kevin Kofler
Created:
2007-04-26 15:43:32 UTC
Size:
9.36 KB
patch
obsolete
>--- gdmconsolekit.c 2007-04-17 19:44:38.000000000 +0200 >+++ kdebase-3.5.6-consolekit/kdm/backend/consolekit.c 2007-04-18 00:34:42.000000000 +0200 >@@ -1,6 +1,7 @@ > /* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- > * > * Copyright (C) 2006-2007 William Jon McCann <mccann@jhu.edu> >+ * Copyright (C) 2007 Kevin Kofler <Kevin@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 >@@ -18,20 +19,18 @@ > * > */ > >-#include "config.h" >+#include "dm.h" >+#include "dm_auth.h" >+#include "dm_error.h" > > #include <stdlib.h> > #include <string.h> > #include <pwd.h> > >-#include <glib.h> >- > #define DBUS_API_SUBJECT_TO_CHANGE > #include <dbus/dbus.h> >-#include <dbus/dbus-glib-lowlevel.h> > >-#include "gdm-log.h" /* for gdm_debug */ >-#include "gdmconsolekit.h" >+#include "consolekit.h" > > > #define CK_NAME "org.freedesktop.ConsoleKit" >@@ -78,7 +77,7 @@ > static void > add_param_boolean (DBusMessageIter *iter_struct, > const char *key, >- gboolean value) >+ int value) > { > DBusMessageIter iter_struct_entry; > DBusMessageIter iter_var; >@@ -139,7 +138,7 @@ > dbus_message_iter_close_container (iter_struct, &iter_struct_entry); > } > >-static gboolean >+static int > session_get_x11_display (DBusConnection *connection, > const char *ssid, > char **str) >@@ -159,7 +158,7 @@ > CK_SESSION_INTERFACE, > "GetX11Display"); > if (message == NULL) { >- gdm_debug ("ConsoleKit: Couldn't allocate the D-Bus message"); >+ Debug ("ConsoleKit: Couldn't allocate the D-Bus message"); > return FALSE; > } > >@@ -168,7 +167,7 @@ > message, > -1, &error); > if (dbus_error_is_set (&error)) { >- gdm_debug ("ConsoleKit: %s raised:\n %s\n\n", error.name, error.message); >+ Debug ("ConsoleKit: %s raised:\n %s\n\n", error.name, error.message); > reply = NULL; > } > >@@ -182,14 +181,14 @@ > dbus_message_iter_init (reply, &iter); > dbus_message_iter_get_basic (&iter, &value); > if (str != NULL) { >- *str = g_strdup (value); >+ *str = strdup (value); > } > dbus_message_unref (reply); > > return TRUE; > } > >-static gboolean >+static int > session_unlock (DBusConnection *connection, > const char *ssid) > { >@@ -197,13 +196,13 @@ > DBusMessage *message; > DBusMessage *reply; > >- gdm_debug ("ConsoleKit: Unlocking session %s", ssid); >+ Debug ("ConsoleKit: Unlocking session %s", ssid); > message = dbus_message_new_method_call (CK_NAME, > ssid, > CK_SESSION_INTERFACE, > "Unlock"); > if (message == NULL) { >- gdm_debug ("ConsoleKit: Couldn't allocate the D-Bus message"); >+ Debug ("ConsoleKit: Couldn't allocate the D-Bus message"); > return FALSE; > } > >@@ -216,7 +215,7 @@ > dbus_connection_flush (connection); > > if (dbus_error_is_set (&error)) { >- gdm_debug ("ConsoleKit: %s raised:\n %s\n\n", error.name, error.message); >+ Debug ("ConsoleKit: %s raised:\n %s\n\n", error.name, error.message); > return FALSE; > } > >@@ -271,7 +270,7 @@ > return buffer; > > oom: >- g_warning ("%s %d : error allocating memory\n", __FILE__, __LINE__); >+ LogWarn ("%s %d : error allocating memory\n", __FILE__, __LINE__); > return NULL; > > } >@@ -302,7 +301,7 @@ > CK_MANAGER_INTERFACE, > "GetSessionsForUser"); > if (message == NULL) { >- gdm_debug ("ConsoleKit: Couldn't allocate the D-Bus message"); >+ Debug ("ConsoleKit: Couldn't allocate the D-Bus message"); > goto out; > } > >@@ -318,18 +317,18 @@ > dbus_connection_flush (connection); > > if (dbus_error_is_set (&error)) { >- gdm_debug ("ConsoleKit: %s raised:\n %s\n\n", error.name, error.message); >+ Debug ("ConsoleKit: %s raised:\n %s\n\n", error.name, error.message); > goto out; > } > > if (reply == NULL) { >- gdm_debug ("ConsoleKit: No reply for GetSessionsForUser"); >+ 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) { >- gdm_debug ("ConsoleKit: Wrong reply for GetSessionsForUser - expecting an array."); >+ Debug ("ConsoleKit: Wrong reply for GetSessionsForUser - expecting an array."); > goto out; > } > >@@ -356,19 +355,19 @@ > char **sessions; > int i; > >- gdm_debug ("ConsoleKit: Unlocking session for %s on %s", user, x11_display); >+ 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) { >- gdm_debug ("ConsoleKit: Failed to connect to the D-Bus daemon: %s", error.message); >+ 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) { >- gdm_debug ("ConsoleKit: no sessions found"); >+ Debug ("ConsoleKit: no sessions found"); > return; > } > >@@ -378,29 +377,28 @@ > > ssid = sessions[i]; > session_get_x11_display (connection, ssid, &xdisplay); >- gdm_debug ("ConsoleKit: session %s has DISPLAY %s", ssid, xdisplay); >+ Debug ("ConsoleKit: session %s has DISPLAY %s", ssid, xdisplay); > > if (xdisplay != NULL > && x11_display != NULL > && strcmp (xdisplay, x11_display) == 0) { >- gboolean res; >+ int res; > > res = session_unlock (connection, ssid); > if (! res) { >- gdm_error ("ConsoleKit: Unable to unlock %s", ssid); >+ LogError ("ConsoleKit: Unable to unlock %s", ssid); > } > } > >- g_free (xdisplay); >+ free (xdisplay); > } > >- g_strfreev (sessions); >+ freeStrArr (sessions); > } > > char * > open_ck_session (struct passwd *pwent, >- GdmDisplay *d, >- const char *session) >+ struct display *d) > { > DBusConnection *connection; > DBusError error; >@@ -412,20 +410,33 @@ > > cookie = NULL; > >- gdm_debug ("ConsoleKit: Opening session for %s", pwent->pw_name); >+ 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) { >- gdm_debug ("ConsoleKit: Failed to connect to the D-Bus daemon: %s", error.message); >+ 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); >- dbus_connection_setup_with_g_main (connection, NULL); >+ /* FIXME: What to do about these? >+ dbus_connection_set_watch_functions( connection, >+ dbusAddWatch, >+ dbusRemoveWatch, >+ dbusToggleWatch, >+ data, 0 ); >+ dbus_connection_set_timeout_functions( connection, >+ dbusAddTimeout, >+ dbusRemoveTimeout, >+ dbusToggleTimeout, >+ data, 0 ); >+ dbus_connection_set_wakeup_main_function( connection, >+ dbusWakeupMain, >+ data, 0 ); */ > > dbus_error_init (&error); > message = dbus_message_new_method_call (CK_NAME, >@@ -433,7 +444,7 @@ > CK_MANAGER_INTERFACE, > "OpenSessionWithParameters"); > if (message == NULL) { >- gdm_debug ("ConsoleKit: Couldn't allocate the D-Bus message"); >+ Debug ("ConsoleKit: Couldn't allocate the D-Bus message"); > return NULL; > } > >@@ -448,19 +459,22 @@ > > 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->attached); >- if (! d->attached) { >- add_param_string (&iter_struct, "remote-host-name", d->hostname); >- } >- >- if (d->vt > 0) { >- char *device; >+ 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 */ >- device = g_strdup_printf ("/dev/tty%d", d->vt); >+ sprintf(device, "/dev/tty%d", d->serverVT); > add_param_string (&iter_struct, "x11-display-device", device); >- g_free (device); > } >+#endif > > dbus_message_iter_close_container (&iter, &iter_struct); > >@@ -468,7 +482,7 @@ > message, > -1, &error); > if (dbus_error_is_set (&error)) { >- gdm_debug ("ConsoleKit: %s raised:\n %s\n\n", error.name, error.message); >+ Debug ("ConsoleKit: %s raised:\n %s\n\n", error.name, error.message); > reply = NULL; > } > >@@ -482,7 +496,7 @@ > > dbus_message_iter_init (reply, &iter); > dbus_message_iter_get_basic (&iter, &value); >- cookie = g_strdup (value); >+ cookie = strdup (value); > dbus_message_unref (reply); > } > >@@ -511,7 +525,7 @@ > CK_MANAGER_INTERFACE, > "CloseSession"); > if (message == NULL) { >- gdm_debug ("ConsoleKit: Couldn't allocate the D-Bus message"); >+ Debug ("ConsoleKit: Couldn't allocate the D-Bus message"); > return; > } > >@@ -524,7 +538,7 @@ > message, > -1, &error); > if (dbus_error_is_set (&error)) { >- gdm_debug ("ConsoleKit: %s raised:\n %s\n\n", error.name, error.message); >+ Debug ("ConsoleKit: %s raised:\n %s\n\n", error.name, error.message); > reply = NULL; > } >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 228111
:
152864
|
152865
| 153524 |
153710
|
158502
|
158925
|
158937