Merge all connect ads calls into libnet_join_post_processing_ads().
authorGünther Deschner <gd@samba.org>
Thu, 28 Feb 2008 10:02:01 +0000 (11:02 +0100)
committerGünther Deschner <gd@samba.org>
Thu, 28 Feb 2008 10:38:01 +0000 (11:38 +0100)
Guenther
(This used to be commit be96baeffc60d05d8e297034e5253c8b75512ab2)

source3/libnet/libnet_join.c

index 510b9e2e2f5790b31adabd464036ad7b3b5f7fe9..2d00fb094f7cb0cc4a54f8a52d588ad1842e9af1 100644 (file)
@@ -296,13 +296,6 @@ static ADS_STATUS libnet_join_set_machine_spn(TALLOC_CTX *mem_ctx,
        const char *spn_array[3] = {NULL, NULL, NULL};
        char *spn = NULL;
 
-       if (!r->in.ads) {
-               status = libnet_join_connect_ads(mem_ctx, r);
-               if (!ADS_ERR_OK(status)) {
-                       return status;
-               }
-       }
-
        status = libnet_join_find_machine_acct(mem_ctx, r);
        if (!ADS_ERR_OK(status)) {
                return status;
@@ -358,13 +351,6 @@ static ADS_STATUS libnet_join_set_machine_upn(TALLOC_CTX *mem_ctx,
                return ADS_SUCCESS;
        }
 
-       if (!r->in.ads) {
-               status = libnet_join_connect_ads(mem_ctx, r);
-               if (!ADS_ERR_OK(status)) {
-                       return status;
-               }
-       }
-
        status = libnet_join_find_machine_acct(mem_ctx, r);
        if (!ADS_ERR_OK(status)) {
                return status;
@@ -408,13 +394,6 @@ static ADS_STATUS libnet_join_set_os_attributes(TALLOC_CTX *mem_ctx,
                return ADS_SUCCESS;
        }
 
-       if (!r->in.ads) {
-               status = libnet_join_connect_ads(mem_ctx, r);
-               if (!ADS_ERR_OK(status)) {
-                       return status;
-               }
-       }
-
        status = libnet_join_find_machine_acct(mem_ctx, r);
        if (!ADS_ERR_OK(status)) {
                return status;
@@ -525,6 +504,13 @@ static ADS_STATUS libnet_join_post_processing_ads(TALLOC_CTX *mem_ctx,
 {
        ADS_STATUS status;
 
+       if (!r->in.ads) {
+               status = libnet_join_connect_ads(mem_ctx, r);
+               if (!ADS_ERR_OK(status)) {
+                       return status;
+               }
+       }
+
        status = libnet_join_set_machine_spn(mem_ctx, r);
        if (!ADS_ERR_OK(status)) {
                libnet_join_set_error_string(mem_ctx, r,