- (djm) Add option to gnome-ssh-askpass to stop it from grabbing the X

server. I have found this necessary to avoid server hangs with X input
   extensions (e.g. kinput2). Enable by setting the environment variable
   "GNOME_SSH_ASKPASS_NOGRAB"
This commit is contained in:
Damien Miller 2001-12-21 10:28:07 +11:00
Родитель 366298c696
Коммит faf2f6483a
2 изменённых файлов: 28 добавлений и 7 удалений

Просмотреть файл

@ -1,3 +1,9 @@
20011221
- (djm) Add option to gnome-ssh-askpass to stop it from grabbing the X
server. I have found this necessary to avoid server hangs with X input
extensions (e.g. kinput2). Enable by setting the environment variable
"GNOME_SSH_ASKPASS_NOGRAB"
20011219
- (stevesk) OpenBSD CVS sync X11 localhost display
- stevesk@cvs.openbsd.org 2001/11/29 14:10:51
@ -7025,4 +7031,4 @@
- Wrote replacements for strlcpy and mkdtemp
- Released 1.0pre1
$Id: ChangeLog,v 1.1692 2001/12/19 17:58:01 stevesk Exp $
$Id: ChangeLog,v 1.1693 2001/12/20 23:28:07 djm Exp $

Просмотреть файл

@ -1,5 +1,5 @@
/*
* Copyright (c) 2000 Damien Miller. All rights reserved.
* Copyright (c) 2000-2001 Damien Miller. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@ -22,6 +22,17 @@
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
/*
* This is a simple GNOME SSH passphrase grabber. To use it, set the
* environment variable SSH_ASKPASS to point to the location of
* gnome-ssh-askpass before calling "ssh-add < /dev/null".
*
* There is only one run-time option: if you set the environment variable
* "GNOME_SSH_ASKPASS_NOGRAB=true" then gnome-ssh-askpass will not grab
* the X server. I have found this necessary to avoid server hangs with
* X input extensions (e.g. kinput2) enabled. - djm
*/
/*
* Compile with:
*
@ -57,10 +68,11 @@ passphrase_dialog(char *message)
{
char *passphrase;
char **messages;
int result, i;
int result, i, grab_server;
GtkWidget *dialog, *entry, *label;
grab_server = (getenv("GNOME_SSH_ASKPASS_NOGRAB") == NULL);
dialog = gnome_dialog_new("OpenSSH", GNOME_STOCK_BUTTON_OK,
GNOME_STOCK_BUTTON_CANCEL, NULL);
@ -89,7 +101,8 @@ passphrase_dialog(char *message)
gtk_widget_show_all(dialog);
/* Grab focus */
XGrabServer(GDK_DISPLAY());
if (grab_server)
XGrabServer(GDK_DISPLAY());
if (gdk_pointer_grab(dialog->window, TRUE, 0, NULL, NULL,
GDK_CURRENT_TIME))
goto nograb;
@ -103,7 +116,8 @@ passphrase_dialog(char *message)
result = gnome_dialog_run(GNOME_DIALOG(dialog));
/* Ungrab */
XUngrabServer(GDK_DISPLAY());
if (grab_server)
XUngrabServer(GDK_DISPLAY());
gdk_pointer_ungrab(GDK_CURRENT_TIME);
gdk_keyboard_ungrab(GDK_CURRENT_TIME);
gdk_flush();
@ -126,7 +140,8 @@ passphrase_dialog(char *message)
nograbkb:
gdk_pointer_ungrab(GDK_CURRENT_TIME);
nograb:
XUngrabServer(GDK_DISPLAY());
if (grab_server)
XUngrabServer(GDK_DISPLAY());
gnome_dialog_close(GNOME_DIALOG(dialog));
report_failed_grab();