99 lines
3.3 KiB
Diff
99 lines
3.3 KiB
Diff
|
--- gdm-2.8.0.7/configure.ac~ 2007-01-19 14:00:55.000000000 -0500
|
||
|
+++ gdm-2.8.0.7/configure.ac 2007-01-19 14:07:11.000000000 -0500
|
||
|
@@ -141,7 +142,7 @@ PKG_CHECK_MODULES(VICIOUS, gtk+-2.0 >= $
|
||
|
AC_SUBST(VICIOUS_CFLAGS)
|
||
|
AC_SUBST(VICIOUS_LIBS)
|
||
|
|
||
|
-PKG_CHECK_MODULES(DAEMON, gtk+-2.0 >= $GTK_REQUIRED)
|
||
|
+PKG_CHECK_MODULES(DAEMON, gtk+-2.0 >= $GTK_REQUIRED dbus-glib-1 >= $DBUS_REQUIRED)
|
||
|
AC_SUBST(DAEMON_CFLAGS)
|
||
|
AC_SUBST(DAEMON_LIBS)
|
||
|
|
||
|
--- gdm-2.8.0.7/daemon/gdm.c~ 2007-01-19 14:00:55.000000000 -0500
|
||
|
+++ gdm-2.8.0.7/daemon/gdm.c 2007-01-19 14:14:12.000000000 -0500
|
||
|
@@ -42,6 +42,9 @@
|
||
|
#include <syslog.h>
|
||
|
#include <locale.h>
|
||
|
|
||
|
+#define DBUS_API_SUBJECT_TO_CHANGE
|
||
|
+#include <dbus/dbus-glib.h>
|
||
|
+
|
||
|
/* This should be moved to auth.c I suppose */
|
||
|
|
||
|
#include <X11/Xauth.h>
|
||
|
@@ -70,6 +73,10 @@
|
||
|
#include <libdevinfo.h>
|
||
|
#endif /* HAVE_LOGINDEVPERM */
|
||
|
|
||
|
+#define MONITOR_SERVICE "com.novell.Pkcs11Monitor"
|
||
|
+#define MONITOR_PATH "/com/novell/Pkcs11Monitor"
|
||
|
+#define MONITOR_INTERFACE "com.novell.Pkcs11Monitor"
|
||
|
+
|
||
|
/* Local functions */
|
||
|
static void gdm_config_parse (void);
|
||
|
static void gdm_handle_message (GdmConnection *conn,
|
||
|
@@ -78,6 +85,8 @@ static void gdm_handle_message (GdmConne
|
||
|
static void gdm_handle_user_message (GdmConnection *conn,
|
||
|
const char *msg,
|
||
|
gpointer data);
|
||
|
+static void gdm_reset_local_displays (void);
|
||
|
+static void gdm_watch_for_security_tokens (void);
|
||
|
static void gdm_daemonify (void);
|
||
|
static void gdm_safe_restart (void);
|
||
|
static void gdm_try_logout_action (GdmDisplay *disp);
|
||
|
--- gdm-2.19.3/daemon/gdm.c~ 2007-07-25 14:52:56.000000000 -0400
|
||
|
+++ gdm-2.19.3/daemon/gdm.c 2007-07-25 14:56:18.000000000 -0400
|
||
|
@@ -1800,6 +1800,8 @@ main (int argc, char *argv[])
|
||
|
gdm_xdmcp_run ();
|
||
|
}
|
||
|
|
||
|
+ gdm_watch_for_security_tokens ();
|
||
|
+
|
||
|
/* We always exit via exit (), and sadly we need to g_main_quit ()
|
||
|
* at times not knowing if it's this main or a recursive one we're
|
||
|
* quitting.
|
||
|
@@ -4355,3 +4357,43 @@ gdm_handle_user_message (GdmConnection *
|
||
|
gdm_connection_close (conn);
|
||
|
}
|
||
|
}
|
||
|
+
|
||
|
+static void
|
||
|
+gdm_reset_local_displays (void)
|
||
|
+{
|
||
|
+ GSList *li;
|
||
|
+
|
||
|
+ for (li = gdm_daemon_config_get_display_list (); li != NULL; li = li->next) {
|
||
|
+ GdmDisplay *d = li->data;
|
||
|
+
|
||
|
+ if (d->attached)
|
||
|
+ send_slave_command (d, GDM_NOTIFY_RESET);
|
||
|
+ }
|
||
|
+}
|
||
|
+
|
||
|
+static void
|
||
|
+gdm_watch_for_security_tokens (void)
|
||
|
+{
|
||
|
+ DBusGConnection *conn;
|
||
|
+ GError *err = NULL;
|
||
|
+ DBusGProxy *monitor;
|
||
|
+
|
||
|
+ conn = dbus_g_bus_get (DBUS_BUS_SYSTEM, &err);
|
||
|
+ if (!conn) {
|
||
|
+ gdm_error (_("Cannot connect to dbus bus; smart card support disabled: %s"),
|
||
|
+ err->message);
|
||
|
+ g_error_free (err);
|
||
|
+ return;
|
||
|
+ }
|
||
|
+
|
||
|
+ monitor = dbus_g_proxy_new_for_name (conn,
|
||
|
+ MONITOR_SERVICE,
|
||
|
+ MONITOR_PATH,
|
||
|
+ MONITOR_INTERFACE);
|
||
|
+
|
||
|
+ dbus_g_proxy_add_signal (monitor, "SecurityTokenInserted", G_TYPE_STRING, G_TYPE_INVALID);
|
||
|
+ dbus_g_proxy_connect_signal (monitor, "SecurityTokenInserted", G_CALLBACK (gdm_reset_local_displays), NULL, NULL);
|
||
|
+
|
||
|
+ dbus_g_proxy_add_signal (monitor, "SecurityTokenRemoved", G_TYPE_STRING, G_TYPE_INVALID);
|
||
|
+ dbus_g_proxy_connect_signal (monitor, "SecurityTokenRemoved", G_CALLBACK (gdm_reset_local_displays), NULL, NULL);
|
||
|
+}
|