diff options
author | Luke Howard <lukeh@padl.com> | 2011-04-08 00:39:21 +0000 |
---|---|---|
committer | Luke Howard <lukeh@padl.com> | 2011-04-08 00:39:21 +0000 |
commit | 1bc2b00c9a397ef2696a152bf836f48f9d298250 (patch) | |
tree | 31a7dc934ae86f76e260168d94bb4dfe0aa0a736 /src/lib/gssapi | |
parent | 5a9704fd916cfd87e7f25490b52fa438c6ad066a (diff) | |
download | krb5-1bc2b00c9a397ef2696a152bf836f48f9d298250.zip krb5-1bc2b00c9a397ef2696a152bf836f48f9d298250.tar.gz krb5-1bc2b00c9a397ef2696a152bf836f48f9d298250.tar.bz2 |
remove redundant import_name call
git-svn-id: svn://anonsvn.mit.edu/krb5/users/lhoward/moonshot-mechglue-fixes@24858 dc483132-0cff-0310-8789-dd5450dbe970
Diffstat (limited to 'src/lib/gssapi')
-rw-r--r-- | src/lib/gssapi/mechglue/g_userok.c | 46 |
1 files changed, 15 insertions, 31 deletions
diff --git a/src/lib/gssapi/mechglue/g_userok.c b/src/lib/gssapi/mechglue/g_userok.c index 31b1db4..48d018a 100644 --- a/src/lib/gssapi/mechglue/g_userok.c +++ b/src/lib/gssapi/mechglue/g_userok.c @@ -122,49 +122,32 @@ static OM_uint32 compare_names_authorize_localname(OM_uint32 *minor, const gss_OID mech_type, const gss_name_t name, - gss_const_buffer_t user, + const gss_name_t user, int *user_ok) { OM_uint32 status, tmpMinor; - gss_name_t imported_name; gss_name_t canon_name; int match = 0; *user_ok = 0; - if (mech_type == GSS_C_NO_OID) - return (GSS_S_BAD_NAME); - - status = gss_import_name(minor, - (gss_buffer_t)user, - GSS_C_NT_USER_NAME, - &imported_name); - if (status != GSS_S_COMPLETE) { - goto out; - } - status = gss_canonicalize_name(minor, - imported_name, - mech_type, - &canon_name); - if (status != GSS_S_COMPLETE) { - (void) gss_release_name(&tmpMinor, &imported_name); - goto out; - } + user, + mech_type, + &canon_name); + if (status != GSS_S_COMPLETE) + return (status); status = gss_compare_name(minor, - canon_name, - name, - &match); + canon_name, + name, + &match); + if (status == GSS_S_COMPLETE && match) + *user_ok = 1; /* remote user is a-ok */ + (void) gss_release_name(&tmpMinor, &canon_name); - (void) gss_release_name(&tmpMinor, &imported_name); - if (status == GSS_S_COMPLETE) { - if (match) - *user_ok = 1; /* remote user is a-ok */ - } -out: return (status); } @@ -207,11 +190,12 @@ gss_authorize_localname(OM_uint32 *minor, return (GSS_S_COMPLETE); /* If mech returns unavail, we compare the local name */ - if (major == GSS_S_UNAVAILABLE) { + if (major == GSS_S_UNAVAILABLE && + unionName->mech_type != GSS_C_NO_OID) { major = compare_names_authorize_localname(minor, unionName->mech_type, name, - unionUser->external_name, + user, user_ok); } |