**********************************************************************/
#ifdef HAVE_KRB5
-static BOOL is_our_primary_domain(const char *domain)
+static bool is_our_primary_domain(const char *domain)
{
int role = lp_server_role();
Find the name and IP address for a server in the realm/domain
*************************************************************************/
-static BOOL ads_dc_name(const char *domain,
+static bool ads_dc_name(const char *domain,
const char *realm,
struct in_addr *dc_ip,
fstring srv_name)
}
#ifdef HAVE_KRB5
- if (is_our_primary_domain(domain) && (ads->config.flags & ADS_KDC) && ads_closest_dc(ads)) {
- /* We're going to use this KDC for this realm/domain.
- If we are using sites, then force the krb5 libs
- to use this KDC. */
-
- create_local_private_krb5_conf_for_domain(realm,
- domain,
- sitename,
- ads->ldap.ip);
+ if (is_our_primary_domain(domain) && (ads->config.flags & ADS_KDC)) {
+ if (ads_closest_dc(ads)) {
+ /* We're going to use this KDC for this realm/domain.
+ If we are using sites, then force the krb5 libs
+ to use this KDC. */
+
+ create_local_private_krb5_conf_for_domain(realm,
+ domain,
+ sitename,
+ ads->ldap.ip);
+ } else {
+ create_local_private_krb5_conf_for_domain(realm,
+ domain,
+ NULL,
+ ads->ldap.ip);
+ }
}
#endif
break;
valid since we have already done a name_status_find on it
***************************************************************************/
-static BOOL rpc_dc_name(const char *domain, fstring srv_name, struct in_addr *ip_out)
+static bool rpc_dc_name(const char *domain, fstring srv_name, struct in_addr *ip_out)
{
struct ip_service *ip_list = NULL;
struct in_addr dc_ip, exclude_ip;
int count, i;
NTSTATUS result;
- zero_ip(&exclude_ip);
+ zero_ip_v4(&exclude_ip);
/* get a list of all domain controllers */
/* Remove the entry we've already failed with (should be the PDC). */
for (i = 0; i < count; i++) {
- if (is_zero_ip(ip_list[i].ip))
+ if (is_zero_ip_v4(ip_list[i].ip))
continue;
if (name_status_find(domain, 0x1c, 0x20, ip_list[i].ip, srv_name)) {
wrapper around ads and rpc methods of finds DC's
**********************************************************************/
-BOOL get_dc_name(const char *domain, const char *realm, fstring srv_name, struct in_addr *ip_out)
+bool get_dc_name(const char *domain, const char *realm, fstring srv_name, struct in_addr *ip_out)
{
struct in_addr dc_ip;
- BOOL ret;
- BOOL our_domain = False;
+ bool ret;
+ bool our_domain = False;
- zero_ip(&dc_ip);
+ zero_ip_v4(&dc_ip);
ret = False;