(krb5_sname_to_principal): use getipnodebyname
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@6615 ec53bebd-3082-4978-b11e-865c3cabbd6b
This commit is contained in:
@@ -851,12 +851,19 @@ 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){
|
||||||
struct hostent *hp;
|
struct hostent *hp = NULL;
|
||||||
hp = roken_gethostbyname(hostname);
|
int error;
|
||||||
|
|
||||||
|
#ifdef HAVE_IPV6
|
||||||
|
if (hp == NULL)
|
||||||
|
hp = getipnodebyname (hostname, AF_INET6, 0, &error);
|
||||||
|
#endif
|
||||||
|
if (hp == NULL)
|
||||||
|
hp = getipnodebyname (hostname, AF_INET, 0, &error);
|
||||||
if(hp != NULL)
|
if(hp != NULL)
|
||||||
hostname = hp->h_name;
|
hostname = hp->h_name;
|
||||||
}
|
}
|
||||||
if(type == KRB5_NT_SRV_HST){
|
if(type == KRB5_NT_SRV_HST) {
|
||||||
host = strdup(hostname);
|
host = strdup(hostname);
|
||||||
if(host == NULL){
|
if(host == NULL){
|
||||||
return ENOMEM;
|
return ENOMEM;
|
||||||
|
Reference in New Issue
Block a user