diff options
author | Guido Günther <agx@sigxcpu.org> | 2009-04-24 11:28:49 +0200 |
---|---|---|
committer | Guido Günther <agx@sigxcpu.org> | 2009-04-24 11:28:49 +0200 |
commit | 9d5cdf24ef40097737cdb3ecd2ac1331653b471f (patch) | |
tree | 2df5ea1d5ce717daac6c6b3bf4f071ba3e43b5f2 | |
parent | Imported Upstream version 0.9~rc1 (diff) | |
download | krb5-auth-dialog-9d5cdf24ef40097737cdb3ecd2ac1331653b471f.tar.gz krb5-auth-dialog-9d5cdf24ef40097737cdb3ecd2ac1331653b471f.tar.bz2 krb5-auth-dialog-9d5cdf24ef40097737cdb3ecd2ac1331653b471f.zip |
Imported Upstream version 0.9+0gitec60300
-rw-r--r-- | AUTHORS | 3 | ||||
-rw-r--r-- | ChangeLog | 46 | ||||
-rw-r--r-- | NEWS | 15 | ||||
-rw-r--r-- | configure.ac | 2 | ||||
-rw-r--r-- | gtksecentry/gtksecentry.c | 13 | ||||
-rw-r--r-- | src/krb5-auth-applet.c | 35 | ||||
-rw-r--r-- | src/krb5-auth-dialog.c | 16 | ||||
-rw-r--r-- | src/krb5-auth-dialog.glade | 385 | ||||
-rw-r--r-- | src/krb5-auth-pwdialog.c | 10 |
9 files changed, 250 insertions, 275 deletions
@@ -2,3 +2,6 @@ Christopher Aillon <caillon@redhat.com> Jonathan Blandford <jrb@redhat.com> Colin Walters <walters@verbum.org> Guido Günther <agx@sigxcpu.org> + +Patches have been contributed by: +Matthias Clasen <mclasen@redhat.com> @@ -1,3 +1,49 @@ +Fri Apr 24 10:48:30 CEST 2009 Guido Günther <agx@sigxcpu.org> + + * src/krb5-auth-pwdialog.c: query current invisiable char from + GtkEntry and set it for GtkSecureEntry too. Patch by Matthias Clasen. + (BZ: #538339) + +Fri Apr 24 10:46:20 CEST 2009 Guido Günther <agx@sigxcpu.org> + + * gtksecentry/gtksecentry.c: don't install "gtk-entry-select-on-focus" + settings property since it clashes with the one from GtkEntry. Allows + to have GtkEntry and GtkSecureEntry in the same process. + (https://bugs.g10code.com/gnupg/issue1029). + +Fri Apr 24 09:39:16 CEST 2009 Guido Günther <agx@sigxcpu.org> + + * AUTHORS: add Matthias Clasen + +Fri Apr 24 09:35:59 CEST 2009 Guido Günther <agx@sigxcpu.org> + + * src/krb5-auth-applet.c: Don't show notification before the applet is + embedded in the panel (based on a patch for 0.8 by Matthias Clasen) + +Do Apr 23 18:35:32 CEST 2009 Guido Günther <agx@sigxcpu.org> + + * configure.ac: release 0.9 + +Do Apr 23 11:19:46 CEST 2009 Guido Günther <agx@sigxcpu.org> + + * Update NEWS + +Thu Apr 23 11:17:28 CEST 2009 Guido Günther <agx@sigxcpu.org> + + Always reparse the principal name in grab_credentials. When + acquireing credentials interacively we want to be sure we use the + current principal name from gconf. + * src/krb5-auth-dialog.c (ka_parse_name): Always parse principal + property. + (grab_credentials): Call ka_parse_name unconditionally. + +Thu Apr 23 11:14:37 CEST 2009 Guido Günther <agx@sigxcpu.org> + + drop "Password:" label from dialog. It's in the kerberos prompt and + confusing if prompted for a PIN. + * src/krb5-auth-dialog.glade: drop password label + * src/krb5-auth-dialog.c (ka_pwdialog_setup): colon terminate prompts + Sat Apr 18 00:19:02 CEST 2009 Guido Günther <agx@sigxcpu.org> * src/krb5-auth-gconf.c (ka_gconf_set_principal): handle length zero @@ -1,4 +1,19 @@ =========== +Version 0.9 +=========== +* add DBus service so applications can make krb5-auth-dialog check if the user + has a valid Kerberos ticket and if not let krb5-auth-dialog get one + (prompting for the password if necessary). +* grab the keyboard when the dialog is open, avoids typing the password + accidentally into other apps +* watch the credentials cache via a file monitor. Speeds up notifications when + the ticket cache gets modified by other applications +* add a preferences capplet +* make ticket flags like renewable, forwardable, proxiable configurable +* make pkinit anchors configurable +* bug fixes and cleanups + +=========== Version 0.8 =========== * add a tray icon that displays the current status and remaining ticket diff --git a/configure.ac b/configure.ac index 3b9c983..58d61be 100644 --- a/configure.ac +++ b/configure.ac @@ -1,4 +1,4 @@ -AC_INIT([krb5-auth-dialog], [0.8]) +AC_INIT([krb5-auth-dialog], [0.9]) AC_CONFIG_SRCDIR(src/krb5-auth-dialog.c) dnl Make automake keep quiet about wildcards & other GNUmake-isms AM_INIT_AUTOMAKE([-Wno-portability]) diff --git a/gtksecentry/gtksecentry.c b/gtksecentry/gtksecentry.c index 4ad0e97..712ff2a 100644 --- a/gtksecentry/gtksecentry.c +++ b/gtksecentry/gtksecentry.c @@ -683,13 +683,6 @@ gtk_secure_entry_class_init(GtkSecureEntryClass * class) GDK_CONTROL_MASK, "delete_from_cursor", 2, G_TYPE_ENUM, GTK_DELETE_WORD_ENDS, G_TYPE_INT, -1); - - gtk_settings_install_property(g_param_spec_boolean - ("gtk-entry-select-on-focus", - _("Select on focus"), - _ - ("Whether to select the contents of an entry when it is focused"), - TRUE, G_PARAM_READWRITE)); } static void @@ -1369,14 +1362,18 @@ gtk_secure_entry_focus_out(GtkWidget * widget, static void gtk_secure_entry_grab_focus(GtkWidget * widget) { + GtkWidget *tmp; GtkSecureEntry *entry = GTK_SECURE_ENTRY(widget); gboolean select_on_focus; GTK_WIDGET_SET_FLAGS(widget, GTK_CAN_DEFAULT); GTK_WIDGET_CLASS(parent_class)->grab_focus(widget); - g_object_get(gtk_widget_get_settings(widget), + /* read current select on focus setting from GtkEntry */ + tmp = gtk_entry_new (); + g_object_get(gtk_widget_get_settings(tmp), "gtk-entry-select-on-focus", &select_on_focus, NULL); + gtk_widget_destroy (tmp); if (select_on_focus && !entry->in_click) gtk_editable_select_region(GTK_EDITABLE(widget), 0, -1); diff --git a/src/krb5-auth-applet.c b/src/krb5-auth-applet.c index 6e02ed8..b528ae9 100644 --- a/src/krb5-auth-applet.c +++ b/src/krb5-auth-applet.c @@ -371,13 +371,26 @@ ka_applet_select_icon(KaApplet* applet, int remaining) } +#ifdef HAVE_LIBNOTIFY +static gboolean +show_notification (KaApplet *applet) +{ + /* wait for the panel to be settled before showing a bubble */ + if (gtk_status_icon_is_embedded (applet->priv->tray_icon)) { + notify_notification_show (applet->priv->notification, NULL); + } else { + g_timeout_add_seconds (5, (GSourceFunc)show_notification, applet); + } + return FALSE; +} + + static void -ka_send_event_notification (KaApplet *applet G_GNUC_UNUSED, - const char *summary G_GNUC_UNUSED, - const char *message G_GNUC_UNUSED, - const char *icon G_GNUC_UNUSED) +ka_send_event_notification (KaApplet *applet, + const char *summary, + const char *message, + const char *icon) { -#ifdef HAVE_LIBNOTIFY const char *notify_icon; g_return_if_fail (applet != NULL); @@ -398,9 +411,17 @@ ka_send_event_notification (KaApplet *applet G_GNUC_UNUSED, notify_notification_new_with_status_icon(summary, message, notify_icon, applet->priv->tray_icon); notify_notification_set_urgency (applet->priv->notification, NOTIFY_URGENCY_NORMAL); - notify_notification_show (applet->priv->notification, NULL); -#endif /* HAVE_LIBNOTIFY */ + show_notification (applet); +} +#else +static void +ka_send_event_notification (KaApplet *applet G_GNUC_UNUSED, + const char *summary G_GNUC_UNUSED, + const char *message G_GNUC_UNUSED, + const char *icon G_GNUC_UNUSED) +{ } +#endif /* ! HAVE_LIBNOTIFY */ /* update the tray icon's tooltip and icon */ diff --git a/src/krb5-auth-dialog.c b/src/krb5-auth-dialog.c index 32cc016..08f1c12 100644 --- a/src/krb5-auth-dialog.c +++ b/src/krb5-auth-dialog.c @@ -178,6 +178,7 @@ credentials_expiring_real (KaApplet* applet) goto out; } + /* copy principal from cache if any */ if (krb5_principal_compare (kcontext, my_creds.client, kprincipal)) { krb5_free_principal(kcontext, kprincipal); krb5_copy_principal(kcontext, my_creds.client, &kprincipal); @@ -529,9 +530,11 @@ ka_parse_name(KaApplet* applet, krb5_context krbcontext, krb5_principal* kprinc) krb5_error_code ret; gchar *principal = NULL; + if (*kprinc != NULL) + krb5_free_principal(krbcontext, *kprinc); + g_object_get(applet, "principal", &principal, NULL); - ret = krb5_parse_name(krbcontext, principal, - kprinc); + ret = krb5_parse_name(krbcontext, principal, kprinc); g_free(principal); return ret; @@ -611,11 +614,9 @@ grab_credentials (KaApplet* applet) memset(&my_creds, 0, sizeof(my_creds)); - if (kprincipal == NULL) { - retval = ka_parse_name(applet, kcontext, &kprincipal); - if (retval) - goto out2; - } + retval = ka_parse_name(applet, kcontext, &kprincipal); + if (retval) + goto out2; retval = krb5_cc_default (kcontext, &ccache); if (retval) @@ -780,7 +781,6 @@ using_krb5(void) krb5_copy_principal(kcontext, creds.client, &kprincipal); krb5_free_cred_contents (kcontext, &creds); } - return have_tgt; } diff --git a/src/krb5-auth-dialog.glade b/src/krb5-auth-dialog.glade index 45ab987..e252817 100644 --- a/src/krb5-auth-dialog.glade +++ b/src/krb5-auth-dialog.glade @@ -1,251 +1,138 @@ -<?xml version="1.0" standalone="no"?> <!--*- mode: xml -*--> -<!DOCTYPE glade-interface SYSTEM "http://glade.gnome.org/glade-2.0.dtd"> - +<?xml version="1.0" encoding="UTF-8" standalone="no"?> +<!DOCTYPE glade-interface SYSTEM "glade-2.0.dtd"> +<!--*- mode: xml -*--> <glade-interface> -<requires lib="gnome"/> - -<widget class="GtkDialog" id="krb5_dialog"> - <property name="border_width">6</property> - <property name="visible">False</property> - <property name="title" translatable="yes">Network Authentication</property> - <property name="type">GTK_WINDOW_TOPLEVEL</property> - <property name="window_position">GTK_WIN_POS_CENTER</property> - <property name="modal">False</property> - <property name="resizable">False</property> - <property name="destroy_with_parent">False</property> - <property name="decorated">True</property> - <property name="skip_taskbar_hint">False</property> - <property name="skip_pager_hint">False</property> - <property name="type_hint">GDK_WINDOW_TYPE_HINT_NORMAL</property> - <property name="gravity">GDK_GRAVITY_NORTH_WEST</property> - <property name="has_separator">False</property> - - <child internal-child="vbox"> - <widget class="GtkVBox" id="dialog-vbox2"> - <property name="visible">True</property> - <property name="homogeneous">False</property> - <property name="spacing">0</property> - - <child internal-child="action_area"> - <widget class="GtkHButtonBox" id="dialog-action_area2"> - <property name="visible">True</property> - <property name="layout_style">GTK_BUTTONBOX_END</property> - - <child> - <widget class="GtkButton" id="cancelbutton1"> - <property name="visible">True</property> - <property name="can_default">True</property> - <property name="can_focus">True</property> - <property name="label">gtk-cancel</property> - <property name="use_stock">True</property> - <property name="relief">GTK_RELIEF_NORMAL</property> - <property name="focus_on_click">True</property> - <property name="response_id">-6</property> - </widget> - </child> - - <child> - <widget class="GtkButton" id="krb5_renew_button"> - <property name="visible">True</property> - <property name="can_default">True</property> - <property name="has_default">True</property> - <property name="can_focus">True</property> - <property name="label" translatable="yes">_Renew Ticket</property> - <property name="use_underline">True</property> - <property name="relief">GTK_RELIEF_NORMAL</property> - <property name="focus_on_click">True</property> - <property name="response_id">-5</property> - </widget> - </child> - </widget> - <packing> - <property name="padding">0</property> - <property name="expand">False</property> - <property name="fill">True</property> - <property name="pack_type">GTK_PACK_END</property> - </packing> - </child> - - <child> - <widget class="GtkHBox" id="hbox1"> - <property name="border_width">6</property> - <property name="visible">True</property> - <property name="homogeneous">False</property> - <property name="spacing">12</property> - - <child> - <widget class="GtkImage" id="image1"> - <property name="visible">True</property> - <property name="stock">gtk-dialog-authentication</property> - <property name="icon_size">6</property> - <property name="xalign">0.5</property> - <property name="yalign">0</property> - <property name="xpad">0</property> - <property name="ypad">0</property> - </widget> - <packing> - <property name="padding">0</property> - <property name="expand">False</property> - <property name="fill">True</property> - </packing> - </child> - - <child> - <widget class="GtkAlignment" id="alignment4"> - <property name="visible">True</property> - <property name="xalign">0.5</property> - <property name="yalign">0.5</property> - <property name="xscale">1</property> - <property name="yscale">1</property> - <property name="top_padding">0</property> - <property name="bottom_padding">10</property> - <property name="left_padding">0</property> - <property name="right_padding">0</property> - - <child> - <widget class="GtkVBox" id="vbox2"> - <property name="visible">True</property> - <property name="homogeneous">False</property> - <property name="spacing">12</property> - - <child> - <widget class="GtkVBox" id="vbox1"> - <property name="visible">True</property> - <property name="homogeneous">False</property> - <property name="spacing">0</property> - - <child> - <widget class="GtkLabel" id="krb5_message_label"> - <property name="visible">True</property> - <property name="label" translatable="no"></property> - <property name="use_underline">False</property> - <property name="use_markup">True</property> - <property name="justify">GTK_JUSTIFY_LEFT</property> - <property name="wrap">False</property> - <property name="selectable">False</property> - <property name="xalign">0</property> - <property name="yalign">0.5</property> - <property name="xpad">0</property> - <property name="ypad">0</property> - </widget> - <packing> - <property name="padding">0</property> - <property name="expand">False</property> - <property name="fill">False</property> - </packing> - </child> - </widget> - <packing> - <property name="padding">0</property> - <property name="expand">True</property> - <property name="fill">True</property> - </packing> - </child> - - <child> - <widget class="GtkVBox" id="vbox3"> - <property name="visible">True</property> - <property name="homogeneous">False</property> - <property name="spacing">3</property> - - <child> - <widget class="GtkHBox" id="hbox5"> - <property name="visible">True</property> - <property name="homogeneous">False</property> - <property name="spacing">3</property> - - <child> - <widget class="GtkLabel" id="label5"> - <property name="visible">True</property> - <property name="label" translatable="yes">_Password:</property> - <property name="use_underline">True</property> - <property name="use_markup">False</property> - <property name="justify">GTK_JUSTIFY_LEFT</property> - <property name="wrap">False</property> - <property name="selectable">False</property> - <property name="xalign">0.5</property> - <property name="yalign">0.5</property> - <property name="xpad">0</property> - <property name="ypad">0</property> - <property name="mnemonic_widget">krb5_entry</property> - </widget> - <packing> - <property name="padding">0</property> - <property name="expand">False</property> - <property name="fill">False</property> - </packing> - </child> - - <child> - <widget class="Custom" id="krb5_entry"> - <property name="visible">True</property> - <property name="can_focus">True</property> - <property name="editable">True</property> - <property name="visibility">False</property> - <property name="max_length">0</property> - <property name="text" translatable="no"></property> - <property name="has_frame">True</property> - <property name="activates_default">True</property> - </widget> - <packing> - <property name="padding">0</property> - <property name="expand">True</property> - <property name="fill">True</property> - </packing> - </child> - </widget> - <packing> - <property name="padding">0</property> - <property name="expand">True</property> - <property name="fill">True</property> - </packing> - </child> - - <child> - <widget class="GtkLabel" id="krb5_status_label"> - <property name="visible">True</property> - <property name="label" translatable="no"><span size="smaller"> </span></property> - <property name="use_underline">False</property> - <property name="use_markup">True</property> - <property name="justify">GTK_JUSTIFY_LEFT</property> - <property name="wrap">False</property> - <property name="selectable">False</property> - <property name="xalign">1</property> - <property name="yalign">0.5</property> - <property name="xpad">0</property> - <property name="ypad">0</property> - </widget> - <packing> - <property name="padding">0</property> - <property name="expand">False</property> - <property name="fill">False</property> - </packing> - </child> - </widget> - <packing> - <property name="padding">0</property> - <property name="expand">True</property> - <property name="fill">True</property> - </packing> - </child> - </widget> - </child> - </widget> - <packing> - <property name="padding">0</property> - <property name="expand">True</property> - <property name="fill">True</property> - </packing> - </child> - </widget> - <packing> - <property name="padding">0</property> - <property name="expand">True</property> - <property name="fill">True</property> - </packing> - </child> - </widget> - </child> -</widget> - + <widget class="GtkDialog" id="krb5_dialog"> + <property name="border_width">6</property> + <property name="title" translatable="yes">Network Authentication</property> + <property name="resizable">False</property> + <property name="window_position">GTK_WIN_POS_CENTER</property> + <property name="type_hint">GDK_WINDOW_TYPE_HINT_NORMAL</property> + <property name="has_separator">False</property> + <child internal-child="vbox"> + <widget class="GtkVBox" id="dialog-vbox2"> + <property name="visible">True</property> + <child> + <widget class="GtkHBox" id="hbox1"> + <property name="visible">True</property> + <property name="border_width">6</property> + <property name="spacing">12</property> + <child> + <widget class="GtkImage" id="image1"> + <property name="visible">True</property> + <property name="yalign">0</property> + <property name="stock">gtk-dialog-authentication</property> + <property name="icon_size">6</property> + </widget> + <packing> + <property name="expand">False</property> + </packing> + </child> + <child> + <widget class="GtkAlignment" id="alignment4"> + <property name="visible">True</property> + <property name="bottom_padding">10</property> + <child> + <widget class="GtkVBox" id="vbox2"> + <property name="visible">True</property> + <property name="spacing">12</property> + <child> + <widget class="GtkVBox" id="vbox1"> + <property name="visible">True</property> + <child> + <widget class="GtkLabel" id="krb5_message_label"> + <property name="visible">True</property> + <property name="xalign">0</property> + <property name="use_markup">True</property> + </widget> + <packing> + <property name="expand">False</property> + <property name="fill">False</property> + </packing> + </child> + </widget> + </child> + <child> + <widget class="GtkVBox" id="vbox3"> + <property name="visible">True</property> + <property name="spacing">3</property> + <child> + <widget class="GtkHBox" id="hbox5"> + <property name="visible">True</property> + <property name="spacing">3</property> + <child> + <widget class="Custom" id="krb5_entry"> + <property name="visible">True</property> + <property name="can_focus">True</property> + </widget> + </child> + </widget> + </child> + <child> + <widget class="GtkLabel" id="krb5_status_label"> + <property name="visible">True</property> + <property name="xalign">1</property> + <property name="label"><span size="smaller"> </span></property> + <property name="use_markup">True</property> + </widget> + <packing> + <property name="expand">False</property> + <property name="fill">False</property> + <property name="position">1</property> + </packing> + </child> + </widget> + <packing> + <property name="position">1</property> + </packing> + </child> + </widget> + </child> + </widget> + <packing> + <property name="position">1</property> + </packing> + </child> + </widget> + <packing> + <property name="position">1</property> + </packing> + </child> + <child internal-child="action_area"> + <widget class="GtkHButtonBox" id="dialog-action_area2"> + <property name="visible">True</property> + <property name="layout_style">GTK_BUTTONBOX_END</property> + <child> + <widget class="GtkButton" id="cancelbutton1"> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="can_default">True</property> + <property name="label">gtk-cancel</property> + <property name="use_stock">True</property> + <property name="response_id">-6</property> + </widget> + </child> + <child> + <widget class="GtkButton" id="krb5_renew_button"> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="can_default">True</property> + <property name="has_default">True</property> + <property name="label" translatable="yes">_Renew Ticket</property> + <property name="use_underline">True</property> + <property name="response_id">-5</property> + </widget> + <packing> + <property name="position">1</property> + </packing> + </child> + </widget> + <packing> + <property name="expand">False</property> + <property name="pack_type">GTK_PACK_END</property> + </packing> + </child> + </widget> + </child> + </widget> </glade-interface> diff --git a/src/krb5-auth-pwdialog.c b/src/krb5-auth-pwdialog.c index 7873a8a..b3ed068 100644 --- a/src/krb5-auth-pwdialog.c +++ b/src/krb5-auth-pwdialog.c @@ -191,11 +191,12 @@ ka_pwdialog_setup (KaPwDialog* pwdialog, const gchar *krb5prompt, { KaPwDialogPrivate *priv = pwdialog->priv; gchar *wrong_markup = NULL; + GtkWidget *e; gchar *prompt; int pw4len; if (krb5prompt == NULL) { - prompt = g_strdup (_("Please enter your Kerberos password.")); + prompt = g_strdup (_("Please enter your Kerberos password:")); } else { /* Kerberos's prompts are a mess, and basically impossible to * translate. There's basically no way short of doing a lot of @@ -206,12 +207,17 @@ ka_pwdialog_setup (KaPwDialog* pwdialog, const gchar *krb5prompt, pw4len = strlen ("Password for "); if (strncmp (krb5prompt, "Password for ", pw4len) == 0) { gchar *uid = (gchar *) (krb5prompt + pw4len); - prompt = g_strdup_printf (_("Please enter the password for '%s'"), uid); + prompt = g_strdup_printf (_("Please enter the password for '%s':"), uid); } else { prompt = g_strdup (krb5prompt); } } + e = gtk_entry_new (); + gtk_secure_entry_set_invisible_char (GTK_SECURE_ENTRY (priv->pw_entry), + gtk_entry_get_invisible_char (GTK_ENTRY (e))); + gtk_widget_destroy (e); + /* Clear the password entry field */ gtk_secure_entry_set_text (GTK_SECURE_ENTRY (priv->pw_entry), ""); |