(krb5_get_default_realms): add
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@7046 ec53bebd-3082-4978-b11e-865c3cabbd6b
This commit is contained in:
@@ -40,16 +40,38 @@
|
|||||||
|
|
||||||
RCSID("$Id$");
|
RCSID("$Id$");
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Return a NULL-terminated list of default realms in `realms'.
|
||||||
|
* Free this memory with krb5_free_host_realm.
|
||||||
|
*/
|
||||||
|
|
||||||
|
krb5_error_code
|
||||||
|
krb5_get_default_realms (krb5_context context,
|
||||||
|
krb5_realm **realms)
|
||||||
|
{
|
||||||
|
if (context->default_realms == NULL)
|
||||||
|
return KRB5_CONFIG_NODEFREALM;
|
||||||
|
|
||||||
|
return krb5_copy_host_realm (context,
|
||||||
|
context->default_realms,
|
||||||
|
realms);
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Return the first default realm. For compatability.
|
||||||
|
*/
|
||||||
|
|
||||||
krb5_error_code
|
krb5_error_code
|
||||||
krb5_get_default_realm(krb5_context context,
|
krb5_get_default_realm(krb5_context context,
|
||||||
krb5_realm *realm)
|
krb5_realm *realm)
|
||||||
{
|
{
|
||||||
char *res;
|
char *res;
|
||||||
|
|
||||||
if (context->default_realm == NULL)
|
if (context->default_realms == NULL
|
||||||
|
|| context->default_realms[0] == NULL)
|
||||||
return KRB5_CONFIG_NODEFREALM;
|
return KRB5_CONFIG_NODEFREALM;
|
||||||
|
|
||||||
res = strdup (context->default_realm);
|
res = strdup (context->default_realms[0]);
|
||||||
if (res == NULL)
|
if (res == NULL)
|
||||||
return ENOMEM;
|
return ENOMEM;
|
||||||
*realm = res;
|
*realm = res;
|
||||||
|
Reference in New Issue
Block a user