cldap: avoid duplicate definitions so remove ads_cldap.h.
authorGünther Deschner <gd@samba.org>
Mon, 21 Apr 2008 17:59:27 +0000 (19:59 +0200)
committerGünther Deschner <gd@samba.org>
Mon, 21 Apr 2008 18:21:40 +0000 (20:21 +0200)
Guenther
(This used to be commit 538eefe22ad69540b9f73ffaa613d6be045de199)

source3/include/ads_cldap.h [deleted file]
source3/include/includes.h
source3/libads/ldap.c
source3/libsmb/dsgetdcname.c
source3/libsmb/namequery_dc.c
source3/nmbd/nmbd_processlogon.c
source3/utils/net_ads.c
source3/winbindd/winbindd_cm.c

diff --git a/source3/include/ads_cldap.h b/source3/include/ads_cldap.h
deleted file mode 100644 (file)
index 692fc1b..0000000
+++ /dev/null
@@ -1,60 +0,0 @@
-/* 
-   Samba Unix/Linux SMB client library 
-   net ads cldap functions 
-   Copyright (C) 2001 Andrew Tridgell (tridge@samba.org)
-   Copyright (C) 2003 Jim McDonough (jmcd@us.ibm.com)
-
-   This program is free software; you can redistribute it and/or modify
-   it under the terms of the GNU General Public License as published by
-   the Free Software Foundation; either version 3 of the License, or
-   (at your option) any later version.
-   
-   This program is distributed in the hope that it will be useful,
-   but WITHOUT ANY WARRANTY; without even the implied warranty of
-   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-   GNU General Public License for more details.
-   
-   You should have received a copy of the GNU General Public License
-   along with this program.  If not, see <http://www.gnu.org/licenses/>.  
-*/
-
-#ifndef _INCLUDE_ADS_CLDAP_H_
-#define _INCLUDE_ADS_CLDAP_H_
-
-#define MAX_DNS_LABEL 255 + 1
-
-struct cldap_netlogon_reply {
-       uint32 type;
-       uint32 flags;
-       UUID_FLAT guid;
-
-       char forest[MAX_DNS_LABEL];
-       char domain[MAX_DNS_LABEL];
-       char hostname[MAX_DNS_LABEL];
-
-       char netbios_domain[MAX_DNS_LABEL];
-       char netbios_hostname[MAX_DNS_LABEL];
-
-       char unk[MAX_DNS_LABEL];
-       char user_name[MAX_DNS_LABEL];
-       char server_site_name[MAX_DNS_LABEL];
-       char client_site_name[MAX_DNS_LABEL];
-
-       uint32 version;
-       uint16 lmnt_token;
-       uint16 lm20_token;
-};
-
-/* Mailslot or cldap getdcname response flags */
-#define ADS_PDC            0x00000001  /* DC is PDC */
-#define ADS_GC             0x00000004  /* DC is a GC of forest */
-#define ADS_LDAP           0x00000008  /* DC is an LDAP server */
-#define ADS_DS             0x00000010  /* DC supports DS */
-#define ADS_KDC            0x00000020  /* DC is running KDC */
-#define ADS_TIMESERV       0x00000040  /* DC is running time services */
-#define ADS_CLOSEST        0x00000080  /* DC is closest to client */
-#define ADS_WRITABLE       0x00000100  /* DC has writable DS */
-#define ADS_GOOD_TIMESERV  0x00000200  /* DC has hardware clock (and running time) */
-#define ADS_NDNC           0x00000400  /* DomainName is non-domain NC serviced by LDAP server */
-
-#endif /* _INCLUDE_ADS_CLDAP_H_ */
index 06d41957c985e17f19b28eb23ff2ce566e4761a0..70e1b48fa17d1d8de14db8ca4cca24ff0be4b242 100644 (file)
@@ -673,7 +673,6 @@ typedef char fstring[FSTRING_LEN];
 #include "messages.h"
 #include "locking.h"
 #include "smb.h"
-#include "ads_cldap.h"
 #include "nameserv.h"
 #include "secrets.h"
 #include "byteorder.h"
