summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog6
-rw-r--r--contrib/gnome-ssh-askpass.c19
2 files changed, 14 insertions, 11 deletions
diff --git a/ChangeLog b/ChangeLog
index 9304075ba..ccff55763 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,6 +1,6 @@
120020125 120020125
2 - (djm) Don't grab Xserver by default. x11-ssh-askpass doesn't and grabbing 2 - (djm) Don't grab Xserver or pointer by default. x11-ssh-askpass doesn't
3 can cause deadlocks with kinput2 3 and grabbing can cause deadlocks with kinput2.
4 4
520020124 520020124
6 - (stevesk) Makefile.in: bug #61; delete commented line for now. 6 - (stevesk) Makefile.in: bug #61; delete commented line for now.
@@ -7394,4 +7394,4 @@
7394 - Wrote replacements for strlcpy and mkdtemp 7394 - Wrote replacements for strlcpy and mkdtemp
7395 - Released 1.0pre1 7395 - Released 1.0pre1
7396 7396
7397$Id: ChangeLog,v 1.1795 2002/01/24 13:46:04 djm Exp $ 7397$Id: ChangeLog,v 1.1796 2002/01/24 13:59:25 djm Exp $
diff --git a/contrib/gnome-ssh-askpass.c b/contrib/gnome-ssh-askpass.c
index 949b80781..7cece5620 100644
--- a/contrib/gnome-ssh-askpass.c
+++ b/contrib/gnome-ssh-askpass.c
@@ -1,5 +1,5 @@
1/* 1/*
2 * Copyright (c) 2000-2001 Damien Miller. All rights reserved. 2 * Copyright (c) 2000-2002 Damien Miller. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions 5 * modification, are permitted provided that the following conditions
@@ -27,10 +27,11 @@
27 * environment variable SSH_ASKPASS to point to the location of 27 * environment variable SSH_ASKPASS to point to the location of
28 * gnome-ssh-askpass before calling "ssh-add < /dev/null". 28 * gnome-ssh-askpass before calling "ssh-add < /dev/null".
29 * 29 *
30 * There is only one run-time option: if you set the environment variable 30 * There is only two run-time options: if you set the environment variable
31 * "GNOME_SSH_ASKPASS_GRAB_SERVER=true" then gnome-ssh-askpass will grab 31 * "GNOME_SSH_ASKPASS_GRAB_SERVER=true" then gnome-ssh-askpass will grab
32 * the X server. This may have some benefit to security if you don't trust 32 * the X server. If you set "GNOME_SSH_ASKPASS_GRAB_POINTER=true", then the
33 * your X server. We grab the keyboard and pointer anyway. 33 * pointer will be grabbed too. These may have some benefit to security if
34 * you don't trust your X server. We grab the keyboard always.
34 */ 35 */
35 36
36/* 37/*
@@ -68,10 +69,11 @@ passphrase_dialog(char *message)
68{ 69{
69 char *passphrase; 70 char *passphrase;
70 char **messages; 71 char **messages;
71 int result, i, grab_server; 72 int result, i, grab_server, grab_pointer;
72 GtkWidget *dialog, *entry, *label; 73 GtkWidget *dialog, *entry, *label;
73 74
74 grab_server = (getenv("GNOME_SSH_ASKPASS_GRAB_SERVER") != NULL); 75 grab_server = (getenv("GNOME_SSH_ASKPASS_GRAB_SERVER") != NULL);
76 grab_pointer = (getenv("GNOME_SSH_ASKPASS_GRAB_POINTER") != NULL);
75 77
76 dialog = gnome_dialog_new("OpenSSH", GNOME_STOCK_BUTTON_OK, 78 dialog = gnome_dialog_new("OpenSSH", GNOME_STOCK_BUTTON_OK,
77 GNOME_STOCK_BUTTON_CANCEL, NULL); 79 GNOME_STOCK_BUTTON_CANCEL, NULL);
@@ -103,8 +105,8 @@ passphrase_dialog(char *message)
103 /* Grab focus */ 105 /* Grab focus */
104 if (grab_server) 106 if (grab_server)
105 XGrabServer(GDK_DISPLAY()); 107 XGrabServer(GDK_DISPLAY());
106 if (gdk_pointer_grab(dialog->window, TRUE, 0, NULL, NULL, 108 if (grab_pointer && gdk_pointer_grab(dialog->window, TRUE, 0,
107 GDK_CURRENT_TIME)) 109 NULL, NULL, GDK_CURRENT_TIME))
108 goto nograb; 110 goto nograb;
109 if (gdk_keyboard_grab(dialog->window, FALSE, GDK_CURRENT_TIME)) 111 if (gdk_keyboard_grab(dialog->window, FALSE, GDK_CURRENT_TIME))
110 goto nograbkb; 112 goto nograbkb;
@@ -118,7 +120,8 @@ passphrase_dialog(char *message)
118 /* Ungrab */ 120 /* Ungrab */
119 if (grab_server) 121 if (grab_server)
120 XUngrabServer(GDK_DISPLAY()); 122 XUngrabServer(GDK_DISPLAY());
121 gdk_pointer_ungrab(GDK_CURRENT_TIME); 123 if (grab_pointer)
124 gdk_pointer_ungrab(GDK_CURRENT_TIME);
122 gdk_keyboard_ungrab(GDK_CURRENT_TIME); 125 gdk_keyboard_ungrab(GDK_CURRENT_TIME);
123 gdk_flush(); 126 gdk_flush();
124 127