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