From b796836b5eede56c9945d2562b2b9a5c525423c8 Mon Sep 17 00:00:00 2001 From: Kamen Mazdrashki Date: Tue, 27 Apr 2010 04:43:26 +0300 Subject: [PATCH] s4/libnet: Add "dNSHostName" attribute when joining the Site "dNSHostName" attribute is important part of Server object and it is Server's recored owner responsibility to maintain this attribute value. --- source4/libnet/libnet_site.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/source4/libnet/libnet_site.c b/source4/libnet/libnet_site.c index 3147cbb0f9..24311df5a2 100644 --- a/source4/libnet/libnet_site.c +++ b/source4/libnet/libnet_site.c @@ -153,6 +153,7 @@ NTSTATUS libnet_JoinSite(struct libnet_context *ctx, const char *config_dn_str; struct nbt_name name; const char *dest_addr = NULL; + char *dns_host_name; tmp_ctx = talloc_named(libnet_r, 0, "libnet_JoinSite temp context"); if (!tmp_ctx) { @@ -220,6 +221,15 @@ NTSTATUS libnet_JoinSite(struct libnet_context *ctx, talloc_free(tmp_ctx); return NT_STATUS_NO_MEMORY; } + dns_host_name = talloc_asprintf(tmp_ctx, "%s.%s", + libnet_r->in.netbios_name, libnet_r->out.realm); + if (!dns_host_name) { + r->out.error_string = NULL; + talloc_free(tmp_ctx); + return NT_STATUS_NO_MEMORY; + } + strlower_m(dns_host_name); + rtn = ldb_msg_add_string(msg, "dNSHostName", dns_host_name); server_dn = ldb_dn_new(tmp_ctx, remote_ldb, server_dn_str); if ( ! ldb_dn_validate(server_dn)) { -- 2.34.1