r12423: Remove DEBUG(0) printouts in favor of more information to the caller.
authorAndrew Bartlett <abartlet@samba.org>
Thu, 22 Dec 2005 06:58:26 +0000 (06:58 +0000)
committerGerald (Jerry) Carter <jerry@samba.org>
Wed, 10 Oct 2007 18:47:36 +0000 (13:47 -0500)
I assume this works better with SWAT and the like anyway.

Andrew Bartlett

source/libnet/libnet_join.c
source/libnet/libnet_join.h
source/utils/net/net_join.c

index c55be7e73ccf35e179816a840055ca55b7836ced..62feb8b5441462c054c119f4b58ee5c31ffac9ef 100644 (file)
@@ -745,8 +745,6 @@ NTSTATUS libnet_JoinDomain(struct libnet_context *ctx, TALLOC_CTX *mem_ctx, stru
                }
        }
 
-       DEBUG(0, ("Joining domain %s\n", domain_name));
-
        /*
          establish a SAMR connection, on the same CIFS transport
        */
@@ -937,15 +935,13 @@ NTSTATUS libnet_JoinDomain(struct libnet_context *ctx, TALLOC_CTX *mem_ctx, stru
                        
                        /* &cu filled in above */
                        status = dcerpc_samr_CreateUser2(samr_pipe, tmp_ctx, &cu);                      
-                       if (!NT_STATUS_IS_OK(status) && !NT_STATUS_EQUAL(status, NT_STATUS_USER_EXISTS)) {
+                       if (!NT_STATUS_IS_OK(status)) {
                                r->out.error_string = talloc_asprintf(mem_ctx,
                                                                      "samr_CreateUser2 (recreate) for [%s] failed: %s\n",
                                                                      r->in.domain_name, nt_errstr(status));
                                talloc_free(tmp_ctx);
                                return status;
                        }
-                       DEBUG(0, ("Recreated account in domain %s\n", domain_name));
-
                }
        }
 
@@ -1429,6 +1425,8 @@ static NTSTATUS libnet_Join_primary_domain(struct libnet_context *ctx,
        talloc_steal(mem_ctx, r2->out.join_password);
        r->out.domain_sid       = r2->out.domain_sid;
        talloc_steal(mem_ctx, r2->out.domain_sid);
+       r->out.domain_name      = r2->out.domain_name;
+       talloc_steal(mem_ctx, r2->out.domain_name);
        talloc_free(tmp_mem);
        return NT_STATUS_OK;
 }
index d1ddc623f00f069a840b80cd1fdb984bff680a7b..78f4fd5f121c17295801a1cb463074676dac534e 100644 (file)
@@ -73,6 +73,7 @@ struct libnet_Join {
                const char *error_string;
                const char *join_password;
                struct dom_sid *domain_sid;
+               const char *domain_name;
        } out;
 };
 
index bec82c72d170a1a0b6a461b87b2eff20ac3ad023..8140108ceb7f692d61239ee13659c2f2bf755929 100644 (file)
@@ -66,7 +66,7 @@ int net_join(struct net_context *ctx, int argc, const char **argv)
        if (!r) {
                return -1;
        }
-       /* prepare password change */
+       /* prepare parameters for the join */
        r->in.netbios_name              = lp_netbios_name();
        r->in.domain_name               = domain_name;
        r->in.secure_channel_type       = secure_channel_type;
@@ -83,6 +83,8 @@ int net_join(struct net_context *ctx, int argc, const char **argv)
                talloc_free(libnetctx);
                return -1;
        }
+       d_printf("Joined domain %s (%s)\n", r->out.domain_name, dom_sid_string(ctx->mem_ctx, r->out.domain_sid));
+
        talloc_free(libnetctx);
        return 0;
 }