[openssh-commits] [openssh] 01/01: perform report_failed_grab() inline

git+noreply at mindrot.org git+noreply at mindrot.org
Sat Apr 10 18:45:29 AEST 2021


This is an automated email from the git hooks/post-receive script.

djm pushed a commit to branch master
in repository openssh.

commit d5d6b7d76d171a2e6861609dcd92e714ee62ad88
Author: Damien Miller <djm at mindrot.org>
Date:   Sat Apr 10 18:45:00 2021 +1000

    perform report_failed_grab() inline
---
 contrib/gnome-ssh-askpass3.c | 29 +++++++++--------------------
 1 file changed, 9 insertions(+), 20 deletions(-)

diff --git a/contrib/gnome-ssh-askpass3.c b/contrib/gnome-ssh-askpass3.c
index c2290398..e1a0533e 100644
--- a/contrib/gnome-ssh-askpass3.c
+++ b/contrib/gnome-ssh-askpass3.c
@@ -62,22 +62,6 @@
 #include <gdk/gdkx.h>
 #include <gdk/gdkkeysyms.h>
 
-static void
-report_failed_grab (GtkWidget *parent_window, const char *what)
-{
-	GtkWidget *err;
-
-	err = gtk_message_dialog_new(GTK_WINDOW(parent_window), 0,
-	    GTK_MESSAGE_ERROR, GTK_BUTTONS_CLOSE,
-	    "Could not grab %s. A malicious client may be eavesdropping "
-	    "on your session.", what);
-	gtk_window_set_position(GTK_WINDOW(err), GTK_WIN_POS_CENTER);
-
-	gtk_dialog_run(GTK_DIALOG(err));
-
-	gtk_widget_destroy(err);
-}
-
 static void
 ok_dialog(GtkWidget *entry, gpointer dialog)
 {
@@ -153,7 +137,7 @@ passphrase_dialog(char *message, int prompt_type)
 	char *passphrase, *local;
 	int result, grab_tries, grab_server, grab_pointer;
 	int buttons, default_response;
-	GtkWidget *parent_window, *dialog, *entry;
+	GtkWidget *parent_window, *dialog, *entry, *err;
 	GdkGrabStatus status;
 	GdkColor fg, bg;
 	GdkSeat *seat;
@@ -282,9 +266,14 @@ passphrase_dialog(char *message, int prompt_type)
 
  nograb:
 	gtk_widget_destroy(dialog);
-	report_failed_grab(parent_window, failed);
-
-	return (-1);
+	err = gtk_message_dialog_new(GTK_WINDOW(parent_window), 0,
+	    GTK_MESSAGE_ERROR, GTK_BUTTONS_CLOSE,
+	    "Could not grab input. A malicious client may be eavesdropping "
+	    "on your session.");
+	gtk_window_set_position(GTK_WINDOW(err), GTK_WIN_POS_CENTER);
+	gtk_dialog_run(GTK_DIALOG(err));
+	gtk_widget_destroy(err);
+	return -1;
 }
 
 int

-- 
To stop receiving notification emails like this one, please contact
djm at mindrot.org.


More information about the openssh-commits mailing list