694126
--- gdm-2.19.1/gui/greeter/greeter.c.reset-pam	2007-05-13 22:08:14.000000000 -0400
69b674
+++ gdm-2.19.1/gui/greeter/greeter.c	2007-05-21 19:03:19.000000000 -0400
694126
@@ -224,7 +224,6 @@ process_operation (guchar       op_code,
b1f3e7
     GtkWidget *dlg;
b1f3e7
     char *tmp;
b1f3e7
     char *session;
b1f3e7
-    GreeterItemInfo *conversation_info;
b1f3e7
     static GnomeCanvasItem *disabled_cover = NULL;
694126
     gint lookup_status = SESSION_LOOKUP_SUCCESS;
694126
     gchar *firstmsg = NULL;
694126
@@ -428,17 +427,10 @@ process_operation (guchar       op_code,
b1f3e7
 
b1f3e7
 	first_prompt = TRUE;
b1f3e7
 
b1f3e7
-	conversation_info = greeter_lookup_id ("pam-conversation");
b1f3e7
-	
b1f3e7
-	if (conversation_info)
b1f3e7
-	  {
b1f3e7
-	    tmp = ve_locale_to_utf8 (args);
b1f3e7
-	    g_object_set (G_OBJECT (conversation_info->item),
b1f3e7
-			  "text", tmp,
b1f3e7
-			  NULL);
b1f3e7
-	    g_free (tmp);
b1f3e7
-	  }
b1f3e7
-
b1f3e7
+        greeter_item_ulist_unset_selected_user ();
b1f3e7
+        greeter_item_pam_prompt ("", PW_ENTRY_SIZE, TRUE);
b1f3e7
+        greeter_item_pam_message ("");
b1f3e7
+ 
b1f3e7
 	printf ("%c\n", STX);
b1f3e7
 	fflush (stdout);
b1f3e7
 	greeter_ignore_buttons (FALSE);
694126
--- gdm-2.19.1/daemon/slave.c.reset-pam	2007-05-13 22:08:25.000000000 -0400
69b674
+++ gdm-2.19.1/daemon/slave.c	2007-05-21 19:08:16.000000000 -0400
694126
@@ -146,6 +146,12 @@ static int gdm_normal_runlevel         =
694126
 static pid_t extra_process             = 0;
694126
 static int extra_status                = 0;
b1f3e7
 
b1f3e7
+/* a dup of the other side of greeter_fd_in so that
b1f3e7
+ * the slave can talk to itself from its sig handler
b1f3e7
+ * using the greeter ipc mechanism
b1f3e7
+ */
b1f3e7
+static int slave_fd_out = -1;
b1f3e7
+
b1f3e7
 #ifdef HAVE_TSOL
b1f3e7
 static gboolean have_suntsol_extension = FALSE;
b1f3e7
 #endif
694126
@@ -632,7 +638,7 @@ ignore_xerror_handler (Display *disp, XE
b1f3e7
 }
b1f3e7
 
b1f3e7
 static void
b1f3e7
-whack_greeter_fds (void)
b1f3e7
+whack_greeter_and_slave_fds (void)
b1f3e7
 {
b1f3e7
 	if (greeter_fd_out > 0)
b1f3e7
 		VE_IGNORE_EINTR (close (greeter_fd_out));
694126
@@ -640,6 +646,9 @@ whack_greeter_fds (void)
b1f3e7
 	if (greeter_fd_in > 0)
b1f3e7
 		VE_IGNORE_EINTR (close (greeter_fd_in));
b1f3e7
 	greeter_fd_in = -1;
b1f3e7
+	if (slave_fd_out > 0)
b1f3e7
+		VE_IGNORE_EINTR (close (slave_fd_out));
b1f3e7
+	slave_fd_out = -1;
b1f3e7
 }
b1f3e7
 
b1f3e7
 static void
694126
@@ -1102,7 +1111,7 @@ gdm_slave_whack_greeter (void)
b1f3e7
 
b1f3e7
 	d->greetpid = 0;
b1f3e7
 
b1f3e7
-	whack_greeter_fds ();
b1f3e7
+	whack_greeter_and_slave_fds ();
b1f3e7
 
b1f3e7
 	gdm_slave_send_num (GDM_SOP_GREETPID, 0);
b1f3e7
 
694126
@@ -1936,7 +1945,7 @@ restart_the_greeter (void)
b1f3e7
 
b1f3e7
 		d->greetpid = 0;
b1f3e7
 
b1f3e7
-		whack_greeter_fds ();
b1f3e7
+		whack_greeter_and_slave_fds ();
b1f3e7
 
b1f3e7
 		gdm_slave_send_num (GDM_SOP_GREETPID, 0);
b1f3e7
 	}
694126
@@ -2177,6 +2186,12 @@ gdm_slave_wait_for_login (void)
b1f3e7
 			break;
b1f3e7
 		}
b1f3e7
 
