+++ /dev/null
-/*
- 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_ */
#include "messages.h"
#include "locking.h"
#include "smb.h"
-#include "ads_cldap.h"
#include "nameserv.h"
#include "secrets.h"
#include "byteorder.h"
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;
}
/* 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;
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;
}
}
#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
}
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 */
"\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);
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);