diff options
author | nectar <nectar@FreeBSD.org> | 2004-04-03 21:22:55 +0000 |
---|---|---|
committer | nectar <nectar@FreeBSD.org> | 2004-04-03 21:22:55 +0000 |
commit | bfc5316dea97d244a21b45ed0dce56f39074ba1b (patch) | |
tree | f009994dd04757b68eff8742614cca170aff5bb3 /crypto/heimdal/lib/gssapi/add_cred.c | |
parent | 084fdb0d6e4fe40ab8ff47ca033fdbcb7899aae1 (diff) | |
download | FreeBSD-src-bfc5316dea97d244a21b45ed0dce56f39074ba1b.zip FreeBSD-src-bfc5316dea97d244a21b45ed0dce56f39074ba1b.tar.gz |
Vendor import of Heimdal 0.6.1.
Diffstat (limited to 'crypto/heimdal/lib/gssapi/add_cred.c')
-rw-r--r-- | crypto/heimdal/lib/gssapi/add_cred.c | 56 |
1 files changed, 37 insertions, 19 deletions
diff --git a/crypto/heimdal/lib/gssapi/add_cred.c b/crypto/heimdal/lib/gssapi/add_cred.c index 1e23a5b..53d4f33 100644 --- a/crypto/heimdal/lib/gssapi/add_cred.c +++ b/crypto/heimdal/lib/gssapi/add_cred.c @@ -33,7 +33,7 @@ #include "gssapi_locl.h" -RCSID("$Id: add_cred.c,v 1.2 2003/04/06 00:29:17 lha Exp $"); +RCSID("$Id: add_cred.c,v 1.2.2.1 2003/10/21 21:00:47 lha Exp $"); OM_uint32 gss_add_cred ( OM_uint32 *minor_status, @@ -152,25 +152,43 @@ OM_uint32 gss_add_cred ( goto failure; } - name = krb5_cc_get_name(gssapi_krb5_context, cred->ccache); - if (name == NULL) { - *minor_status = ENOMEM; - goto failure; - } - - asprintf(&type_name, "%s:%s", type, name); - if (type_name == NULL) { - *minor_status = ENOMEM; - goto failure; + if (strcmp(type, "MEMORY") == 0) { + ret = krb5_cc_gen_new(gssapi_krb5_context, &krb5_mcc_ops, + &handle->ccache); + if (ret) { + *minor_status = ret; + goto failure; + } + + ret = krb5_cc_copy_cache(gssapi_krb5_context, cred->ccache, + handle->ccache); + if (ret) { + *minor_status = ret; + goto failure; + } + + } else { + + name = krb5_cc_get_name(gssapi_krb5_context, cred->ccache); + if (name == NULL) { + *minor_status = ENOMEM; + goto failure; + } + + asprintf(&type_name, "%s:%s", type, name); + if (type_name == NULL) { + *minor_status = ENOMEM; + goto failure; + } + + kret = krb5_cc_resolve(gssapi_krb5_context, type_name, + &handle->ccache); + free(type_name); + if (kret) { + *minor_status = kret; + goto failure; + } } - - kret = krb5_cc_resolve(gssapi_krb5_context, type_name, - &handle->ccache); - free(type_name); - if (kret) { - *minor_status = kret; - goto failure; - } } ret = gss_create_empty_oid_set(minor_status, &handle->mechanisms); |