summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrew Bartlett <abartlet@samba.org>2006-12-10 23:28:36 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 14:29:06 -0500
commite8e61a414a52a49a86cc5f3b71a55141a2bbb56b (patch)
treec2e990d2e1f7528ed819294fd4f303a252b84ff4
parent784fd1a2306530c62dc850df8088fc5d4e33f053 (diff)
downloadsamba-e8e61a414a52a49a86cc5f3b71a55141a2bbb56b.tar.gz
samba-e8e61a414a52a49a86cc5f3b71a55141a2bbb56b.tar.bz2
samba-e8e61a414a52a49a86cc5f3b71a55141a2bbb56b.zip
r20102: Do not reference remote_ldb before we initialise it. This should fix
up many of the build farm failures. Andrew Bartlett (This used to be commit 924af98ffaab3735c3f31014059e7cd0abd71919)
-rw-r--r--source4/libnet/libnet_join.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/source4/libnet/libnet_join.c b/source4/libnet/libnet_join.c
index 3bd1a9783e..df61df7f10 100644
--- a/source4/libnet/libnet_join.c
+++ b/source4/libnet/libnet_join.c
@@ -219,14 +219,6 @@ static NTSTATUS libnet_JoinADSDomain(struct libnet_context *ctx, struct libnet_J
/* Store the DN of our machine account. */
account_dn_str = r_crack_names.out.ctr.ctr1->array[0].result_name;
- account_dn = ldb_dn_new(tmp_ctx, remote_ldb, account_dn_str);
- if (! ldb_dn_validate(account_dn)) {
- r->out.error_string = talloc_asprintf(r, "Invalid account dn: %s",
- account_dn_str);
- talloc_free(tmp_ctx);
- return NT_STATUS_UNSUCCESSFUL;
- }
-
/* Now we know the user's DN, open with LDAP, read and modify a few things */
remote_ldb_url = talloc_asprintf(tmp_ctx, "ldap://%s",
@@ -245,6 +237,14 @@ static NTSTATUS libnet_JoinADSDomain(struct libnet_context *ctx, struct libnet_J
return NT_STATUS_UNSUCCESSFUL;
}
+ account_dn = ldb_dn_new(tmp_ctx, remote_ldb, account_dn_str);
+ if (! ldb_dn_validate(account_dn)) {
+ r->out.error_string = talloc_asprintf(r, "Invalid account dn: %s",
+ account_dn_str);
+ talloc_free(tmp_ctx);
+ return NT_STATUS_UNSUCCESSFUL;
+ }
+
/* search for the user's record */
ret = ldb_search(remote_ldb, account_dn, LDB_SCOPE_BASE,
NULL, attrs, &res);