gdm/gdm-2.19.1-reset-pam.patch

171 lines
5.3 KiB
Diff
Raw Normal View History

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