summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDamien Miller <djm@mindrot.org>1999-11-12 12:09:36 +1100
committerDamien Miller <djm@mindrot.org>1999-11-12 12:09:36 +1100
commitb9a692d203ddc1b229a160f51a92f8f1a562ae45 (patch)
tree4ceeacbf7e66e1100f0b453361c214b4fbccfe1e
parent322650927bec37d850a3ab72f82bda1cd49b09e4 (diff)
- Grab server in gnome-ssh-askpass (Debian bug #49872)
-rw-r--r--ChangeLog2
-rw-r--r--gnome-ssh-askpass.c24
2 files changed, 24 insertions, 2 deletions
diff --git a/ChangeLog b/ChangeLog
index a1e2cac87..0b6f494fc 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -5,6 +5,8 @@
5 IgnoreUserKnownHosts(default=no), used for RhostRSAAuth, ok 5 IgnoreUserKnownHosts(default=no), used for RhostRSAAuth, ok
6 deraadt,millert 6 deraadt,millert
7 - Brought default sshd_config more in line with OpenBSD's 7 - Brought default sshd_config more in line with OpenBSD's
8 - Grab server in gnome-ssh-askpass (Debian bug #49872)
9 - Released 1.2pre10
8 10
919991111 1119991111
10 - Added (untested) Entropy Gathering Daemon (EGD) support 12 - Added (untested) Entropy Gathering Daemon (EGD) support
diff --git a/gnome-ssh-askpass.c b/gnome-ssh-askpass.c
index 6610478c9..749560992 100644
--- a/gnome-ssh-askpass.c
+++ b/gnome-ssh-askpass.c
@@ -37,6 +37,8 @@
37#include <stdio.h> 37#include <stdio.h>
38#include <string.h> 38#include <string.h>
39#include <gnome.h> 39#include <gnome.h>
40#include <X11/Xlib.h>
41#include <gdk/gdkx.h>
40 42
41int passphrase_dialog(char **passphrase_p, char *message) 43int passphrase_dialog(char **passphrase_p, char *message)
42{ 44{
@@ -51,18 +53,36 @@ int passphrase_dialog(char **passphrase_p, char *message)
51 label = gtk_label_new(message); 53 label = gtk_label_new(message);
52 gtk_box_pack_start(GTK_BOX(GNOME_DIALOG(dialog)->vbox), label, FALSE, 54 gtk_box_pack_start(GTK_BOX(GNOME_DIALOG(dialog)->vbox), label, FALSE,
53 FALSE, 0); 55 FALSE, 0);
54 gtk_widget_show(label);
55 56
56 entry = gtk_entry_new(); 57 entry = gtk_entry_new();
57 gtk_box_pack_start(GTK_BOX(GNOME_DIALOG(dialog)->vbox), entry, FALSE, 58 gtk_box_pack_start(GTK_BOX(GNOME_DIALOG(dialog)->vbox), entry, FALSE,
58 FALSE, 0); 59 FALSE, 0);
59 gtk_entry_set_visibility(GTK_ENTRY(entry), FALSE); 60 gtk_entry_set_visibility(GTK_ENTRY(entry), FALSE);
60 gtk_widget_grab_focus(entry); 61 gtk_widget_grab_focus(entry);
61 gtk_widget_show(entry); 62
63 /* Center window and prepare for grab */
64 gtk_object_set(GTK_OBJECT(dialog), "type", GTK_WINDOW_POPUP, NULL);
65 gnome_dialog_set_default(GNOME_DIALOG(dialog), 0);
66 gtk_window_set_position (GTK_WINDOW(dialog), GTK_WIN_POS_CENTER);
67 gtk_window_set_policy(GTK_WINDOW(dialog), FALSE, FALSE, TRUE);
68 gnome_dialog_close_hides(GNOME_DIALOG(dialog), TRUE);
69 gtk_container_set_border_width(GTK_CONTAINER(GNOME_DIALOG(dialog)->vbox), GNOME_PAD);
70 gtk_widget_show_all(dialog);
71
72 /* Grab focus */
73 XGrabServer(GDK_DISPLAY());
74 gdk_pointer_grab(dialog->window, TRUE, 0, NULL, NULL, GDK_CURRENT_TIME);
75 gdk_keyboard_grab(dialog->window, FALSE, GDK_CURRENT_TIME);
62 76
63 /* Run dialog */ 77 /* Run dialog */
64 result = gnome_dialog_run(GNOME_DIALOG(dialog)); 78 result = gnome_dialog_run(GNOME_DIALOG(dialog));
65 79
80 /* Ungrab */
81 XUngrabServer(GDK_DISPLAY());
82 gdk_pointer_ungrab(GDK_CURRENT_TIME);
83 gdk_keyboard_ungrab(GDK_CURRENT_TIME);
84 gdk_flush();
85
66 passphrase = gtk_entry_get_text(GTK_ENTRY(entry)); 86 passphrase = gtk_entry_get_text(GTK_ENTRY(entry));
67 87
68 /* Take copy of passphrase if user selected OK */ 88 /* Take copy of passphrase if user selected OK */