summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog4
-rw-r--r--contrib/gnome-ssh-askpass1.c15
-rw-r--r--contrib/gnome-ssh-askpass2.c15
3 files changed, 21 insertions, 13 deletions
diff --git a/ChangeLog b/ChangeLog
index 2d84af023..d7ca09dbb 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,4 +1,6 @@
120020912 120020912
2 - (djm) Made GNOME askpass programs return non-zero if cancel button is
3 pressed.
2 - (djm) Added getpeereid() replacement. Properly implemented for systems 4 - (djm) Added getpeereid() replacement. Properly implemented for systems
3 with SO_PEERCRED support. Faked for systems which lack it. 5 with SO_PEERCRED support. Faked for systems which lack it.
4 - (djm) Sync sys/tree.h with OpenBSD -current. Rename tree.h and 6 - (djm) Sync sys/tree.h with OpenBSD -current. Rename tree.h and
@@ -645,4 +647,4 @@
645 save auth method before monitor_reset_key_state(); bugzilla bug #284; 647 save auth method before monitor_reset_key_state(); bugzilla bug #284;
646 ok provos@ 648 ok provos@
647 649
648$Id: ChangeLog,v 1.2462 2002/09/12 00:45:32 djm Exp $ 650$Id: ChangeLog,v 1.2463 2002/09/12 04:49:00 djm Exp $
diff --git a/contrib/gnome-ssh-askpass1.c b/contrib/gnome-ssh-askpass1.c
index 7cece5620..b6b342b84 100644
--- a/contrib/gnome-ssh-askpass1.c
+++ b/contrib/gnome-ssh-askpass1.c
@@ -38,7 +38,7 @@
38 * Compile with: 38 * Compile with:
39 * 39 *
40 * cc `gnome-config --cflags gnome gnomeui` \ 40 * cc `gnome-config --cflags gnome gnomeui` \
41 * gnome-ssh-askpass.c -o gnome-ssh-askpass \ 41 * gnome-ssh-askpass1.c -o gnome-ssh-askpass \
42 * `gnome-config --libs gnome gnomeui` 42 * `gnome-config --libs gnome gnomeui`
43 * 43 *
44 */ 44 */
@@ -64,7 +64,7 @@ report_failed_grab (void)
64 gnome_dialog_run_and_close(GNOME_DIALOG(err)); 64 gnome_dialog_run_and_close(GNOME_DIALOG(err));
65} 65}
66 66
67void 67int
68passphrase_dialog(char *message) 68passphrase_dialog(char *message)
69{ 69{
70 char *passphrase; 70 char *passphrase;
@@ -135,7 +135,7 @@ passphrase_dialog(char *message)
135 gtk_entry_set_text(GTK_ENTRY(entry), passphrase); 135 gtk_entry_set_text(GTK_ENTRY(entry), passphrase);
136 136
137 gnome_dialog_close(GNOME_DIALOG(dialog)); 137 gnome_dialog_close(GNOME_DIALOG(dialog));
138 return; 138 return (result == 0 ? 0 : -1);
139 139
140 /* At least one grab failed - ungrab what we got, and report 140 /* At least one grab failed - ungrab what we got, and report
141 the failure to the user. Note that XGrabServer() cannot 141 the failure to the user. Note that XGrabServer() cannot
@@ -148,13 +148,15 @@ passphrase_dialog(char *message)
148 gnome_dialog_close(GNOME_DIALOG(dialog)); 148 gnome_dialog_close(GNOME_DIALOG(dialog));
149 149
150 report_failed_grab(); 150 report_failed_grab();
151 return (-1);
151} 152}
152 153
153int 154int
154main(int argc, char **argv) 155main(int argc, char **argv)
155{ 156{
156 char *message; 157 char *message;
157 158 int result;
159
158 gnome_init("GNOME ssh-askpass", "0.1", argc, argv); 160 gnome_init("GNOME ssh-askpass", "0.1", argc, argv);
159 161
160 if (argc == 2) 162 if (argc == 2)
@@ -163,6 +165,7 @@ main(int argc, char **argv)
163 message = "Enter your OpenSSH passphrase:"; 165 message = "Enter your OpenSSH passphrase:";
164 166
165 setvbuf(stdout, 0, _IONBF, 0); 167 setvbuf(stdout, 0, _IONBF, 0);
166 passphrase_dialog(message); 168 result = passphrase_dialog(message);
167 return 0; 169
170 return (result);
168} 171}
diff --git a/contrib/gnome-ssh-askpass2.c b/contrib/gnome-ssh-askpass2.c
index 8cccf9e60..89a412aa8 100644
--- a/contrib/gnome-ssh-askpass2.c
+++ b/contrib/gnome-ssh-askpass2.c
@@ -40,7 +40,7 @@
40 * Compile with: 40 * Compile with:
41 * 41 *
42 * cc `pkg-config --cflags gtk+-2.0` \ 42 * cc `pkg-config --cflags gtk+-2.0` \
43 * gnome-ssh-askpass.c -o gnome-ssh-askpass \ 43 * gnome-ssh-askpass2.c -o gnome-ssh-askpass \
44 * `pkg-config --libs gtk+-2.0` 44 * `pkg-config --libs gtk+-2.0`
45 * 45 *
46 */ 46 */
@@ -79,7 +79,7 @@ ok_dialog(GtkWidget *entry, gpointer dialog)
79 gtk_dialog_response(GTK_DIALOG(dialog), GTK_RESPONSE_OK); 79 gtk_dialog_response(GTK_DIALOG(dialog), GTK_RESPONSE_OK);
80} 80}
81 81
82static void 82static int
83passphrase_dialog(char *message) 83passphrase_dialog(char *message)
84{ 84{
85 const char *failed; 85 const char *failed;
@@ -165,7 +165,7 @@ passphrase_dialog(char *message)
165 g_free(passphrase); 165 g_free(passphrase);
166 166
167 gtk_widget_destroy(dialog); 167 gtk_widget_destroy(dialog);
168 return; 168 return (result == GTK_RESPONSE_OK ? 0 : -1);
169 169
170 /* At least one grab failed - ungrab what we got, and report 170 /* At least one grab failed - ungrab what we got, and report
171 the failure to the user. Note that XGrabServer() cannot 171 the failure to the user. Note that XGrabServer() cannot
@@ -178,13 +178,16 @@ passphrase_dialog(char *message)
178 gtk_widget_destroy(dialog); 178 gtk_widget_destroy(dialog);
179 179
180 report_failed_grab(failed); 180 report_failed_grab(failed);
181
182 return (-1);
181} 183}
182 184
183int 185int
184main(int argc, char **argv) 186main(int argc, char **argv)
185{ 187{
186 char *message; 188 char *message;
187 189 int result;
190
188 gtk_init(&argc, &argv); 191 gtk_init(&argc, &argv);
189 192
190 if (argc > 1) { 193 if (argc > 1) {
@@ -194,8 +197,8 @@ main(int argc, char **argv)
194 } 197 }
195 198
196 setvbuf(stdout, 0, _IONBF, 0); 199 setvbuf(stdout, 0, _IONBF, 0);
197 passphrase_dialog(message); 200 result = passphrase_dialog(message);
198 g_free(message); 201 g_free(message);
199 202
200 return 0; 203 return (result);
201} 204}