GNOME #631465

Index: gnome-keyring-2.30.3/daemon/gkd-main.c
===================================================================
--- gnome-keyring-2.30.3.orig/daemon/gkd-main.c	2010-10-05 21:59:31.531925308 +0200
+++ gnome-keyring-2.30.3/daemon/gkd-main.c	2010-10-05 22:49:54.635458931 +0200
@@ -82,6 +82,8 @@
 #define DEFAULT_COMPONENTS  "pkcs11,secrets"
 #endif
 
+#define LOGIN_TIMEOUT 10
+
 static gchar* run_components = DEFAULT_COMPONENTS;
 static gboolean pkcs11_started = FALSE;
 static gboolean secrets_started = FALSE;
@@ -92,6 +94,7 @@ static gboolean run_daemonized = FALSE;
 static gboolean run_for_login = FALSE;
 static gboolean run_for_start = FALSE;
 static gchar* login_password = NULL;
+static guint timeout_id = 0;
 static const gchar* control_directory = NULL;
 static gboolean initialization_completed = FALSE;
 static gboolean sig_thread_valid = FALSE;
@@ -629,6 +632,8 @@ gkr_daemon_initialize_steps (const gchar
 
 	if (!initialization_completed) {
 		initialization_completed = TRUE;
+		if (timeout_id)
+			g_source_remove (timeout_id);
 
 		/* Initialize new style PKCS#11 components */
 		if (!gkd_pkcs11_initialize ())
@@ -690,6 +695,14 @@ gkd_main_complete_initialization (const
 	gkr_daemon_initialize_steps (components);
 }
 
+static gboolean
+on_login_timeout (gpointer data)
+{
+	if (!initialization_completed)
+		cleanup_and_exit (0);
+	return FALSE;
+}
+
 int
 main (int argc, char *argv[])
 {
@@ -772,6 +785,7 @@ main (int argc, char *argv[])
 	if (run_for_login) {
 		login_password = read_login_password (STDIN);
 		atexit (clear_login_password);
+		timeout_id = g_timeout_add_seconds (LOGIN_TIMEOUT, (GSourceFunc) on_login_timeout, NULL);
 
 	/* Not a login daemon. Startup stuff now.*/
 	} else {
