diff options
author | Matthias Dieter Wallnöfer <mwallnoefer@yahoo.de> | 2009-10-18 11:59:11 +0200 |
---|---|---|
committer | Matthias Dieter Wallnöfer <mwallnoefer@yahoo.de> | 2009-10-18 14:33:43 +0200 |
commit | 85e49953641fc9ddece3f4a08df8c96cf41e06dc (patch) | |
tree | 228dfdf726bd82ebbe88f3ae200deb6be06ed1fc /source4 | |
parent | 5d4093a937a39243c0c8ca1215297d26a67ba64b (diff) | |
download | samba-85e49953641fc9ddece3f4a08df8c96cf41e06dc.tar.gz samba-85e49953641fc9ddece3f4a08df8c96cf41e06dc.tar.xz samba-85e49953641fc9ddece3f4a08df8c96cf41e06dc.zip |
s4:sites - get the server site (name) from DSDB
Diffstat (limited to 'source4')
-rw-r--r-- | source4/cldap_server/netlogon.c | 4 | ||||
-rw-r--r-- | source4/dsdb/common/util.c | 10 | ||||
-rw-r--r-- | source4/rpc_server/netlogon/dcerpc_netlogon.c | 4 |
3 files changed, 15 insertions, 3 deletions
diff --git a/source4/cldap_server/netlogon.c b/source4/cldap_server/netlogon.c index b06fd609f2..c565f2fb1a 100644 --- a/source4/cldap_server/netlogon.c +++ b/source4/cldap_server/netlogon.c @@ -251,8 +251,8 @@ NTSTATUS fill_netlogon_samlogon_response(struct ldb_context *sam_ctx, dns_domain); flatname = lp_sam_name(lp_ctx); - /* FIXME: Hardcoded site names */ - server_site = "Default-First-Site-Name"; + server_site = samdb_server_site_name(sam_ctx, mem_ctx); + /* FIXME: Hardcoded site name */ client_site = "Default-First-Site-Name"; load_interfaces(mem_ctx, lp_interfaces(lp_ctx), &ifaces); pdc_ip = iface_best_ip(ifaces, src_address); diff --git a/source4/dsdb/common/util.c b/source4/dsdb/common/util.c index c9562b0de7..ace8e185ab 100644 --- a/source4/dsdb/common/util.c +++ b/source4/dsdb/common/util.c @@ -1432,6 +1432,16 @@ struct ldb_dn *samdb_server_site_dn(struct ldb_context *ldb, TALLOC_CTX *mem_ctx return server_site_dn; } +const char *samdb_server_site_name(struct ldb_context *ldb, TALLOC_CTX *mem_ctx) +{ + const struct ldb_val *val = ldb_dn_get_rdn_val(samdb_server_site_dn(ldb, mem_ctx)); + + if (val != NULL) + return (const char *) val->data; + else + return NULL; +} + /* work out if we are the PDC for the domain of the current open ldb */ diff --git a/source4/rpc_server/netlogon/dcerpc_netlogon.c b/source4/rpc_server/netlogon/dcerpc_netlogon.c index 3eaa64d82b..f04f4be59c 100644 --- a/source4/rpc_server/netlogon/dcerpc_netlogon.c +++ b/source4/rpc_server/netlogon/dcerpc_netlogon.c @@ -1457,8 +1457,9 @@ static WERROR dcesrv_netr_DsRGetDCNameEx2(struct dcesrv_call_state *dce_call, TA DS_SERVER_LDAP | DS_SERVER_GC | DS_SERVER_PDC; - info->dc_site_name = talloc_strdup(mem_ctx, "Default-First-Site-Name"); + info->dc_site_name = samdb_server_site_name(sam_ctx, mem_ctx); W_ERROR_HAVE_NO_MEMORY(info->dc_site_name); + /* FIXME: Hardcoded site name */ info->client_site_name = talloc_strdup(mem_ctx, "Default-First-Site-Name"); W_ERROR_HAVE_NO_MEMORY(info->client_site_name); @@ -1561,6 +1562,7 @@ static WERROR dcesrv_netr_DsRAddressToSitenamesExW(struct dcesrv_call_state *dce W_ERROR_HAVE_NO_MEMORY(ctr->subnetname); for (i=0; i<ctr->count; i++) { + /* FIXME: Hardcoded site name */ ctr->sitename[i].string = "Default-First-Site-Name"; ctr->subnetname[i].string = NULL; } |