From a5fc9378df6e69338332762c7d1c8a72cad58153 Mon Sep 17 00:00:00 2001 From: Matthias Dieter Wallnöfer Date: Sun, 31 Oct 2010 19:11:34 +0100 Subject: s4:libnet_join.c - only write the really essential SPNs If we are a DC then the others are added by the "samba_spnupdate" script. This fixes bug #7614. --- source4/libnet/libnet_join.c | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/source4/libnet/libnet_join.c b/source4/libnet/libnet_join.c index 50b5c1f473..235304423e 100644 --- a/source4/libnet/libnet_join.c +++ b/source4/libnet/libnet_join.c @@ -272,7 +272,7 @@ static NTSTATUS libnet_JoinADSDomain(struct libnet_context *ctx, struct libnet_J { unsigned int i; - const char *service_principal_name[6]; + const char *service_principal_name[2]; const char *dns_host_name = strlower_talloc(tmp_ctx, talloc_asprintf(tmp_ctx, "%s.%s", @@ -285,12 +285,10 @@ static NTSTATUS libnet_JoinADSDomain(struct libnet_context *ctx, struct libnet_J return NT_STATUS_NO_MEMORY; } - service_principal_name[0] = talloc_asprintf(tmp_ctx, "host/%s", dns_host_name); - service_principal_name[1] = talloc_asprintf(tmp_ctx, "host/%s", strlower_talloc(tmp_ctx, r->in.netbios_name)); - service_principal_name[2] = talloc_asprintf(tmp_ctx, "host/%s/%s", dns_host_name, realm); - service_principal_name[3] = talloc_asprintf(tmp_ctx, "host/%s/%s", strlower_talloc(tmp_ctx, r->in.netbios_name), realm); - service_principal_name[4] = talloc_asprintf(tmp_ctx, "host/%s/%s", dns_host_name, r->out.domain_name); - service_principal_name[5] = talloc_asprintf(tmp_ctx, "host/%s/%s", strlower_talloc(tmp_ctx, r->in.netbios_name), r->out.domain_name); + service_principal_name[0] = talloc_asprintf(tmp_ctx, "HOST/%s", + dns_host_name); + service_principal_name[1] = talloc_asprintf(tmp_ctx, "HOST/%s", + r->in.netbios_name); for (i=0; i < ARRAY_SIZE(service_principal_name); i++) { if (!service_principal_name[i]) { @@ -306,7 +304,8 @@ static NTSTATUS libnet_JoinADSDomain(struct libnet_context *ctx, struct libnet_J } } - rtn = samdb_msg_add_string(remote_ldb, tmp_ctx, msg, "dNSHostName", dns_host_name); + rtn = samdb_msg_add_string(remote_ldb, tmp_ctx, msg, + "dNSHostName", dns_host_name); if (rtn != LDB_SUCCESS) { r->out.error_string = NULL; talloc_free(tmp_ctx); -- cgit