From: Kamen Mazdrashki Date: Tue, 27 Apr 2010 01:43:26 +0000 (+0300) Subject: s4/libnet: Add "dNSHostName" attribute when joining the Site X-Git-Url: http://git.samba.org/?p=kamenim%2Fsamba.git;a=commitdiff_plain;h=b796836b5eede56c9945d2562b2b9a5c525423c8 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. --- 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)) {