aboutsummaryrefslogtreecommitdiff
path: root/lib/libgssapi/gss_inquire_cred_by_mech.c
diff options
context:
space:
mode:
authorDoug Rabson <dfr@FreeBSD.org>2008-05-07 13:53:12 +0000
committerDoug Rabson <dfr@FreeBSD.org>2008-05-07 13:53:12 +0000
commit33f12199250a09b573f7a518b523fdac3f120b8f (patch)
tree1338a6c0e5d3e7c3b0da720ac15cd79fc72c6b5a /lib/libgssapi/gss_inquire_cred_by_mech.c
parent4fe54d7c6acb302aacc6ac18798804b26c882c13 (diff)
downloadsrc-33f12199250a09b573f7a518b523fdac3f120b8f.tar.gz
src-33f12199250a09b573f7a518b523fdac3f120b8f.zip
Fix conflicts after heimdal-1.1 import and add build infrastructure. Import
all non-style changes made by heimdal to our own libgssapi.
Notes
Notes: svn path=/head/; revision=178828
Diffstat (limited to 'lib/libgssapi/gss_inquire_cred_by_mech.c')
-rw-r--r--lib/libgssapi/gss_inquire_cred_by_mech.c24
1 files changed, 19 insertions, 5 deletions
diff --git a/lib/libgssapi/gss_inquire_cred_by_mech.c b/lib/libgssapi/gss_inquire_cred_by_mech.c
index 2896f77c1e74..d9c21bac2156 100644
--- a/lib/libgssapi/gss_inquire_cred_by_mech.c
+++ b/lib/libgssapi/gss_inquire_cred_by_mech.c
@@ -49,6 +49,14 @@ gss_inquire_cred_by_mech(OM_uint32 *minor_status,
struct _gss_name *name;
*minor_status = 0;
+ if (cred_name)
+ *cred_name = GSS_C_NO_NAME;
+ if (initiator_lifetime)
+ *initiator_lifetime = 0;
+ if (acceptor_lifetime)
+ *acceptor_lifetime = 0;
+ if (cred_usage)
+ *cred_usage = 0;
m = _gss_find_mech_switch(mech_type);
if (!m)
@@ -68,15 +76,21 @@ gss_inquire_cred_by_mech(OM_uint32 *minor_status,
major_status = m->gm_inquire_cred_by_mech(minor_status, mc, mech_type,
&mn, initiator_lifetime, acceptor_lifetime, cred_usage);
- if (major_status != GSS_S_COMPLETE)
+ if (major_status != GSS_S_COMPLETE) {
+ _gss_mg_error(m, major_status, *minor_status);
return (major_status);
+ }
- name = _gss_make_name(m, mn);
- if (!name) {
+ if (cred_name) {
+ name = _gss_make_name(m, mn);
+ if (!name) {
+ m->gm_release_name(minor_status, &mn);
+ return (GSS_S_NO_CRED);
+ }
+ *cred_name = (gss_name_t) name;
+ } else {
m->gm_release_name(minor_status, &mn);
- return (GSS_S_NO_CRED);
}
- *cred_name = (gss_name_t) name;
return (GSS_S_COMPLETE);
}