RIP BOOL. Convert BOOL -> bool. I found a few interesting
[amitay/samba.git] / source3 / libsmb / namequery_dc.c
index 7dac69e2db127960ad9b619bffa290602a36a670..16d8414b8f0bf7460fda4d811ea791c5ad26ad9d 100644 (file)
@@ -29,7 +29,7 @@
 **********************************************************************/
 
 #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();
 
@@ -46,7 +46,7 @@ static BOOL is_our_primary_domain(const char *domain)
  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)
@@ -98,15 +98,22 @@ static BOOL ads_dc_name(const char *domain,
                }
 
 #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;
@@ -141,14 +148,14 @@ static BOOL ads_dc_name(const char *domain,
  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 */
        
@@ -161,7 +168,7 @@ static BOOL rpc_dc_name(const char *domain, fstring srv_name, struct in_addr *ip
        /* 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)) {
@@ -199,13 +206,13 @@ static BOOL rpc_dc_name(const char *domain, fstring srv_name, struct in_addr *ip
  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;