summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGünther Deschner <gd@samba.org>2008-04-21 19:59:27 +0200
committerGünther Deschner <gd@samba.org>2008-04-21 20:21:40 +0200
commitbcbac69d1a38e128ffe8b763ac027d6eab33dcec (patch)
tree3f9c8917a791e4eee03758746ddc063e371f62d2
parent1dd7ab38e7f7b5dae46cef4567957c71d6b5cc23 (diff)
downloadsamba-bcbac69d1a38e128ffe8b763ac027d6eab33dcec.tar.gz
samba-bcbac69d1a38e128ffe8b763ac027d6eab33dcec.tar.bz2
samba-bcbac69d1a38e128ffe8b763ac027d6eab33dcec.zip
cldap: avoid duplicate definitions so remove ads_cldap.h.
Guenther (This used to be commit 538eefe22ad69540b9f73ffaa613d6be045de199)
-rw-r--r--source3/include/ads_cldap.h60
-rw-r--r--source3/include/includes.h1
-rw-r--r--source3/libads/ldap.c8
-rw-r--r--source3/libsmb/dsgetdcname.c14
-rw-r--r--source3/libsmb/namequery_dc.c2
-rw-r--r--source3/nmbd/nmbd_processlogon.c4
-rw-r--r--source3/utils/net_ads.c20
-rw-r--r--source3/winbindd/winbindd_cm.c2
8 files changed, 25 insertions, 86 deletions
diff --git a/source3/include/ads_cldap.h b/source3/include/ads_cldap.h
deleted file mode 100644
index 692fc1b233..0000000000
--- a/source3/include/ads_cldap.h
+++ /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_ */
diff --git a/source3/include/includes.h b/source3/include/includes.h
index 06d41957c9..70e1b48fa1 100644
--- a/source3/include/includes.h
+++ b/source3/include/includes.h
@@ -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"
diff --git a/source3/libads/ldap.c b/source3/libads/ldap.c
index 99df4ed8a3..b0f27b598b 100644
--- a/source3/libads/ldap.c
+++ b/source3/libads/ldap.c
@@ -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;
diff --git a/source3/libsmb/dsgetdcname.c b/source3/libsmb/dsgetdcname.c
index 0b3b3d9bbf..7834632806 100644
--- a/source3/libsmb/dsgetdcname.c
+++ b/source3/libsmb/dsgetdcname.c
@@ -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;
}
diff --git a/source3/libsmb/namequery_dc.c b/source3/libsmb/namequery_dc.c
index 06926a762b..d080f8f0b7 100644
--- a/source3/libsmb/namequery_dc.c
+++ b/source3/libsmb/namequery_dc.c
@@ -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
diff --git a/source3/nmbd/nmbd_processlogon.c b/source3/nmbd/nmbd_processlogon.c
index 10833e8089..6e110dd1ca 100644
--- a/source3/nmbd/nmbd_processlogon.c
+++ b/source3/nmbd/nmbd_processlogon.c
@@ -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 */
diff --git a/source3/utils/net_ads.c b/source3/utils/net_ads.c
index dbdd3e3c59..3df9e2cff0 100644
--- a/source3/utils/net_ads.c
+++ b/source3/utils/net_ads.c
@@ -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);
diff --git a/source3/winbindd/winbindd_cm.c b/source3/winbindd/winbindd_cm.c
index 5cff052114..c62476e5eb 100644
--- a/source3/winbindd/winbindd_cm.c
+++ b/source3/winbindd/winbindd_cm.c
@@ -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);