index 99df4ed8a331c398dc2648ec902db09e9fcc63cb..b0f27b598bbdf50d6aa2b1a8b8155ca48cfd038b 100644 (file)
@@ -151,14 +151,14 @@ bool ads_sitename_match(ADS_STRUCT *ads)
 
 bool ads_closest_dc(ADS_STRUCT *ads)
 {
-       if (ads->config.flags & ADS_CLOSEST) {
-               DEBUG(10,("ads_closest_dc: ADS_CLOSEST flag set\n"));
+       if (ads->config.flags & NBT_SERVER_CLOSEST) {
+               DEBUG(10,("ads_closest_dc: NBT_SERVER_CLOSEST flag set\n"));
                return True;
        }
 
        /* not sure if this can ever happen */
        if (ads_sitename_match(ads)) {
-               DEBUG(10,("ads_closest_dc: ADS_CLOSEST flag not set but sites match\n"));
+               DEBUG(10,("ads_closest_dc: NBT_SERVER_CLOSEST flag not set but sites match\n"));
                return True;
        }
 
@@ -207,7 +207,7 @@ bool ads_try_connect(ADS_STRUCT *ads, const char *server )
 
        /* Check the CLDAP reply flags */
 
-       if ( !(cldap_reply.server_type & ADS_LDAP) ) {
+       if ( !(cldap_reply.server_type & NBT_SERVER_LDAP) ) {
                DEBUG(1,("ads_try_connect: %s's CLDAP reply says it is not an LDAP server!\n",
                        srv));
                ret = false;
index 0b3b3d9bbf1cb751e39988c4e66394716e5eca96..7834632806554f5bf0f8e50ef6b023515f606d61 100644 (file)
@@ -225,26 +225,26 @@ static bool check_cldap_reply_required_flags(uint32_t ret_flags,
                                             uint32_t req_flags)
 {
        if (req_flags & DS_PDC_REQUIRED)
-               RETURN_ON_FALSE(ret_flags & ADS_PDC);
+               RETURN_ON_FALSE(ret_flags & NBT_SERVER_PDC);
 
        if (req_flags & DS_GC_SERVER_REQUIRED)
-               RETURN_ON_FALSE(ret_flags & ADS_GC);
+               RETURN_ON_FALSE(ret_flags & NBT_SERVER_GC);
 
        if (req_flags & DS_ONLY_LDAP_NEEDED)
-               RETURN_ON_FALSE(ret_flags & ADS_LDAP);
+               RETURN_ON_FALSE(ret_flags & NBT_SERVER_LDAP);
 
        if ((req_flags & DS_DIRECTORY_SERVICE_REQUIRED) ||
            (req_flags & DS_DIRECTORY_SERVICE_PREFERRED))
-               RETURN_ON_FALSE(ret_flags & ADS_DS);
+               RETURN_ON_FALSE(ret_flags & NBT_SERVER_DS);
 
        if (req_flags & DS_KDC_REQUIRED)
-               RETURN_ON_FALSE(ret_flags & ADS_KDC);
+               RETURN_ON_FALSE(ret_flags & NBT_SERVER_KDC);
 
        if (req_flags & DS_TIMESERV_REQUIRED)
-               RETURN_ON_FALSE(ret_flags & ADS_TIMESERV);
+               RETURN_ON_FALSE(ret_flags & NBT_SERVER_TIMESERV);
 
        if (req_flags & DS_WRITABLE_REQUIRED)
-               RETURN_ON_FALSE(ret_flags & ADS_WRITABLE);
+               RETURN_ON_FALSE(ret_flags & NBT_SERVER_WRITABLE);
 
        return true;
 }
index 06926a762bd93ab9407f9caf8c5a4b6558d75637..d080f8f0b7210a124f8315b41fc4e4e619771d83 100644 (file)
@@ -99,7 +99,7 @@ static bool ads_dc_name(const char *domain,
                }
 
 #ifdef HAVE_KRB5
-               if (is_our_primary_domain(domain) && (ads->config.flags & ADS_KDC)) {
+               if (is_our_primary_domain(domain) && (ads->config.flags & NBT_SERVER_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
index 10833e80890305c00402e6487a54a28b7751929d..6e110dd1ca699477c45a18df2810fbf492e6387f 100644 (file)
@@ -424,8 +424,8 @@ reporting %s domain %s 0x%x ntversion=%x lm_nt token=%x lm_20 token=%x\n",
                                        }
                                        q += 4;
 
-                                       SIVAL(q, 0, ADS_PDC|ADS_GC|ADS_LDAP|ADS_DS|
-                                               ADS_KDC|ADS_TIMESERV|ADS_CLOSEST|ADS_WRITABLE);
+                                       SIVAL(q, 0, NBT_SERVER_PDC|NBT_SERVER_GC|NBT_SERVER_LDAP|NBT_SERVER_DS|
+                                               NBT_SERVER_KDC|NBT_SERVER_TIMESERV|NBT_SERVER_CLOSEST|NBT_SERVER_WRITABLE);
                                        q += 4;
 
                                        /* Push Domain GUID */
index dbdd3e3c59f8f17b11168050d05238c0500aa111..3df9e2cff036da5e1fddd87cabfae5e5b6f967c9 100644 (file)
@@ -118,16 +118,16 @@ static int net_ads_cldap_netlogon(ADS_STRUCT *ads)
                 "\tIs writable:                                %s\n"
                 "\tHas a hardware clock:                       %s\n"
                 "\tIs a non-domain NC serviced by LDAP server: %s\n",
-                (reply.server_type & ADS_PDC) ? "yes" : "no",
-                (reply.server_type & ADS_GC) ? "yes" : "no",
-                (reply.server_type & ADS_LDAP) ? "yes" : "no",
-                (reply.server_type & ADS_DS) ? "yes" : "no",
-                (reply.server_type & ADS_KDC) ? "yes" : "no",
-                (reply.server_type & ADS_TIMESERV) ? "yes" : "no",
-                (reply.server_type & ADS_CLOSEST) ? "yes" : "no",
-                (reply.server_type & ADS_WRITABLE) ? "yes" : "no",
-                (reply.server_type & ADS_GOOD_TIMESERV) ? "yes" : "no",
-                (reply.server_type & ADS_NDNC) ? "yes" : "no");
+                (reply.server_type & NBT_SERVER_PDC) ? "yes" : "no",
+                (reply.server_type & NBT_SERVER_GC) ? "yes" : "no",
+                (reply.server_type & NBT_SERVER_LDAP) ? "yes" : "no",
+                (reply.server_type & NBT_SERVER_DS) ? "yes" : "no",
+                (reply.server_type & NBT_SERVER_KDC) ? "yes" : "no",
+                (reply.server_type & NBT_SERVER_TIMESERV) ? "yes" : "no",
+                (reply.server_type & NBT_SERVER_CLOSEST) ? "yes" : "no",
+                (reply.server_type & NBT_SERVER_WRITABLE) ? "yes" : "no",
+                (reply.server_type & NBT_SERVER_GOOD_TIMESERV) ? "yes" : "no",
+                (reply.server_type & DS_SERVER_NDNC) ? "yes" : "no");
 
        printf("Forest:\t\t\t%s\n", reply.forest);
        printf("Domain:\t\t\t%s\n", reply.dns_domain);
index 5cff052114beb21eb91091476e5d36eb3068e33c..c62476e5ebe42b7691f63efa2a8d6b59a20363e0 100644 (file)
@@ -1054,7 +1054,7 @@ static bool dcip_to_name(TALLOC_CTX *mem_ctx,
 
                        DEBUG(10,("dcip_to_name: flags = 0x%x\n", (unsigned int)ads->config.flags));
 
-                       if (domain->primary && (ads->config.flags & ADS_KDC)) {
+                       if (domain->primary && (ads->config.flags & NBT_SERVER_KDC)) {
                                if (ads_closest_dc(ads)) {
                                        char *sitename = sitename_fetch(ads->config.realm);