From 9d5cdf24ef40097737cdb3ecd2ac1331653b471f Mon Sep 17 00:00:00 2001 From: Guido Günther Date: Fri, 24 Apr 2009 11:28:49 +0200 Subject: Imported Upstream version 0.9+0gitec60300 --- AUTHORS | 3 + ChangeLog | 46 ++++++ NEWS | 15 ++ configure.ac | 2 +- gtksecentry/gtksecentry.c | 13 +- src/krb5-auth-applet.c | 35 ++++- src/krb5-auth-dialog.c | 16 +- src/krb5-auth-dialog.glade | 385 ++++++++++++++++----------------------------- src/krb5-auth-pwdialog.c | 10 +- 9 files changed, 250 insertions(+), 275 deletions(-) diff --git a/AUTHORS b/AUTHORS index 695d287..7063480 100644 --- a/AUTHORS +++ b/AUTHORS @@ -2,3 +2,6 @@ Christopher Aillon Jonathan Blandford Colin Walters Guido Günther + +Patches have been contributed by: +Matthias Clasen diff --git a/ChangeLog b/ChangeLog index 3a03eae..fc49cf3 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,49 @@ +Fri Apr 24 10:48:30 CEST 2009 Guido Günther + + * 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 + + * 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 + + * AUTHORS: add Matthias Clasen + +Fri Apr 24 09:35:59 CEST 2009 Guido Günther + + * 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 + + * configure.ac: release 0.9 + +Do Apr 23 11:19:46 CEST 2009 Guido Günther + + * Update NEWS + +Thu Apr 23 11:17:28 CEST 2009 Guido Günther + + 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 + + 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 * src/krb5-auth-gconf.c (ka_gconf_set_principal): handle length zero diff --git a/NEWS b/NEWS index 17c7b25..ac710cf 100644 --- a/NEWS +++ b/NEWS @@ -1,3 +1,18 @@ +=========== +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 =========== 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 @@ - - - + + + - - - - 6 - False - Network Authentication - GTK_WINDOW_TOPLEVEL - GTK_WIN_POS_CENTER - False - False - False - True - False - False - GDK_WINDOW_TYPE_HINT_NORMAL - GDK_GRAVITY_NORTH_WEST - False - - - - True - False - 0 - - - - True - GTK_BUTTONBOX_END - - - - True - True - True - gtk-cancel - True - GTK_RELIEF_NORMAL - True - -6 - - - - - - True - True - True - True - _Renew Ticket - True - GTK_RELIEF_NORMAL - True - -5 - - - - - 0 - False - True - GTK_PACK_END - - - - - - 6 - True - False - 12 - - - - True - gtk-dialog-authentication - 6 - 0.5 - 0 - 0 - 0 - - - 0 - False - True - - - - - - True - 0.5 - 0.5 - 1 - 1 - 0 - 10 - 0 - 0 - - - - True - False - 12 - - - - True - False - 0 - - - - True - - False - True - GTK_JUSTIFY_LEFT - False - False - 0 - 0.5 - 0 - 0 - - - 0 - False - False - - - - - 0 - True - True - - - - - - True - False - 3 - - - - True - False - 3 - - - - True - _Password: - True - False - GTK_JUSTIFY_LEFT - False - False - 0.5 - 0.5 - 0 - 0 - krb5_entry - - - 0 - False - False - - - - - - True - True - True - False - 0 - - True - True - - - 0 - True - True - - - - - 0 - True - True - - - - - - True - <span size="smaller"> </span> - False - True - GTK_JUSTIFY_LEFT - False - False - 1 - 0.5 - 0 - 0 - - - 0 - False - False - - - - - 0 - True - True - - - - - - - 0 - True - True - - - - - 0 - True - True - - - - - - + + 6 + Network Authentication + False + GTK_WIN_POS_CENTER + GDK_WINDOW_TYPE_HINT_NORMAL + False + + + True + + + True + 6 + 12 + + + True + 0 + gtk-dialog-authentication + 6 + + + False + + + + + True + 10 + + + True + 12 + + + True + + + True + 0 + True + + + False + False + + + + + + + True + 3 + + + True + 3 + + + True + True + + + + + + + True + 1 + <span size="smaller"> </span> + True + + + False + False + 1 + + + + + 1 + + + + + + + 1 + + + + + 1 + + + + + True + GTK_BUTTONBOX_END + + + True + True + True + gtk-cancel + True + -6 + + + + + True + True + True + True + _Renew Ticket + True + -5 + + + 1 + + + + + False + GTK_PACK_END + + + + + 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), ""); -- cgit