b1f3e7
+		if (do_cancel) {
b1f3e7
+			gdm_debug ("canceling...");
b1f3e7
+			gdm_slave_greeter_ctl_no_ret (GDM_RESETOK, "");
b1f3e7
+			continue;
b1f3e7
+		}
b1f3e7
+
b1f3e7
 		if (login == NULL) {
694126
 			const char *failuresound = gdm_daemon_config_get_value_string (GDM_KEY_SOUND_ON_LOGIN_FAILURE_FILE);
b1f3e7
 
694126
@@ -2780,10 +2795,10 @@ gdm_slave_greeter (void)
b1f3e7
 
694126
 	default:
694126
 		VE_IGNORE_EINTR (close (pipe1[0]));
694126
-		VE_IGNORE_EINTR (close (pipe2[1]));
b1f3e7
 
694126
-		whack_greeter_fds ();
694126
+		whack_greeter_and_slave_fds ();
b1f3e7
 
694126
+		slave_fd_out = pipe2[1];
694126
 		greeter_fd_out = pipe1[1];
694126
 		greeter_fd_in = pipe2[0];
b1f3e7
 
694126
@@ -4740,7 +4755,7 @@ gdm_slave_child_handler (int sig)
b1f3e7
 
694126
 				greet = FALSE;
694126
 				d->greetpid = 0;
694126
-				whack_greeter_fds ();
694126
+				whack_greeter_and_slave_fds ();
694126
 				gdm_slave_send_num (GDM_SOP_GREETPID, 0);
b1f3e7
 
694126
 				do_restart_greeter = TRUE;
69b674
@@ -4752,7 +4767,7 @@ gdm_slave_child_handler (int sig)
69b674
 				continue;
69b674
 			}
69b674
 
69b674
-			whack_greeter_fds ();
69b674
+			whack_greeter_and_slave_fds ();
69b674
 
69b674
 			/* if greet is TRUE, then the greeter died outside of our
69b674
 			 * control really, so clean up and die, something is wrong
694126
@@ -4895,6 +4910,11 @@ gdm_slave_handle_usr2_message (void)
b1f3e7
 				gdm_wait_for_go = FALSE;
b1f3e7
 			} else if (strcmp (&s[1], GDM_NOTIFY_TWIDDLE_POINTER) == 0) {
b1f3e7
 				gdm_twiddle_pointer (d);
b1f3e7
+			} else if (strcmp (&s[1], GDM_NOTIFY_RESET) == 0) {
b1f3e7
+				if (!d->logged_in) {
b1f3e7
+					gdm_fdprintf (slave_fd_out, "%c%c%c\n", 
b1f3e7
+						      STX, BEL, GDM_INTERRUPT_CANCEL);
b1f3e7
+				}
b1f3e7
 			}
b1f3e7
 		} else if (s[0] == GDM_SLAVE_NOTIFY_RESPONSE) {
b1f3e7
 			gdm_got_ack = TRUE;
69b674
--- gdm-2.19.1/daemon/gdm-daemon-config-keys.h.reset-pam	2007-05-13 22:08:24.000000000 -0400
69b674
+++ gdm-2.19.1/daemon/gdm-daemon-config-keys.h	2007-05-21 19:03:19.000000000 -0400
694126
@@ -226,6 +226,7 @@ G_BEGIN_DECLS
b1f3e7
 #define GDM_NOTIFY_SOFT_RESTART_SERVERS "SOFT_RESTART_SERVERS"
b1f3e7
 #define GDM_NOTIFY_GO "GO"
b1f3e7
 #define GDM_NOTIFY_TWIDDLE_POINTER "TWIDDLE_POINTER"
b1f3e7
+#define GDM_NOTIFY_RESET "RESET"
b1f3e7
 
694126
 G_END_DECLS
694126
 
694126
--- gdm-2.19.1/daemon/gdm.c.reset-pam	2007-05-13 22:08:24.000000000 -0400
69b674
+++ gdm-2.19.1/daemon/gdm.c	2007-05-21 19:03:19.000000000 -0400
694126
@@ -2585,6 +2585,14 @@ gdm_handle_message (GdmConnection *conn,
b1f3e7
 				     TRUE /* handled */,
b1f3e7
 				     FALSE /* chooser */,
b1f3e7
 				     NULL, 0, NULL, NULL, NULL);
694126
+} else if (strcmp (msg, GDM_SOP_CANCEL_LOGIN_REQUESTS) == 0) {
a61189
+		GSList *li, *displays = gdm_daemon_config_get_display_list ();
694126
+		for (li = displays; li != NULL; li = li->next) {
694126
+			GdmDisplay *d = li->data;
694126
+			if (!d->logged_in) {
694126
+				send_slave_command (d, GDM_NOTIFY_RESET);
694126
+			}
694126
+		}
694126
 	} else if (strncmp (msg, "opcode="GDM_SOP_SHOW_ERROR_DIALOG,
694126
 			    strlen ("opcode="GDM_SOP_SHOW_ERROR_DIALOG)) == 0) {
b1f3e7
 		GdmDisplay *d;
69b674
--- gdm-2.19.1/daemon/gdm-socket-protocol.h.reset-pam	2007-05-13 22:08:24.000000000 -0400
69b674
+++ gdm-2.19.1/daemon/gdm-socket-protocol.h	2007-05-21 19:03:19.000000000 -0400
694126
@@ -155,6 +155,9 @@
694126
 #define GDM_SOP_SHOW_QUESTION_DIALOG "SHOW_QUESTION_DIALOG"  /* show the question dialog from daemon */
694126
 #define GDM_SOP_SHOW_ASKBUTTONS_DIALOG "SHOW_ASKBUTTON_DIALOG"  /* show the askbutton dialog from daemon */
694126
 
694126
+/* Reset any in progress authentication conversations */
694126
+#define GDM_SOP_CANCEL_LOGIN_REQUESTS "CANCEL_LOGIN_REQUESTS" /* no arguments */
694126
+
694126
 
694126
 /* Ack for a slave message */
694126
 /* Note that an extra response can follow an 'ack' */