summaryrefslogtreecommitdiff
path: root/source4/libnet/libnet_join.c
diff options
context:
space:
mode:
authorMatthias Dieter Wallnöfer <mdw@samba.org>2010-10-31 19:11:34 +0100
committerMatthias Dieter Wallnöfer <mdw@samba.org>2010-10-31 18:44:07 +0000
commita5fc9378df6e69338332762c7d1c8a72cad58153 (patch)
tree0a6973fd96234ae96a122ce82faf40e00c7334fa /source4/libnet/libnet_join.c
parent572774a7a0a1c646bc84d1310f5e8002a464216c (diff)
downloadsamba-a5fc9378df6e69338332762c7d1c8a72cad58153.tar.gz
samba-a5fc9378df6e69338332762c7d1c8a72cad58153.tar.bz2
samba-a5fc9378df6e69338332762c7d1c8a72cad58153.zip
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.
Diffstat (limited to 'source4/libnet/libnet_join.c')
-rw-r--r--source4/libnet/libnet_join.c15
1 files 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);