svn rev #25040: trunk/src/lib/gssapi/krb5/
ghudson@MIT.EDU
ghudson at MIT.EDU
Sat Jul 23 09:15:10 EDT 2011
http://src.mit.edu/fisheye/changelog/krb5/?cs=25040
Commit By: ghudson
Log Message:
Clean up the lock in gss_krb5int_import_cred.
Changed Files:
U trunk/src/lib/gssapi/krb5/acquire_cred.c
Modified: trunk/src/lib/gssapi/krb5/acquire_cred.c
===================================================================
--- trunk/src/lib/gssapi/krb5/acquire_cred.c 2011-07-22 18:59:08 UTC (rev 25039)
+++ trunk/src/lib/gssapi/krb5/acquire_cred.c 2011-07-23 13:15:09 UTC (rev 25040)
@@ -845,6 +845,17 @@
memset(&args, 0, sizeof(args));
+ if (req->id && req->keytab)
+ args.cred_usage = GSS_C_BOTH;
+ else if (req->id)
+ args.cred_usage = GSS_C_INITIATE;
+ else if (req->keytab)
+ args.cred_usage = GSS_C_ACCEPT;
+ else {
+ *minor_status = EINVAL;
+ return GSS_S_FAILURE;
+ }
+
if (req->keytab_principal) {
memset(&name, 0, sizeof(name));
code = k5_mutex_init(&name.lock);
@@ -859,17 +870,9 @@
args.ccache = req->id;
args.keytab = req->keytab;
- if (req->id && req->keytab)
- args.cred_usage = GSS_C_BOTH;
- else if (req->id)
- args.cred_usage = GSS_C_INITIATE;
- else if (req->keytab)
- args.cred_usage = GSS_C_ACCEPT;
- else {
- *minor_status = EINVAL;
- return GSS_S_FAILURE;
- }
-
- return acquire_cred(minor_status, &args, cred_handle, &time_rec);
+ code = acquire_cred(minor_status, &args, cred_handle, &time_rec);
+ if (req->keytab_principal)
+ k5_mutex_destroy(&name.lock);
+ return code;
}
More information about the cvs-krb5
mailing list