Quick patch to make 425_conv work somewhat.
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@2637 ec53bebd-3082-4978-b11e-865c3cabbd6b
This commit is contained in:
@@ -422,14 +422,49 @@ krb5_425_conv_principal(krb5_context context,
|
|||||||
const char *realm,
|
const char *realm,
|
||||||
krb5_principal *princ)
|
krb5_principal *princ)
|
||||||
{
|
{
|
||||||
if(!strcmp(name, "rcmd"))
|
const char *p;
|
||||||
name = "host";
|
krb5_error_code ret;
|
||||||
return krb5_build_principal(context, princ,
|
char *domain = NULL;
|
||||||
strlen(realm),
|
p = krb5_config_get_string(context->cf,
|
||||||
realm,
|
"realms",
|
||||||
name,
|
realm,
|
||||||
(instance && instance[0]) ? instance : NULL,
|
"v4_name_convert",
|
||||||
0);
|
name,
|
||||||
|
NULL);
|
||||||
|
if(p)
|
||||||
|
name = p;
|
||||||
|
if(instance[0] == 0)
|
||||||
|
instance = NULL;
|
||||||
|
if(instance){
|
||||||
|
p = krb5_config_get_string(context->cf,
|
||||||
|
"realms",
|
||||||
|
realm,
|
||||||
|
"v4_instance_convert",
|
||||||
|
instance,
|
||||||
|
NULL);
|
||||||
|
if(p)
|
||||||
|
instance = p;
|
||||||
|
else{
|
||||||
|
p = krb5_config_get_string(context->cf,
|
||||||
|
"realms",
|
||||||
|
realm,
|
||||||
|
"default_domain",
|
||||||
|
NULL);
|
||||||
|
if(p){
|
||||||
|
asprintf(&domain, "%s.%s", instance, p);
|
||||||
|
instance = domain;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
ret = krb5_build_principal(context, princ,
|
||||||
|
strlen(realm),
|
||||||
|
realm,
|
||||||
|
name,
|
||||||
|
instance,
|
||||||
|
0);
|
||||||
|
if(domain)
|
||||||
|
free(domain);
|
||||||
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
krb5_error_code
|
krb5_error_code
|
||||||
|
Reference in New Issue
Block a user