}
}
- DEBUG(0, ("Joining domain %s\n", domain_name));
-
/*
establish a SAMR connection, on the same CIFS transport
*/
/* &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));
-
}
}
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;
}
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;
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;
}