summaryrefslogtreecommitdiff
path: root/source4/cldap_server/netlogon.c
diff options
context:
space:
mode:
authorJeremy Allison <jra@samba.org>2009-10-17 10:36:33 -0700
committerJeremy Allison <jra@samba.org>2009-10-17 10:36:33 -0700
commit7c51fa6d699a653cafa90df8e44911b576118ebd (patch)
tree543bf9ca698e03eff81104898b33e77f1abed319 /source4/cldap_server/netlogon.c
parentcc3a6770c77ec8fe1cd63bf4c682853c56201f0c (diff)
parent3e3214fd91471bca5b6c4d3782e922d252d588fb (diff)
downloadsamba-7c51fa6d699a653cafa90df8e44911b576118ebd.tar.gz
samba-7c51fa6d699a653cafa90df8e44911b576118ebd.tar.bz2
samba-7c51fa6d699a653cafa90df8e44911b576118ebd.zip
Merge branch 'master' of ssh://jra@git.samba.org/data/git/samba
Diffstat (limited to 'source4/cldap_server/netlogon.c')
-rw-r--r--source4/cldap_server/netlogon.c39
1 files changed, 22 insertions, 17 deletions
diff --git a/source4/cldap_server/netlogon.c b/source4/cldap_server/netlogon.c
index ecc1369dcf..b06fd609f2 100644
--- a/source4/cldap_server/netlogon.c
+++ b/source4/cldap_server/netlogon.c
@@ -61,7 +61,6 @@ NTSTATUS fill_netlogon_samlogon_response(struct ldb_context *sam_ctx,
uint32_t server_type;
const char *pdc_name;
struct GUID domain_uuid;
- const char *realm;
const char *dns_domain;
const char *pdc_dns_name;
const char *flatname;
@@ -78,7 +77,7 @@ NTSTATUS fill_netlogon_samlogon_response(struct ldb_context *sam_ctx,
domain = talloc_strndup(mem_ctx, domain, strlen(domain)-1);
}
- if (domain && strcasecmp_m(domain, lp_realm(lp_ctx)) == 0) {
+ if (domain && strcasecmp_m(domain, lp_dnsdomain(lp_ctx)) == 0) {
domain_dn = ldb_get_default_basedn(sam_ctx);
}
@@ -206,40 +205,46 @@ NTSTATUS fill_netlogon_samlogon_response(struct ldb_context *sam_ctx,
}
server_type =
- NBT_SERVER_DS | NBT_SERVER_TIMESERV |
- NBT_SERVER_CLOSEST | NBT_SERVER_WRITABLE |
- NBT_SERVER_GOOD_TIMESERV | DS_DNS_CONTROLLER |
- DS_DNS_DOMAIN;
+ DS_SERVER_DS | DS_SERVER_TIMESERV |
+ DS_SERVER_CLOSEST | DS_SERVER_WRITABLE |
+ DS_SERVER_GOOD_TIMESERV;
+
+#if 0
+ /* w2k8-r2 as a DC does not claim these */
+ server_type |= DS_DNS_CONTROLLER | DS_DNS_DOMAIN;
+#endif
if (samdb_is_pdc(sam_ctx)) {
int *domainFunctionality;
- server_type |= NBT_SERVER_PDC;
+ server_type |= DS_SERVER_PDC;
domainFunctionality = talloc_get_type(ldb_get_opaque(sam_ctx, "domainFunctionality"), int);
if (domainFunctionality && *domainFunctionality >= DS_DOMAIN_FUNCTION_2008) {
- server_type |= NBT_SERVER_FULL_SECRET_DOMAIN_6;
+ server_type |= DS_SERVER_FULL_SECRET_DOMAIN_6;
}
}
if (samdb_is_gc(sam_ctx)) {
- server_type |= NBT_SERVER_GC;
+ server_type |= DS_SERVER_GC;
}
if (str_list_check(services, "ldap")) {
- server_type |= NBT_SERVER_LDAP;
+ server_type |= DS_SERVER_LDAP;
}
if (str_list_check(services, "kdc")) {
- server_type |= NBT_SERVER_KDC;
+ server_type |= DS_SERVER_KDC;
}
+#if 0
+ /* w2k8-r2 as a sole DC does not claim this */
if (ldb_dn_compare(ldb_get_root_basedn(sam_ctx), ldb_get_default_basedn(sam_ctx)) == 0) {
- server_type |= DS_DNS_FOREST;
+ server_type |= DS_DNS_FOREST_ROOT;
}
+#endif
pdc_name = talloc_asprintf(mem_ctx, "\\\\%s", lp_netbios_name(lp_ctx));
domain_uuid = samdb_result_guid(dom_res->msgs[0], "objectGUID");
- realm = lp_realm(lp_ctx);
- dns_domain = lp_realm(lp_ctx);
+ dns_domain = lp_dnsdomain(lp_ctx);
pdc_dns_name = talloc_asprintf(mem_ctx, "%s.%s",
strlower_talloc(mem_ctx,
lp_netbios_name(lp_ctx)),
@@ -267,7 +272,7 @@ NTSTATUS fill_netlogon_samlogon_response(struct ldb_context *sam_ctx,
}
netlogon->data.nt5_ex.server_type = server_type;
netlogon->data.nt5_ex.domain_uuid = domain_uuid;
- netlogon->data.nt5_ex.forest = realm;
+ netlogon->data.nt5_ex.forest = dns_domain;
netlogon->data.nt5_ex.dns_domain = dns_domain;
netlogon->data.nt5_ex.pdc_dns_name = pdc_dns_name;
netlogon->data.nt5_ex.domain = flatname;
@@ -300,7 +305,7 @@ NTSTATUS fill_netlogon_samlogon_response(struct ldb_context *sam_ctx,
netlogon->data.nt5.user_name = user;
netlogon->data.nt5.domain_name = flatname;
netlogon->data.nt5.domain_uuid = domain_uuid;
- netlogon->data.nt5.forest = realm;
+ netlogon->data.nt5.forest = dns_domain;
netlogon->data.nt5.dns_domain = dns_domain;
netlogon->data.nt5.pdc_dns_name = pdc_dns_name;
netlogon->data.nt5.pdc_ip = pdc_ip;
@@ -396,7 +401,7 @@ void cldapd_netlogon_request(struct cldap_socket *cldap,
}
if (domain_guid == NULL && domain == NULL) {
- domain = lp_realm(cldapd->task->lp_ctx);
+ domain = lp_dnsdomain(cldapd->task->lp_ctx);
}
if (version == -1) {