From 7866d861da50a0347e7592028f4cc7c0e71c8fec Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Love=20H=C3=B6rnquist=20=C3=85strand?= Date: Tue, 13 Apr 2004 11:55:32 +0000 Subject: [PATCH] add krb5_cc_get_prefix_ops git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@13702 ec53bebd-3082-4978-b11e-865c3cabbd6b --- lib/krb5/cache.c | 17 +++++++++++++++++ lib/krb5/krb5_ccache.3 | 25 ++++++++++++++++++++----- 2 files changed, 37 insertions(+), 5 deletions(-) diff --git a/lib/krb5/cache.c b/lib/krb5/cache.c index ab95cdf4c..1e786e6a8 100644 --- a/lib/krb5/cache.c +++ b/lib/krb5/cache.c @@ -480,3 +480,20 @@ krb5_cc_clear_mcred(krb5_creds *mcred) { memset(mcred, 0, sizeof(*mcred)); } + +/* + * Get the cc ops that is registered in `context' to handle the + * `prefix'. Returns NULL if ops not found. + */ + +const krb5_cc_ops * +krb5_cc_get_prefix_ops(krb5_context context, const char *prefix) +{ + int i; + + for(i = 0; i < context->num_cc_ops && context->cc_ops[i].prefix; i++) { + if(strcmp(context->cc_ops[i].prefix, prefix) == 0) + return &context->cc_ops[i]; + } + return NULL; +} diff --git a/lib/krb5/krb5_ccache.3 b/lib/krb5/krb5_ccache.3 index f15ee375b..5ededd8c0 100644 --- a/lib/krb5/krb5_ccache.3 +++ b/lib/krb5/krb5_ccache.3 @@ -31,7 +31,7 @@ .\" .\" $Id$ .\" -.Dd March 16, 2003 +.Dd April 13, 2004 .Dt KRB5_CCACHE 3 .Os HEIMDAL .Sh NAME @@ -49,19 +49,20 @@ .Nm krb5_cc_end_seq_get , .Nm krb5_cc_gen_new , .Nm krb5_cc_get_name , +.Nm krb5_cc_get_ops , +.Nm krb5_cc_get_prefix_ops , .Nm krb5_cc_get_principal , .Nm krb5_cc_get_type , -.Nm krb5_cc_get_ops , .Nm krb5_cc_get_version , .Nm krb5_cc_initialize , +.Nm krb5_cc_next_cred .Nm krb5_cc_register , +.Nm krb5_cc_remove_cred , .Nm krb5_cc_resolve , .Nm krb5_cc_retrieve_cred , -.Nm krb5_cc_remove_cred , .Nm krb5_cc_set_default_name , -.Nm krb5_cc_store_cred , .Nm krb5_cc_set_flags , -.Nm krb5_cc_next_cred +.Nm krb5_cc_store_cred , .Nd mange credential cache .Sh LIBRARY Kerberos 5 Library (libkrb5, -lkrb5) @@ -140,6 +141,11 @@ Kerberos 5 Library (libkrb5, -lkrb5) .Fa "krb5_context *context" .Fa "krb5_ccache id" .Fc +.Ft "const krb5_cc_ops *" +.Fo krb5_cc_get_prefix_ops +.Fa "krb5_context context" +.Fa "const char *prefix" +.Fc .Ft krb5_error_code .Fo krb5_cc_get_version .Fa "krb5_context *context" @@ -315,6 +321,15 @@ overwriting any existing one if .Fa override . Return an error code or 0. .Pp +.Fn krb5_cc_get_prefix_ops +Get the cc ops that is registered in +.Fa context +to handle the +.Fa prefix . +Returns +.Dv NULL +if ops not found. +.Pp .Fn krb5_cc_remove_cred removes the credential identified by .Fa ( cred ,