summaryrefslogtreecommitdiff
path: root/contrib
diff options
context:
space:
mode:
Diffstat (limited to 'contrib')
-rw-r--r--contrib/Makefile7
-rw-r--r--contrib/gnome-ssh-askpass2.c36
-rw-r--r--contrib/redhat/openssh.spec6
-rw-r--r--contrib/suse/openssh.spec4
4 files changed, 30 insertions, 23 deletions
diff --git a/contrib/Makefile b/contrib/Makefile
index eaf7fe2fd..3a36387b3 100644
--- a/contrib/Makefile
+++ b/contrib/Makefile
@@ -13,5 +13,10 @@ gnome-ssh-askpass2: gnome-ssh-askpass2.c
13 gnome-ssh-askpass2.c -o gnome-ssh-askpass2 \ 13 gnome-ssh-askpass2.c -o gnome-ssh-askpass2 \
14 `$(PKG_CONFIG) --libs gtk+-2.0 x11` 14 `$(PKG_CONFIG) --libs gtk+-2.0 x11`
15 15
16gnome-ssh-askpass3: gnome-ssh-askpass2.c
17 $(CC) $(CFLAGS) `$(PKG_CONFIG) --cflags gtk+-3.0` \
18 gnome-ssh-askpass2.c -o gnome-ssh-askpass3 \
19 `$(PKG_CONFIG) --libs gtk+-3.0 x11`
20
16clean: 21clean:
17 rm -f *.o gnome-ssh-askpass1 gnome-ssh-askpass2 gnome-ssh-askpass 22 rm -f *.o gnome-ssh-askpass gnome-ssh-askpass[123]
diff --git a/contrib/gnome-ssh-askpass2.c b/contrib/gnome-ssh-askpass2.c
index 9d97c30c0..535a69274 100644
--- a/contrib/gnome-ssh-askpass2.c
+++ b/contrib/gnome-ssh-askpass2.c
@@ -57,19 +57,17 @@
57#include <gdk/gdkx.h> 57#include <gdk/gdkx.h>
58 58
59static void 59static void
60report_failed_grab (const char *what) 60report_failed_grab (GtkWidget *parent_window, const char *what)
61{ 61{
62 GtkWidget *err; 62 GtkWidget *err;
63 63
64 err = gtk_message_dialog_new(NULL, 0, 64 err = gtk_message_dialog_new(GTK_WINDOW(parent_window), 0,
65 GTK_MESSAGE_ERROR, 65 GTK_MESSAGE_ERROR,
66 GTK_BUTTONS_CLOSE, 66 GTK_BUTTONS_CLOSE,
67 "Could not grab %s. " 67 "Could not grab %s. "
68 "A malicious client may be eavesdropping " 68 "A malicious client may be eavesdropping "
69 "on your session.", what); 69 "on your session.", what);
70 gtk_window_set_position(GTK_WINDOW(err), GTK_WIN_POS_CENTER); 70 gtk_window_set_position(GTK_WINDOW(err), GTK_WIN_POS_CENTER);
71 gtk_label_set_line_wrap(GTK_LABEL((GTK_MESSAGE_DIALOG(err))->label),
72 TRUE);
73 71
74 gtk_dialog_run(GTK_DIALOG(err)); 72 gtk_dialog_run(GTK_DIALOG(err));
75 73
@@ -89,22 +87,27 @@ passphrase_dialog(char *message)
89 const char *failed; 87 const char *failed;
90 char *passphrase, *local; 88 char *passphrase, *local;
91 int result, grab_tries, grab_server, grab_pointer; 89 int result, grab_tries, grab_server, grab_pointer;
92 GtkWidget *dialog, *entry; 90 GtkWidget *parent_window, *dialog, *entry;
93 GdkGrabStatus status; 91 GdkGrabStatus status;
94 92
95 grab_server = (getenv("GNOME_SSH_ASKPASS_GRAB_SERVER") != NULL); 93 grab_server = (getenv("GNOME_SSH_ASKPASS_GRAB_SERVER") != NULL);
96 grab_pointer = (getenv("GNOME_SSH_ASKPASS_GRAB_POINTER") != NULL); 94 grab_pointer = (getenv("GNOME_SSH_ASKPASS_GRAB_POINTER") != NULL);
97 grab_tries = 0; 95 grab_tries = 0;
98 96
99 dialog = gtk_message_dialog_new(NULL, 0, 97 /* Create an invisible parent window so that GtkDialog doesn't
98 * complain. */
99 parent_window = gtk_window_new(GTK_WINDOW_TOPLEVEL);
100
101 dialog = gtk_message_dialog_new(GTK_WINDOW(parent_window), 0,
100 GTK_MESSAGE_QUESTION, 102 GTK_MESSAGE_QUESTION,
101 GTK_BUTTONS_OK_CANCEL, 103 GTK_BUTTONS_OK_CANCEL,
102 "%s", 104 "%s",
103 message); 105 message);
104 106
105 entry = gtk_entry_new(); 107 entry = gtk_entry_new();
106 gtk_box_pack_start(GTK_BOX(GTK_DIALOG(dialog)->vbox), entry, FALSE, 108 gtk_box_pack_start(
107 FALSE, 0); 109 GTK_BOX(gtk_dialog_get_content_area(GTK_DIALOG(dialog))), entry,
110 FALSE, FALSE, 0);
108 gtk_entry_set_visibility(GTK_ENTRY(entry), FALSE); 111 gtk_entry_set_visibility(GTK_ENTRY(entry), FALSE);
109 gtk_widget_grab_focus(entry); 112 gtk_widget_grab_focus(entry);
110 gtk_widget_show(entry); 113 gtk_widget_show(entry);
@@ -112,8 +115,6 @@ passphrase_dialog(char *message)
112 gtk_window_set_title(GTK_WINDOW(dialog), "OpenSSH"); 115 gtk_window_set_title(GTK_WINDOW(dialog), "OpenSSH");
113 gtk_window_set_position (GTK_WINDOW(dialog), GTK_WIN_POS_CENTER); 116 gtk_window_set_position (GTK_WINDOW(dialog), GTK_WIN_POS_CENTER);
114 gtk_window_set_keep_above(GTK_WINDOW(dialog), TRUE); 117 gtk_window_set_keep_above(GTK_WINDOW(dialog), TRUE);
115 gtk_label_set_line_wrap(GTK_LABEL((GTK_MESSAGE_DIALOG(dialog))->label),
116 TRUE);
117 118
118 /* Make <enter> close dialog */ 119 /* Make <enter> close dialog */
119 gtk_dialog_set_default_response(GTK_DIALOG(dialog), GTK_RESPONSE_OK); 120 gtk_dialog_set_default_response(GTK_DIALOG(dialog), GTK_RESPONSE_OK);
@@ -127,8 +128,8 @@ passphrase_dialog(char *message)
127 if (grab_pointer) { 128 if (grab_pointer) {
128 for(;;) { 129 for(;;) {
129 status = gdk_pointer_grab( 130 status = gdk_pointer_grab(
130 (GTK_WIDGET(dialog))->window, TRUE, 0, NULL, 131 (gtk_widget_get_window(GTK_WIDGET(dialog))), TRUE,
131 NULL, GDK_CURRENT_TIME); 132 0, NULL, NULL, GDK_CURRENT_TIME);
132 if (status == GDK_GRAB_SUCCESS) 133 if (status == GDK_GRAB_SUCCESS)
133 break; 134 break;
134 usleep(GRAB_WAIT * 1000); 135 usleep(GRAB_WAIT * 1000);
@@ -139,8 +140,9 @@ passphrase_dialog(char *message)
139 } 140 }
140 } 141 }
141 for(;;) { 142 for(;;) {
142 status = gdk_keyboard_grab((GTK_WIDGET(dialog))->window, 143 status = gdk_keyboard_grab(
143 FALSE, GDK_CURRENT_TIME); 144 gtk_widget_get_window(GTK_WIDGET(dialog)), FALSE,
145 GDK_CURRENT_TIME);
144 if (status == GDK_GRAB_SUCCESS) 146 if (status == GDK_GRAB_SUCCESS)
145 break; 147 break;
146 usleep(GRAB_WAIT * 1000); 148 usleep(GRAB_WAIT * 1000);
@@ -157,7 +159,7 @@ passphrase_dialog(char *message)
157 159
158 /* Ungrab */ 160 /* Ungrab */
159 if (grab_server) 161 if (grab_server)
160 XUngrabServer(GDK_DISPLAY()); 162 XUngrabServer(gdk_x11_get_default_xdisplay());
161 if (grab_pointer) 163 if (grab_pointer)
162 gdk_pointer_ungrab(GDK_CURRENT_TIME); 164 gdk_pointer_ungrab(GDK_CURRENT_TIME);
163 gdk_keyboard_ungrab(GDK_CURRENT_TIME); 165 gdk_keyboard_ungrab(GDK_CURRENT_TIME);
@@ -193,10 +195,10 @@ passphrase_dialog(char *message)
193 gdk_pointer_ungrab(GDK_CURRENT_TIME); 195 gdk_pointer_ungrab(GDK_CURRENT_TIME);
194 nograb: 196 nograb:
195 if (grab_server) 197 if (grab_server)
196 XUngrabServer(GDK_DISPLAY()); 198 XUngrabServer(gdk_x11_get_default_xdisplay());
197 gtk_widget_destroy(dialog); 199 gtk_widget_destroy(dialog);
198 200
199 report_failed_grab(failed); 201 report_failed_grab(parent_window, failed);
200 202
201 return (-1); 203 return (-1);
202} 204}
diff --git a/contrib/redhat/openssh.spec b/contrib/redhat/openssh.spec
index fd8678f12..666097c5e 100644
--- a/contrib/redhat/openssh.spec
+++ b/contrib/redhat/openssh.spec
@@ -1,4 +1,4 @@
1%define ver 7.3p1 1%define ver 7.4p1
2%define rel 1 2%define rel 1
3 3
4# OpenSSH privilege separation requires a user & group ID 4# OpenSSH privilege separation requires a user & group ID
@@ -72,8 +72,8 @@ Release: %{rel}rescue
72%else 72%else
73Release: %{rel} 73Release: %{rel}
74%endif 74%endif
75URL: http://www.openssh.com/portable.html 75URL: https://www.openssh.com/portable.html
76Source0: ftp://ftp.openbsd.org/pub/OpenBSD/OpenSSH/portable/openssh-%{version}.tar.gz 76Source0: https://ftp.openbsd.org/pub/OpenBSD/OpenSSH/portable/openssh-%{version}.tar.gz
77%if ! %{no_x11_askpass} 77%if ! %{no_x11_askpass}
78Source1: http://www.jmknoble.net/software/x11-ssh-askpass/x11-ssh-askpass-%{aversion}.tar.gz 78Source1: http://www.jmknoble.net/software/x11-ssh-askpass/x11-ssh-askpass-%{aversion}.tar.gz
79%endif 79%endif
diff --git a/contrib/suse/openssh.spec b/contrib/suse/openssh.spec
index d2b2728d5..4c4bbb69c 100644
--- a/contrib/suse/openssh.spec
+++ b/contrib/suse/openssh.spec
@@ -13,8 +13,8 @@
13 13
14Summary: OpenSSH, a free Secure Shell (SSH) protocol implementation 14Summary: OpenSSH, a free Secure Shell (SSH) protocol implementation
15Name: openssh 15Name: openssh
16Version: 7.3p1 16Version: 7.4p1
17URL: http://www.openssh.com/ 17URL: https://www.openssh.com/
18Release: 1 18Release: 1
19Source0: openssh-%{version}.tar.gz 19Source0: openssh-%{version}.tar.gz
20Source1: x11-ssh-askpass-%{xversion}.tar.gz 20Source1: x11-ssh-askpass-%{xversion}.tar.gz