svn rev #24728: trunk/src/ include/krb5/ lib/krb5/ccache/
tsitkova@MIT.EDU
tsitkova at MIT.EDU
Fri Mar 18 16:48:06 EDT 2011
http://src.mit.edu/fisheye/changelog/krb5/?cs=24728
Commit By: tsitkova
Log Message:
Move doxygen comments from source to header. Updated comments and added some usage examples.
Affected functions: krb5_cc_get_config, krb5_cc_set_config, krb5_is_config_principal
Changed Files:
U trunk/src/include/krb5/krb5.hin
U trunk/src/lib/krb5/ccache/ccfns.c
Modified: trunk/src/include/krb5/krb5.hin
===================================================================
--- trunk/src/include/krb5/krb5.hin 2011-03-18 19:12:33 UTC (rev 24727)
+++ trunk/src/include/krb5/krb5.hin 2011-03-18 20:48:06 UTC (rev 24728)
@@ -3938,29 +3938,78 @@
krb5_error_code KRB5_CALLCONV
krb5_cc_copy_creds(krb5_context context, krb5_ccache incc, krb5_ccache outcc);
+/** Get some configuration for the credential cache in the cache.
+ *
+ * @param context a Keberos context [input]
+ * @param id the credential cache to store the data for [input]
+ * @param principal configuration for a specific principal, if NULL, global for the whole cache.[input]
+ * @param key name under which the configuraion is stored [input]
+ * @param data data to be fetched; free with krb5_free_data_contents() [input,output]
+ *
+ * @code
+ * krb5_data config_data;
+ * config_data.data = NULL;
+ * krb5_cc_get_config(context, ccache, target_principal, key, &config_data);
+ * ...
+ * krb5_free_data_contents(context, &config_data);
+ * @endcode
+ *
+ * @retval
+ * 0 Success
+ * @return
+ * Kerberos error codes
+ */
krb5_error_code KRB5_CALLCONV
krb5_cc_get_config(krb5_context context, krb5_ccache id,
krb5_const_principal principal,
const char *key, krb5_data *data);
+/** Store some configuration for the credential cache in the cache.
+ *
+ * @param context a Keberos context [input,output]
+ * @param id the credential cache to store the data for. [input]
+ * @param principal configuration for a specific principal; if NULL, global for the whole cache.[input]
+ * @param key name under which the configuraion is stored.[input]
+ * @param data data to store. [input]
+ *
+ * @note Existing configuration under the same key is over-written.
+ *
+ * @code
+ * config_data.data = "yes";
+ * config_data.length = strlen(config_data.data);
+ * krb5_cc_set_config(context, id, principal,key, &config_data);
+ * @endcode
+ *
+ * @retval
+ * 0 Success
+ * @return
+ * Kerberos error codes
+ */
krb5_error_code KRB5_CALLCONV
krb5_cc_set_config(krb5_context context, krb5_ccache id,
krb5_const_principal principal,
const char *key, krb5_data *data);
+/** Test whether a principal is a configuration principal.
+ *
+ * @param context a Keberos context [input]
+ * @param principal principal to check if it a configuration principal [input]
+ *
+ * @return Return TRUE (non zero) if the principal is a configuration
+ * principal (generated part of krb5_cc_set_config()). Returns
+ * FALSE (zero) if not a configuration principal.
+ */
krb5_boolean KRB5_CALLCONV
krb5_is_config_principal(krb5_context context, krb5_const_principal principal);
/* krb5_free.c */
-/**
- * @brief Free a principal structure.
+/** Free a principal structure.
*
* @param context Context structure [input, output]
- * @param val Pointer to data structure to be freed [input, output]
+ * @param val Pointer to data structure to be freed [input,output]
*
* @return
* None
- *
*/
void KRB5_CALLCONV
krb5_free_principal(krb5_context context, krb5_principal val);
Modified: trunk/src/lib/krb5/ccache/ccfns.c
===================================================================
--- trunk/src/lib/krb5/ccache/ccfns.c 2011-03-18 19:12:33 UTC (rev 24727)
+++ trunk/src/lib/krb5/ccache/ccfns.c 2011-03-18 20:48:06 UTC (rev 24728)
@@ -1,5 +1,5 @@
/* -*- mode: c; c-basic-offset: 4; indent-tabs-mode: nil -*- */
-/* lib/krb5/ccache/ccfns.c */
+/* lib/krb5/ccache/ccfns.c - Dispatch methods for credentials cache code.*/
/*
* Copyright 2000, 2007, 2008 by the Massachusetts Institute of Technology.
* All Rights Reserved.
@@ -24,10 +24,6 @@
* or implied warranty.
*/
-/*
- * Dispatch methods for credentials cache code.
- */
-
#include "k5-int.h"
const char * KRB5_CALLCONV
@@ -226,7 +222,7 @@
ret = krb5_build_principal(context, &cred->server,
sizeof(conf_realm) - 1, conf_realm,
conf_name, name, pname, (char *)NULL);
- free(pname);
+ krb5_free_unparsed_name(context, pname);
if (ret) {
krb5_free_principal(context, client);
return ret;
@@ -236,16 +232,6 @@
return ret;
}
-/*!
- * \param context a Keberos context
- * \param principal principal to check if it a configuration principal
- *
- * \brief Return TRUE (non zero) if the principal is a configuration
- * principal (generated part of krb5_cc_set_config()). Returns
- * FALSE (zero) if not a configuration principal.
- *
- */
-
krb5_boolean KRB5_CALLCONV
krb5_is_config_principal (krb5_context context,
krb5_const_principal principal)
@@ -266,20 +252,6 @@
return TRUE;
}
-/*!
- * \param context a Keberos context
- * \param id the credential cache to store the data for
- * \param principal configuration for a specific principal, if
- * NULL, global for the whole cache.
- * \param key name under which the configuraion is stored.
- * \param data data to store
- *
- * \brief Store some configuration for the credential cache in the
- * cache. Existing configuration under the same key is
- * over-written.
- *
- */
-
krb5_error_code KRB5_CALLCONV
krb5_cc_set_config (krb5_context context, krb5_ccache id,
krb5_const_principal principal,
@@ -310,18 +282,6 @@
return ret;
}
-/*!
- * \param context a Keberos context
- * \param id the credential cache to store the data for
- * \param principal configuration for a specific principal, if
- * NULL, global for the whole cache.
- * \param key name under which the configuraion is stored.
- * \param data data to fetched, free with krb5_data_free()
- *
- * \brief Get some configuration for the credential cache in the cache.
- */
-
-
krb5_error_code KRB5_CALLCONV
krb5_cc_get_config (krb5_context context, krb5_ccache id,
krb5_const_principal principal,
More information about the cvs-krb5
mailing list