b1f3e76
--- gdm-2.17.7/gui/greeter/greeter.c.reset-pam	2007-02-12 00:40:12.000000000 -0500
b1f3e76
+++ gdm-2.17.7/gui/greeter/greeter.c	2007-02-23 22:54:28.000000000 -0500
b1f3e76
@@ -171,7 +171,6 @@
b1f3e76
     GtkWidget *dlg;
b1f3e76
     char *tmp;
b1f3e76
     char *session;
b1f3e76
-    GreeterItemInfo *conversation_info;
b1f3e76
     static GnomeCanvasItem *disabled_cover = NULL;
b1f3e76
     gchar *language;
b1f3e76
     gchar *selected_user = NULL;
b1f3e76
@@ -380,17 +379,10 @@
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);
b1f3e76
--- gdm-2.17.7/daemon/slave.c.reset-pam	2007-02-23 22:54:28.000000000 -0500
b1f3e76
+++ gdm-2.17.7/daemon/slave.c	2007-02-23 22:54:28.000000000 -0500
b1f3e76
@@ -133,6 +133,12 @@
b1f3e76
 static int greeter_fd_out = -1;
b1f3e76
 static int greeter_fd_in = -1;
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
b1f3e76
@@ -626,7 +632,7 @@
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));
b1f3e76
@@ -634,6 +640,9 @@
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
b1f3e76
@@ -1084,7 +1093,7 @@
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
 
b1f3e76
@@ -1887,7 +1896,7 @@
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
 	}
b1f3e76
@@ -2124,6 +2133,12 @@
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) {
b1f3e76
 			char *failuresound = gdm_get_value_string (GDM_KEY_SOUND_ON_LOGIN_FAILURE_FILE);
b1f3e76
 
b1f3e76
@@ -2723,9 +2738,9 @@
b1f3e76
 	
b1f3e76
     default:
b1f3e76
 	VE_IGNORE_EINTR (close (pipe1[0]));
b1f3e76
-	VE_IGNORE_EINTR (close (pipe2[1]));
b1f3e76
+	whack_greeter_and_slave_fds ();
b1f3e76
 
b1f3e76
-	whack_greeter_fds ();
b1f3e76
+	slave_fd_out = pipe2[1];
b1f3e76
 
b1f3e76
 	greeter_fd_out = pipe1[1];
b1f3e76
 	greeter_fd_in = pipe2[0];
b1f3e76
@@ -4784,7 +4799,7 @@
b1f3e76
 
b1f3e76
 			greet = FALSE;
b1f3e76
 			d->greetpid = 0;
b1f3e76
-			whack_greeter_fds ();
b1f3e76
+			whack_greeter_and_slave_fds ();
b1f3e76
 			gdm_slave_send_num (GDM_SOP_GREETPID, 0);
b1f3e76
 
b1f3e76
 			do_restart_greeter = TRUE;
b1f3e76
@@ -4796,7 +4811,7 @@
b1f3e76
 			continue;
b1f3e76
 		}
b1f3e76
 
b1f3e76
-		whack_greeter_fds ();
b1f3e76
+		whack_greeter_and_slave_fds ();
b1f3e76
 
b1f3e76
 		/* if greet is TRUE, then the greeter died outside of our
b1f3e76
 		 * control really, so clean up and die, something is wrong
b1f3e76
@@ -4939,6 +4954,11 @@
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;
b1f3e76
--- gdm-2.17.7/daemon/gdm.h.reset-pam	2007-02-12 00:40:19.000000000 -0500
b1f3e76
+++ gdm-2.17.7/daemon/gdm.h	2007-02-23 22:54:28.000000000 -0500
b1f3e76
@@ -749,6 +749,9 @@
b1f3e76
 #define GDM_SOP_SHOW_QUESTION_DIALOG "SHOW_QUESTION_DIALOG"  /* show the question dialog from daemon */
b1f3e76
 #define GDM_SOP_SHOW_ASKBUTTONS_DIALOG "SHOW_ASKBUTTON_DIALOG"  /* show the askbutton dialog from daemon */
b1f3e76
 
b1f3e76
+/* Reset any in progress authentication conversations */
b1f3e76
+#define GDM_SOP_CANCEL_LOGIN_REQUESTS "CANCEL_LOGIN_REQUESTS" /* no arguments */
b1f3e76
+
b1f3e76
 /* Notification protocol */
b1f3e76
 /* keys */
b1f3e76
 #define GDM_NOTIFY_ALLOW_REMOTE_ROOT "AllowRemoteRoot" /* <true/false as int> */
b1f3e76
@@ -776,6 +779,7 @@
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
 
b1f3e76
 /* Ack for a slave message */
b1f3e76
 /* Note that an extra response can follow an 'ack' */
b1f3e76
--- gdm-2.17.7/daemon/gdm.c.reset-pam	2007-02-12 00:40:19.000000000 -0500
b1f3e76
+++ gdm-2.17.7/daemon/gdm.c	2007-02-23 22:55:35.000000000 -0500
b1f3e76
@@ -2557,6 +2557,14 @@
b1f3e76
 				     TRUE /* handled */,
b1f3e76
 				     FALSE /* chooser */,
b1f3e76
 				     NULL, 0, NULL, NULL, NULL);
b1f3e76
+       } else if (strcmp (msg, GDM_SOP_CANCEL_LOGIN_REQUESTS) == 0) {
b1f3e76
+               GSList *li;
b1f3e76
+               for (li = displays; li != NULL; li = li->next) {
b1f3e76
+                       GdmDisplay *d = li->data;
b1f3e76
+                       if (!d->logged_in) {
b1f3e76
+                               send_slave_command (d, GDM_NOTIFY_RESET);
b1f3e76
+                       }
b1f3e76
+               }
b1f3e76
        } else if (strncmp (msg, "opcode="GDM_SOP_SHOW_ERROR_DIALOG,
b1f3e76
 			   strlen ("opcode="GDM_SOP_SHOW_ERROR_DIALOG)) == 0) {
b1f3e76
 		GdmDisplay *d;