r11349: Actually add all the new spns...
authorAndrew Bartlett <abartlet@samba.org>
Fri, 28 Oct 2005 02:13:14 +0000 (02:13 +0000)
committerGerald (Jerry) Carter <jerry@samba.org>
Wed, 10 Oct 2007 18:45:22 +0000 (13:45 -0500)
Andrew Bartlett
(This used to be commit 63eede2ad3f0238e1a925325c0be08d79f48c33b)

source4/libnet/libnet_join.c

index 4927f5fb45956a74c2b5fc363576739e26b241d7..daa840f76e52e1417cba20319179b1a15a8b969c 100644 (file)
@@ -417,6 +417,12 @@ static NTSTATUS libnet_JoinADSDomain(struct libnet_context *ctx, struct libnet_J
                                talloc_free(tmp_ctx);
                                return NT_STATUS_NO_MEMORY;
                        }
+                       rtn = samdb_msg_add_string(remote_ldb, tmp_ctx, msg, "servicePrincipalName", service_principal_name[i]);
+                       if (rtn == -1) {
+                               r->out.error_string = NULL;
+                               talloc_free(tmp_ctx);
+                               return NT_STATUS_NO_MEMORY;
+                       }
                }
 
                rtn = samdb_msg_add_string(remote_ldb, tmp_ctx, msg, "dNSHostName", dns_host_name);
@@ -425,18 +431,6 @@ static NTSTATUS libnet_JoinADSDomain(struct libnet_context *ctx, struct libnet_J
                        talloc_free(tmp_ctx);
                        return NT_STATUS_NO_MEMORY;
                }
-               rtn = samdb_msg_add_string(remote_ldb, tmp_ctx, msg, "servicePrincipalName", service_principal_name[0]);
-               if (rtn == -1) {
-                       r->out.error_string = NULL;
-                       talloc_free(tmp_ctx);
-                       return NT_STATUS_NO_MEMORY;
-               }
-               rtn = samdb_msg_add_string(remote_ldb, tmp_ctx, msg, "servicePrincipalName", service_principal_name[1]);
-               if (rtn == -1) {
-                       r->out.error_string = NULL;
-                       talloc_free(tmp_ctx);
-                       return NT_STATUS_NO_MEMORY;
-               }
 
                rtn = samdb_replace(remote_ldb, tmp_ctx, msg);
                if (rtn != 0) {