Simplify user_realm support by removing krb5_parse_name_flags_realm()

and setting the realm as necessary in the caller.
This commit is contained in:
Viktor Dukhovni
2013-05-17 00:38:49 +00:00
committed by Viktor Dukhovni
parent 203e2beedd
commit 2433496ea6
4 changed files with 19 additions and 48 deletions

View File

@@ -188,30 +188,6 @@ krb5_parse_name_flags(krb5_context context,
const char *name,
int flags,
krb5_principal *principal)
{
return krb5_parse_name_flags_realm(context, name, flags, NULL, principal);
}
/**
* Parse a name into a krb5_principal structure, flags controls the behavior.
*
* @param context Kerberos 5 context
* @param name name to parse into a Kerberos principal
* @param flags flags to control the behavior
* @param realm, default realm, uses config-default if NULL.
* @param principal returned principal, free with krb5_free_principal().
*
* @return An krb5 error code, see krb5_get_error_message().
*
* @ingroup krb5_principal
*/
KRB5_LIB_FUNCTION krb5_error_code KRB5_LIB_CALL
krb5_parse_name_flags_realm(krb5_context context,
const char *name,
int flags,
const char *def_realm,
krb5_principal *principal)
{
krb5_error_code ret;
heim_general_string *comp;
@@ -347,16 +323,10 @@ krb5_parse_name_flags_realm(krb5_context context,
goto exit;
} else if (no_realm || no_def_realm) {
realm = NULL;
} else if (def_realm == NULL) {
} else {
ret = krb5_get_default_realm(context, &realm);
if (ret)
goto exit;
} else {
realm = strdup(def_realm);
if (realm == NULL) {
ret = krb5_enomem(context);
goto exit;
}
}
comp[n] = malloc(q - start + 1);