#include "librpc/gen_ndr/ndr_misc.h"
#include "system/time.h"
#include "auth/auth.h"
-#include "lib/db_wrap.h"
+#include "lib/ldb_wrap.h"
#include "lib/appweb/ejs/ejs.h"
#include "lib/appweb/ejs/ejsInternal.h"
#include "scripting/ejs/smbcalls.h"
struct test_become_dc_state {
struct libnet_context *ctx;
+ struct torture_context *tctx;
const char *netbios_name;
struct test_join *tj;
struct cli_credentials *machine_account;
DEBUG(0,("Pathes under PRIVATEDIR[%s]\n"
"SAMDB[%s] SECRETS[%s] KEYTAB[%s]\n",
- lp_private_dir(global_loadparm),
+ lp_private_dir(s->tctx->lp_ctx),
s->path.samdb_ldb,
s->path.secrets_ldb,
s->path.secrets_keytab));
talloc_free(s->ldb);
- DEBUG(0,("Open the SAM LDB with system credentials: %s\n", s->path.samdb_ldb));
+ DEBUG(0,("Open the SAM LDB with system credentials: %s\n",
+ s->path.samdb_ldb));
- s->ldb = ldb_wrap_connect(s, global_loadparm, s->path.samdb_ldb,
- system_session(s),
+ s->ldb = ldb_wrap_connect(s, s->tctx->lp_ctx, s->path.samdb_ldb,
+ system_session(s, s->tctx->lp_ctx),
NULL, 0, NULL);
if (!s->ldb) {
DEBUG(0,("Failed to open '%s'\n",
return werror_to_ntstatus(status);
}
- if (lp_parm_bool(global_loadparm, NULL, "become dc", "dump objects", false)) {
+ if (lp_parm_bool(s->tctx->lp_ctx, NULL, "become dc", "dump objects", false)) {
for (i=0; i < objs->num_objects; i++) {
struct ldb_ldif ldif;
fprintf(stdout, "#\n");
s->schema = NULL;
DEBUG(0,("Reopen the SAM LDB with system credentials and a already stored schema: %s\n", s->path.samdb_ldb));
- s->ldb = ldb_wrap_connect(s, global_loadparm, s->path.samdb_ldb,
- system_session(s),
+ s->ldb = ldb_wrap_connect(s, s->tctx->lp_ctx, s->path.samdb_ldb,
+ system_session(s, s->tctx->lp_ctx),
NULL, 0, NULL);
if (!s->ldb) {
DEBUG(0,("Failed to open '%s'\n",
return werror_to_ntstatus(status);
}
- if (lp_parm_bool(global_loadparm, NULL, "become dc", "dump objects", false)) {
+ if (lp_parm_bool(s->tctx->lp_ctx, NULL, "become dc", "dump objects", false)) {
for (i=0; i < objs->num_objects; i++) {
struct ldb_ldif ldif;
fprintf(stdout, "#\n");
return NT_STATUS_FOOBAR;
}
- if (lp_parm_bool(global_loadparm, NULL, "become dc", "dump objects", false)) {
+ if (lp_parm_bool(s->tctx->lp_ctx, NULL, "become dc", "dump objects", false)) {
DEBUG(0,("# %s\n", sa->lDAPDisplayName));
NDR_PRINT_DEBUG(drsuapi_DsReplicaLinkedAttribute, &linked_attributes[i]);
dump_data(0,
s = talloc_zero(torture, struct test_become_dc_state);
if (!s) return false;
- s->netbios_name = lp_parm_string(global_loadparm, NULL, "become dc", "smbtorture dc");
+ s->tctx = torture;
+
+ s->netbios_name = lp_parm_string(torture->lp_ctx, NULL, "become dc", "smbtorture dc");
if (!s->netbios_name || !s->netbios_name[0]) {
s->netbios_name = "smbtorturedc";
}
if (!s->path.secrets_keytab) return false;
/* Join domain as a member server. */
- s->tj = torture_join_domain(s->netbios_name,
+ s->tj = torture_join_domain(torture, s->netbios_name,
ACB_WSTRUST,
&s->machine_account);
if (!s->tj) {
return false;
}
- s->ctx = libnet_context_init(torture->ev);
+ s->ctx = libnet_context_init(torture->ev, torture->lp_ctx);
s->ctx->cred = cmdline_credentials;
s->ldb = ldb_init(s);
s->schema = NULL;
DEBUG(0,("Reopen the SAM LDB with system credentials and all replicated data: %s\n", s->path.samdb_ldb));
- s->ldb = ldb_wrap_connect(s, global_loadparm, s->path.samdb_ldb,
- system_session(s),
+ s->ldb = ldb_wrap_connect(s, torture->lp_ctx, s->path.samdb_ldb,
+ system_session(s, torture->lp_ctx),
NULL, 0, NULL);
if (!s->ldb) {
DEBUG(0,("Failed to open '%s'\n",
goto cleanup;
}
- if (lp_parm_bool(global_loadparm, NULL, "become dc", "do not unjoin", false)) {
+ if (lp_parm_bool(torture->lp_ctx, NULL, "become dc", "do not unjoin", false)) {
talloc_free(s);
return ret;
}