mirror of
https://github.com/samba-team/samba.git
synced 2025-03-22 02:50:28 +03:00
r10382: In the absence of client support for the full KDC-side
canonicalisation code, I've hacked Heimdal to use the default realm if no other realm can be determined for a given host. Andrew Bartlett (This used to be commit 0f0b0021b7728ce75ca0060003a3d08264ead810)
This commit is contained in:
parent
e073918771
commit
42f2519b50
@ -187,15 +187,18 @@ _krb5_get_host_realm_int (krb5_context context,
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
*realms = malloc(2 * sizeof(krb5_realm));
|
||||
if (*realms == NULL) {
|
||||
krb5_set_error_string(context, "malloc: out of memory");
|
||||
return ENOMEM;
|
||||
}
|
||||
|
||||
(*realms)[1] = NULL;
|
||||
|
||||
p = strchr(host, '.');
|
||||
if(p != NULL) {
|
||||
p++;
|
||||
*realms = malloc(2 * sizeof(krb5_realm));
|
||||
if (*realms == NULL) {
|
||||
krb5_set_error_string(context, "malloc: out of memory");
|
||||
return ENOMEM;
|
||||
}
|
||||
|
||||
(*realms)[0] = strdup(p);
|
||||
if((*realms)[0] == NULL) {
|
||||
free(*realms);
|
||||
@ -203,11 +206,21 @@ _krb5_get_host_realm_int (krb5_context context,
|
||||
return ENOMEM;
|
||||
}
|
||||
strupr((*realms)[0]);
|
||||
(*realms)[1] = NULL;
|
||||
return 0;
|
||||
} else {
|
||||
krb5_error_code ret;
|
||||
ret = krb5_get_default_realm(context, &(*realms)[0]);
|
||||
if(ret) {
|
||||
free(*realms);
|
||||
krb5_set_error_string(context, "malloc: out of memory");
|
||||
return ENOMEM;
|
||||
}
|
||||
if((*realms)[0] == NULL) {
|
||||
free(*realms);
|
||||
krb5_set_error_string(context, "unable to find realm of host %s", host);
|
||||
return KRB5_ERR_HOST_REALM_UNKNOWN;
|
||||
}
|
||||
}
|
||||
krb5_set_error_string(context, "unable to find realm of host %s", host);
|
||||
return KRB5_ERR_HOST_REALM_UNKNOWN;
|
||||
return 0;
|
||||
}
|
||||
|
||||
/*
|
||||
|
Loading…
x
Reference in New Issue
Block a user