- (djm) Make gnome-ssh-askpass handle multi-line prompts. Patch from
Nalin Dahyabhai <nalin@redhat.com> - (djm) BSD license for gnome-ssh-askpass (was X11) - (djm) KNF on gnome-ssh-askpass
This commit is contained in:
parent
c547bf1930
commit
b5e85a5d94
|
@ -4,6 +4,10 @@
|
||||||
- (bal) Added DG/UX case and set that they have a broken IPTOS.
|
- (bal) Added DG/UX case and set that they have a broken IPTOS.
|
||||||
- (djm) Mini-configure reorder patch from Tim Rice <tim@multitalents.net>
|
- (djm) Mini-configure reorder patch from Tim Rice <tim@multitalents.net>
|
||||||
Fixes linking on SCO.
|
Fixes linking on SCO.
|
||||||
|
- (djm) Make gnome-ssh-askpass handle multi-line prompts. Patch from
|
||||||
|
Nalin Dahyabhai <nalin@redhat.com>
|
||||||
|
- (djm) BSD license for gnome-ssh-askpass (was X11)
|
||||||
|
- (djm) KNF on gnome-ssh-askpass
|
||||||
|
|
||||||
20010215
|
20010215
|
||||||
- (djm) Move PAM session setup back to before setuid to user. Fixes
|
- (djm) Move PAM session setup back to before setuid to user. Fixes
|
||||||
|
@ -3977,4 +3981,4 @@
|
||||||
- Wrote replacements for strlcpy and mkdtemp
|
- Wrote replacements for strlcpy and mkdtemp
|
||||||
- Released 1.0pre1
|
- Released 1.0pre1
|
||||||
|
|
||||||
$Id: ChangeLog,v 1.775 2001/02/15 23:18:12 djm Exp $
|
$Id: ChangeLog,v 1.776 2001/02/16 00:18:58 djm Exp $
|
||||||
|
|
|
@ -1,46 +1,35 @@
|
||||||
/*
|
/*
|
||||||
Compile with:
|
* Copyright (c) 2000 Damien Miller. All rights reserved.
|
||||||
|
*
|
||||||
cc `gnome-config --cflags gnome gnomeui` \
|
* Redistribution and use in source and binary forms, with or without
|
||||||
gnome-ssh-askpass.c -o gnome-ssh-askpass \
|
* modification, are permitted provided that the following conditions
|
||||||
`gnome-config --libs gnome gnomeui`
|
* are met:
|
||||||
|
* 1. Redistributions of source code must retain the above copyright
|
||||||
*/
|
* notice, this list of conditions and the following disclaimer.
|
||||||
|
* 2. Redistributions in binary form must reproduce the above copyright
|
||||||
|
* notice, this list of conditions and the following disclaimer in the
|
||||||
|
* documentation and/or other materials provided with the distribution.
|
||||||
|
*
|
||||||
|
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
|
||||||
|
* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
|
||||||
|
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
|
||||||
|
* IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
|
||||||
|
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
|
||||||
|
* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||||
|
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
||||||
|
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||||
|
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
|
||||||
|
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
|
*/
|
||||||
|
|
||||||
/*
|
/*
|
||||||
**
|
* Compile with:
|
||||||
** GNOME ssh passphrase requestor
|
*
|
||||||
**
|
* cc `gnome-config --cflags gnome gnomeui` \
|
||||||
** Damien Miller <djm@ibs.com.au>
|
* gnome-ssh-askpass.c -o gnome-ssh-askpass \
|
||||||
**
|
* `gnome-config --libs gnome gnomeui`
|
||||||
** Copyright 1999 Internet Business Solutions
|
*
|
||||||
**
|
*/
|
||||||
** Permission is hereby granted, free of charge, to any person
|
|
||||||
** obtaining a copy of this software and associated documentation
|
|
||||||
** files (the "Software"), to deal in the Software without
|
|
||||||
** restriction, including without limitation the rights to use, copy,
|
|
||||||
** modify, merge, publish, distribute, sublicense, and/or sell copies
|
|
||||||
** of the Software, and to permit persons to whom the Software is
|
|
||||||
** furnished to do so, subject to the following conditions:
|
|
||||||
**
|
|
||||||
** The above copyright notice and this permission notice shall be
|
|
||||||
** included in all copies or substantial portions of the Software.
|
|
||||||
**
|
|
||||||
** THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY
|
|
||||||
** KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
|
|
||||||
** WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE
|
|
||||||
** AND NONINFRINGEMENT. IN NO EVENT SHALL DAMIEN MILLER OR INTERNET
|
|
||||||
** BUSINESS SOLUTIONS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
||||||
** LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
|
|
||||||
** ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE
|
|
||||||
** OR OTHER DEALINGS IN THE SOFTWARE.
|
|
||||||
**
|
|
||||||
** Except as contained in this notice, the name of Internet Business
|
|
||||||
** Solutions shall not be used in advertising or otherwise to promote
|
|
||||||
** the sale, use or other dealings in this Software without prior
|
|
||||||
** written authorization from Internet Business Solutions.
|
|
||||||
**
|
|
||||||
*/
|
|
||||||
|
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
|
@ -67,20 +56,25 @@ void
|
||||||
passphrase_dialog(char *message)
|
passphrase_dialog(char *message)
|
||||||
{
|
{
|
||||||
char *passphrase;
|
char *passphrase;
|
||||||
int result;
|
char **messages;
|
||||||
|
int result, i;
|
||||||
|
|
||||||
GtkWidget *dialog, *entry, *label;
|
GtkWidget *dialog, *entry, *label;
|
||||||
|
|
||||||
dialog = gnome_dialog_new("OpenSSH", GNOME_STOCK_BUTTON_OK,
|
dialog = gnome_dialog_new("OpenSSH", GNOME_STOCK_BUTTON_OK,
|
||||||
GNOME_STOCK_BUTTON_CANCEL, NULL);
|
GNOME_STOCK_BUTTON_CANCEL, NULL);
|
||||||
|
|
||||||
label = gtk_label_new(message);
|
messages = g_strsplit(message, "\\n", 0);
|
||||||
gtk_box_pack_start(GTK_BOX(GNOME_DIALOG(dialog)->vbox), label, FALSE,
|
if (messages)
|
||||||
FALSE, 0);
|
for(i = 0; messages[i]; i++) {
|
||||||
|
label = gtk_label_new(messages[i]);
|
||||||
|
gtk_box_pack_start(GTK_BOX(GNOME_DIALOG(dialog)->vbox),
|
||||||
|
label, FALSE, FALSE, 0);
|
||||||
|
}
|
||||||
|
|
||||||
entry = gtk_entry_new();
|
entry = gtk_entry_new();
|
||||||
gtk_box_pack_start(GTK_BOX(GNOME_DIALOG(dialog)->vbox), entry, FALSE,
|
gtk_box_pack_start(GTK_BOX(GNOME_DIALOG(dialog)->vbox), entry, FALSE,
|
||||||
FALSE, 0);
|
FALSE, 0);
|
||||||
gtk_entry_set_visibility(GTK_ENTRY(entry), FALSE);
|
gtk_entry_set_visibility(GTK_ENTRY(entry), FALSE);
|
||||||
gtk_widget_grab_focus(entry);
|
gtk_widget_grab_focus(entry);
|
||||||
|
|
||||||
|
@ -90,13 +84,14 @@ passphrase_dialog(char *message)
|
||||||
gtk_window_set_position (GTK_WINDOW(dialog), GTK_WIN_POS_CENTER);
|
gtk_window_set_position (GTK_WINDOW(dialog), GTK_WIN_POS_CENTER);
|
||||||
gtk_window_set_policy(GTK_WINDOW(dialog), FALSE, FALSE, TRUE);
|
gtk_window_set_policy(GTK_WINDOW(dialog), FALSE, FALSE, TRUE);
|
||||||
gnome_dialog_close_hides(GNOME_DIALOG(dialog), TRUE);
|
gnome_dialog_close_hides(GNOME_DIALOG(dialog), TRUE);
|
||||||
gtk_container_set_border_width(GTK_CONTAINER(GNOME_DIALOG(dialog)->vbox), GNOME_PAD);
|
gtk_container_set_border_width(GTK_CONTAINER(GNOME_DIALOG(dialog)->vbox),
|
||||||
|
GNOME_PAD);
|
||||||
gtk_widget_show_all(dialog);
|
gtk_widget_show_all(dialog);
|
||||||
|
|
||||||
/* Grab focus */
|
/* Grab focus */
|
||||||
XGrabServer(GDK_DISPLAY());
|
XGrabServer(GDK_DISPLAY());
|
||||||
if (gdk_pointer_grab(dialog->window, TRUE, 0,
|
if (gdk_pointer_grab(dialog->window, TRUE, 0, NULL, NULL,
|
||||||
NULL, NULL, GDK_CURRENT_TIME))
|
GDK_CURRENT_TIME))
|
||||||
goto nograb;
|
goto nograb;
|
||||||
if (gdk_keyboard_grab(dialog->window, FALSE, GDK_CURRENT_TIME))
|
if (gdk_keyboard_grab(dialog->window, FALSE, GDK_CURRENT_TIME))
|
||||||
goto nograbkb;
|
goto nograbkb;
|
||||||
|
|
Loading…
Reference in New Issue