aboutsummaryrefslogtreecommitdiff
path: root/src/krb5-auth-dialog.c
diff options
context:
space:
mode:
authorGuido Günther <agx@sigxcpu.org>2009-04-24 11:28:49 +0200
committerGuido Günther <agx@sigxcpu.org>2009-04-24 11:28:49 +0200
commit9d5cdf24ef40097737cdb3ecd2ac1331653b471f (patch)
tree2df5ea1d5ce717daac6c6b3bf4f071ba3e43b5f2 /src/krb5-auth-dialog.c
parentImported Upstream version 0.9~rc1 (diff)
downloadkrb5-auth-dialog-9d5cdf24ef40097737cdb3ecd2ac1331653b471f.tar.gz
krb5-auth-dialog-9d5cdf24ef40097737cdb3ecd2ac1331653b471f.tar.bz2
krb5-auth-dialog-9d5cdf24ef40097737cdb3ecd2ac1331653b471f.zip
Imported Upstream version 0.9+0gitec60300
Diffstat (limited to 'src/krb5-auth-dialog.c')
-rw-r--r--src/krb5-auth-dialog.c16
1 files changed, 8 insertions, 8 deletions
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;
}
bgstack15