(krb5_sname_to_principal): use krb5_expand_hostname_realms
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@7781 ec53bebd-3082-4978-b11e-865c3cabbd6b
This commit is contained in:
@@ -856,8 +856,7 @@ krb5_524_conv_principal(krb5_context context,
|
|||||||
|
|
||||||
/*
|
/*
|
||||||
* Create a principal in `ret_princ' for the service `sname' running
|
* Create a principal in `ret_princ' for the service `sname' running
|
||||||
* on host `hostname'.
|
* on host `hostname'. */
|
||||||
*/
|
|
||||||
|
|
||||||
krb5_error_code
|
krb5_error_code
|
||||||
krb5_sname_to_principal (krb5_context context,
|
krb5_sname_to_principal (krb5_context context,
|
||||||
@@ -879,15 +878,17 @@ krb5_sname_to_principal (krb5_context context,
|
|||||||
if(sname == NULL)
|
if(sname == NULL)
|
||||||
sname = "host";
|
sname = "host";
|
||||||
if(type == KRB5_NT_SRV_HST) {
|
if(type == KRB5_NT_SRV_HST) {
|
||||||
ret = krb5_expand_hostname (context, hostname, &host);
|
ret = krb5_expand_hostname_realms (context, hostname,
|
||||||
|
&host, &realms);
|
||||||
if (ret)
|
if (ret)
|
||||||
return ret;
|
return ret;
|
||||||
strlwr(host);
|
strlwr(host);
|
||||||
hostname = host;
|
hostname = host;
|
||||||
|
} else {
|
||||||
|
ret = krb5_get_host_realm(context, hostname, &realms);
|
||||||
|
if(ret)
|
||||||
|
return ret;
|
||||||
}
|
}
|
||||||
ret = krb5_get_host_realm(context, hostname, &realms);
|
|
||||||
if(ret)
|
|
||||||
return ret;
|
|
||||||
|
|
||||||
ret = krb5_make_principal(context, ret_princ, realms[0], sname,
|
ret = krb5_make_principal(context, ret_princ, realms[0], sname,
|
||||||
hostname, NULL);
|
hostname, NULL);
|
||||||
|
Reference in New Issue
Block a user