summaryrefslogtreecommitdiff
path: root/source4
diff options
context:
space:
mode:
authorJelmer Vernooij <jelmer@samba.org>2007-12-03 18:47:35 +0100
committerStefan Metzmacher <metze@samba.org>2007-12-21 05:47:39 +0100
commit1fbdd6ef1dfb8704de0524fc6f5c33e1418858cd (patch)
tree3e8c16ffd419fbd950fcef1569f0bc82709f5831 /source4
parentcb7c72a0ef9a8e6d145ead6286e54ec50ddf3988 (diff)
downloadsamba-1fbdd6ef1dfb8704de0524fc6f5c33e1418858cd.tar.gz
samba-1fbdd6ef1dfb8704de0524fc6f5c33e1418858cd.tar.bz2
samba-1fbdd6ef1dfb8704de0524fc6f5c33e1418858cd.zip
r26264: pass name resolve order explicitly, use torture context for settings in dssync tests.
(This used to be commit c7eae1c7842f9ff8b70cce9e5d6f3ebbbe78e83b)
Diffstat (limited to 'source4')
-rw-r--r--source4/auth/auth_server.c2
-rw-r--r--source4/auth/auth_simple.c2
-rw-r--r--source4/auth/gensec/gensec_gssapi.c2
-rw-r--r--source4/auth/gensec/gensec_krb5.c2
-rw-r--r--source4/auth/ntlmssp/ntlmssp_server.c2
-rw-r--r--source4/auth/session.c5
-rw-r--r--source4/client/cifsdd.c6
-rw-r--r--source4/lib/charset/tests/iconv.c2
-rw-r--r--source4/libcli/finddcs.c3
-rw-r--r--source4/libcli/raw/clisocket.c2
-rw-r--r--source4/libcli/resolve/resolve.c6
-rw-r--r--source4/libnet/libnet_site.c5
-rw-r--r--source4/scripting/ejs/smbcalls_auth.c2
-rw-r--r--source4/scripting/ejs/smbcalls_nbt.c2
-rw-r--r--source4/smb_server/smb/sesssetup.c4
-rw-r--r--source4/torture/ldap/cldapbench.c3
-rw-r--r--source4/torture/nbt/dgram.c6
-rw-r--r--source4/torture/nbt/nbt.c3
-rw-r--r--source4/torture/rpc/dssync.c56
19 files changed, 59 insertions, 56 deletions
diff --git a/source4/auth/auth_server.c b/source4/auth/auth_server.c
index 900ca8d05e..1e25702671 100644
--- a/source4/auth/auth_server.c
+++ b/source4/auth/auth_server.c
@@ -45,7 +45,7 @@ static struct smbcli_state *server_cryptkey(TALLOC_CTX *mem_ctx, bool unicode, i
while(next_token( &p, desthost, LIST_SEP, sizeof(desthost))) {
strupper(desthost);
- if(!resolve_name( desthost, &dest_ip, 0x20)) {
+ if(!resolve_name( desthost, &dest_ip, 0x20, lp_name_resolve_order(global_loadparm))) {
DEBUG(1,("server_cryptkey: Can't resolve address for %s\n",desthost));
continue;
}
diff --git a/source4/auth/auth_simple.c b/source4/auth/auth_simple.c
index cde170482a..3c7bf5433a 100644
--- a/source4/auth/auth_simple.c
+++ b/source4/auth/auth_simple.c
@@ -89,7 +89,7 @@ _PUBLIC_ NTSTATUS authenticate_username_pw(TALLOC_CTX *mem_ctx,
}
if (session_info) {
- nt_status = auth_generate_session_info(tmp_ctx, server_info, session_info);
+ nt_status = auth_generate_session_info(tmp_ctx, lp_ctx, server_info, session_info);
if (NT_STATUS_IS_OK(nt_status)) {
talloc_steal(mem_ctx, *session_info);
diff --git a/source4/auth/gensec/gensec_gssapi.c b/source4/auth/gensec/gensec_gssapi.c
index c91da6d1a0..a0b42db141 100644
--- a/source4/auth/gensec/gensec_gssapi.c
+++ b/source4/auth/gensec/gensec_gssapi.c
@@ -1336,7 +1336,7 @@ static NTSTATUS gensec_gssapi_session_info(struct gensec_security *gensec_securi
}
/* references the server_info into the session_info */
- nt_status = auth_generate_session_info(mem_ctx, server_info, &session_info);
+ nt_status = auth_generate_session_info(mem_ctx, gensec_security->lp_ctx, server_info, &session_info);
if (!NT_STATUS_IS_OK(nt_status)) {
talloc_free(mem_ctx);
return nt_status;
diff --git a/source4/auth/gensec/gensec_krb5.c b/source4/auth/gensec/gensec_krb5.c
index 26cc66a213..282be5a001 100644
--- a/source4/auth/gensec/gensec_krb5.c
+++ b/source4/auth/gensec/gensec_krb5.c
@@ -641,7 +641,7 @@ static NTSTATUS gensec_krb5_session_info(struct gensec_security *gensec_security
}
/* references the server_info into the session_info */
- nt_status = auth_generate_session_info(mem_ctx, server_info, &session_info);
+ nt_status = auth_generate_session_info(mem_ctx, gensec_security->lp_ctx, server_info, &session_info);
if (!NT_STATUS_IS_OK(nt_status)) {
talloc_free(mem_ctx);
diff --git a/source4/auth/ntlmssp/ntlmssp_server.c b/source4/auth/ntlmssp/ntlmssp_server.c
index 52c027baac..1ee05cf66a 100644
--- a/source4/auth/ntlmssp/ntlmssp_server.c
+++ b/source4/auth/ntlmssp/ntlmssp_server.c
@@ -717,7 +717,7 @@ NTSTATUS gensec_ntlmssp_session_info(struct gensec_security *gensec_security,
NTSTATUS nt_status;
struct gensec_ntlmssp_state *gensec_ntlmssp_state = (struct gensec_ntlmssp_state *)gensec_security->private_data;
- nt_status = auth_generate_session_info(gensec_ntlmssp_state, gensec_ntlmssp_state->server_info, session_info);
+ nt_status = auth_generate_session_info(gensec_ntlmssp_state, gensec_security->lp_ctx, gensec_ntlmssp_state->server_info, session_info);
NT_STATUS_NOT_OK_RETURN(nt_status);
(*session_info)->session_key = data_blob_talloc(*session_info,
diff --git a/source4/auth/session.c b/source4/auth/session.c
index 70cfc1a101..c86fff90df 100644
--- a/source4/auth/session.c
+++ b/source4/auth/session.c
@@ -59,7 +59,7 @@ NTSTATUS auth_anonymous_session_info(TALLOC_CTX *parent_ctx,
}
/* references the server_info into the session_info */
- nt_status = auth_generate_session_info(parent_ctx, server_info, &session_info);
+ nt_status = auth_generate_session_info(parent_ctx, lp_ctx, server_info, &session_info);
talloc_free(mem_ctx);
NT_STATUS_NOT_OK_RETURN(nt_status);
@@ -150,6 +150,7 @@ NTSTATUS auth_anonymous_server_info(TALLOC_CTX *mem_ctx,
}
NTSTATUS auth_generate_session_info(TALLOC_CTX *mem_ctx,
+ struct loadparm_context *lp_ctx,
struct auth_serversupplied_info *server_info,
struct auth_session_info **_session_info)
{
@@ -166,7 +167,7 @@ NTSTATUS auth_generate_session_info(TALLOC_CTX *mem_ctx,
session_info->session_key = server_info->user_session_key;
nt_status = security_token_create(session_info,
- global_loadparm,
+ lp_ctx,
server_info->account_sid,
server_info->primary_group_sid,
server_info->n_domain_groups,
diff --git a/source4/client/cifsdd.c b/source4/client/cifsdd.c
index a48235d047..6c3edeb892 100644
--- a/source4/client/cifsdd.c
+++ b/source4/client/cifsdd.c
@@ -390,12 +390,12 @@ static struct dd_iohandle * open_file(const char * which)
return(handle);
}
-static void set_max_xmit(uint64_t iomax)
+static void set_max_xmit(struct loadparm_context *lp_ctx, uint64_t iomax)
{
char buf[64];
snprintf(buf, sizeof(buf), "%llu", (unsigned long long)iomax);
- lp_set_cmdline(global_loadparm, "max xmit", buf);
+ lp_set_cmdline(lp_ctx, "max xmit", buf);
}
static int copy_files(void)
@@ -426,7 +426,7 @@ static int copy_files(void)
return(EOM_EXIT_CODE);
}
- set_max_xmit(MAX(ibs, obs));
+ set_max_xmit(global_loadparm, MAX(ibs, obs));
DEBUG(4, ("IO buffer size is %llu, max xmit is %d\n",
(unsigned long long)iomax, lp_max_xmit(global_loadparm)));
diff --git a/source4/lib/charset/tests/iconv.c b/source4/lib/charset/tests/iconv.c
index 259769d60f..9080dda40e 100644
--- a/source4/lib/charset/tests/iconv.c
+++ b/source4/lib/charset/tests/iconv.c
@@ -34,7 +34,7 @@ static bool iconv_untestable(struct torture_context *tctx)
{
iconv_t cd;
- if (!lp_parm_bool(global_loadparm, NULL, "iconv", "native", true))
+ if (!lp_parm_bool(tctx->lp_ctx, NULL, "iconv", "native", true))
torture_skip(tctx, "system iconv disabled - skipping test");
cd = iconv_open("UTF-16LE", "UCS-4LE");
diff --git a/source4/libcli/finddcs.c b/source4/libcli/finddcs.c
index e00697fe17..75dc14e3f4 100644
--- a/source4/libcli/finddcs.c
+++ b/source4/libcli/finddcs.c
@@ -93,8 +93,7 @@ struct composite_context *finddcs_send(TALLOC_CTX *mem_ctx,
state->msg_ctx = msg_ctx;
make_nbt_name(&name, state->domain_name, name_type);
- creq = resolve_name_send(&name, event_ctx,
- methods);
+ creq = resolve_name_send(&name, event_ctx, methods);
composite_continue(c, creq, finddcs_name_resolved, state);
return c;
}
diff --git a/source4/libcli/raw/clisocket.c b/source4/libcli/raw/clisocket.c
index a748b40a32..e3420313c5 100644
--- a/source4/libcli/raw/clisocket.c
+++ b/source4/libcli/raw/clisocket.c
@@ -239,7 +239,7 @@ struct smbcli_socket *smbcli_sock_connect_byname(const char *host, int port,
make_nbt_name(&nbt_name, host, name_type);
- status = resolve_name(&nbt_name, tmp_ctx, &address, event_ctx);
+ status = resolve_name(&nbt_name, tmp_ctx, &address, event_ctx, lp_name_resolve_order(global_loadparm));
if (!NT_STATUS_IS_OK(status)) {
talloc_free(tmp_ctx);
return NULL;
diff --git a/source4/libcli/resolve/resolve.c b/source4/libcli/resolve/resolve.c
index 24113db9f0..0f8839a3b7 100644
--- a/source4/libcli/resolve/resolve.c
+++ b/source4/libcli/resolve/resolve.c
@@ -187,11 +187,9 @@ NTSTATUS resolve_name_recv(struct composite_context *c,
/*
general name resolution - sync call
*/
-NTSTATUS resolve_name(struct nbt_name *name, TALLOC_CTX *mem_ctx, const char **reply_addr,
- struct event_context *ev)
+NTSTATUS resolve_name(struct nbt_name *name, TALLOC_CTX *mem_ctx, const char **reply_addr, struct event_context *ev, const char **name_resolve_order)
{
- struct composite_context *c = resolve_name_send(name, ev,
- lp_name_resolve_order(global_loadparm));
+ struct composite_context *c = resolve_name_send(name, ev, name_resolve_order);
return resolve_name_recv(c, mem_ctx, reply_addr);
}
diff --git a/source4/libnet/libnet_site.c b/source4/libnet/libnet_site.c
index cbb4bcdae3..251cecb3b0 100644
--- a/source4/libnet/libnet_site.c
+++ b/source4/libnet/libnet_site.c
@@ -24,8 +24,9 @@
#include "lib/ldb/include/ldb_errors.h"
#include "librpc/rpc/dcerpc.h"
#include "libcli/resolve/resolve.h"
+#include "param/param.h"
-/*
+/**
* 1. Setup a CLDAP socket.
* 2. Lookup the default Site-Name.
*/
@@ -145,7 +146,7 @@ NTSTATUS libnet_JoinSite(struct ldb_context *remote_ldb,
}
make_nbt_name_client(&name, libnet_r->out.samr_binding->host);
- status = resolve_name(&name, r, &dest_addr, NULL);
+ status = resolve_name(&name, r, &dest_addr, NULL, lp_name_resolve_order(global_loadparm));
if (!NT_STATUS_IS_OK(status)) {
libnet_r->out.error_string = NULL;
talloc_free(tmp_ctx);
diff --git a/source4/scripting/ejs/smbcalls_auth.c b/source4/scripting/ejs/smbcalls_auth.c
index 236edbd64d..7747bb14c6 100644
--- a/source4/scripting/ejs/smbcalls_auth.c
+++ b/source4/scripting/ejs/smbcalls_auth.c
@@ -108,7 +108,7 @@ static int ejs_doauth(MprVarHandle eid,
goto done;
}
- nt_status = auth_generate_session_info(tmp_ctx, server_info, &session_info);
+ nt_status = auth_generate_session_info(tmp_ctx, global_loadparm, server_info, &session_info);
if (!NT_STATUS_IS_OK(nt_status)) {
mprSetPropertyValue(auth, "report", mprString("Session Info generation failed"));
mprSetPropertyValue(auth, "result", mprCreateBoolVar(false));
diff --git a/source4/scripting/ejs/smbcalls_nbt.c b/source4/scripting/ejs/smbcalls_nbt.c
index 4a7ef682f8..5eaf458f34 100644
--- a/source4/scripting/ejs/smbcalls_nbt.c
+++ b/source4/scripting/ejs/smbcalls_nbt.c
@@ -70,7 +70,7 @@ static int ejs_resolve_name(MprVarHandle eid, int argc, struct MprVar **argv)
result = 0;
- nt_status = resolve_name(&name, tmp_ctx, &reply_addr, event_context_find(tmp_ctx));
+ nt_status = resolve_name(&name, tmp_ctx, &reply_addr, event_context_find(tmp_ctx), lp_name_resolve_order(global_loadparm));
if (NT_STATUS_IS_OK(nt_status)) {
mprSetPropertyValue(argv[0], "value", mprString(reply_addr));
diff --git a/source4/smb_server/smb/sesssetup.c b/source4/smb_server/smb/sesssetup.c
index d78f4050cf..8cc16aaa68 100644
--- a/source4/smb_server/smb/sesssetup.c
+++ b/source4/smb_server/smb/sesssetup.c
@@ -69,7 +69,7 @@ static void sesssetup_old_send(struct auth_check_password_request *areq,
if (!NT_STATUS_IS_OK(status)) goto failed;
/* This references server_info into session_info */
- status = auth_generate_session_info(req, server_info, &session_info);
+ status = auth_generate_session_info(req, global_loadparm, server_info, &session_info);
if (!NT_STATUS_IS_OK(status)) goto failed;
/* allocate a new session */
@@ -164,7 +164,7 @@ static void sesssetup_nt1_send(struct auth_check_password_request *areq,
if (!NT_STATUS_IS_OK(status)) goto failed;
/* This references server_info into session_info */
- status = auth_generate_session_info(req, server_info, &session_info);
+ status = auth_generate_session_info(req, global_loadparm, server_info, &session_info);
if (!NT_STATUS_IS_OK(status)) goto failed;
/* allocate a new session */
diff --git a/source4/torture/ldap/cldapbench.c b/source4/torture/ldap/cldapbench.c
index 9f860f98d9..21fe3849b1 100644
--- a/source4/torture/ldap/cldapbench.c
+++ b/source4/torture/ldap/cldapbench.c
@@ -24,6 +24,7 @@
#include "libcli/cldap/cldap.h"
#include "libcli/resolve/resolve.h"
#include "torture/torture.h"
+#include "param/param.h"
struct bench_state {
int pass_count, fail_count;
@@ -114,7 +115,7 @@ bool torture_bench_cldap(struct torture_context *torture)
make_nbt_name_server(&name, torture_setting_string(torture, "host", NULL));
/* do an initial name resolution to find its IP */
- status = resolve_name(&name, torture, &address, event_context_find(torture));
+ status = resolve_name(&name, torture, &address, event_context_find(torture), lp_name_resolve_order(torture->lp_ctx));
if (!NT_STATUS_IS_OK(status)) {
printf("Failed to resolve %s - %s\n",
name.name, nt_errstr(status));
diff --git a/source4/torture/nbt/dgram.c b/source4/torture/nbt/dgram.c
index 82d0617696..ff1a7b97cb 100644
--- a/source4/torture/nbt/dgram.c
+++ b/source4/torture/nbt/dgram.c
@@ -84,7 +84,7 @@ static bool nbt_test_netlogon(struct torture_context *tctx)
/* do an initial name resolution to find its IP */
torture_assert_ntstatus_ok(tctx,
- resolve_name(&name, tctx, &address, event_context_find(tctx)),
+ resolve_name(&name, tctx, &address, event_context_find(tctx), lp_name_resolve_order(global_loadparm)),
talloc_asprintf(tctx, "Failed to resolve %s", name.name));
myaddress = talloc_strdup(dgmsock, iface_best_ip(address));
@@ -163,7 +163,7 @@ static bool nbt_test_netlogon2(struct torture_context *tctx)
/* do an initial name resolution to find its IP */
torture_assert_ntstatus_ok(tctx,
- resolve_name(&name, tctx, &address, event_context_find(tctx)),
+ resolve_name(&name, tctx, &address, event_context_find(tctx), lp_name_resolve_order(tctx->lp_ctx)),
talloc_asprintf(tctx, "Failed to resolve %s", name.name));
myaddress = talloc_strdup(dgmsock, iface_best_ip(address));
@@ -272,7 +272,7 @@ static bool nbt_test_ntlogon(struct torture_context *tctx)
/* do an initial name resolution to find its IP */
torture_assert_ntstatus_ok(tctx,
- resolve_name(&name, tctx, &address, event_context_find(tctx)),
+ resolve_name(&name, tctx, &address, event_context_find(tctx), lp_name_resolve_order(tctx->lp_ctx)),
talloc_asprintf(tctx, "Failed to resolve %s", name.name));
myaddress = talloc_strdup(dgmsock, iface_best_ip(address));
diff --git a/source4/torture/nbt/nbt.c b/source4/torture/nbt/nbt.c
index 2a3678ee75..7cf2a48c4e 100644
--- a/source4/torture/nbt/nbt.c
+++ b/source4/torture/nbt/nbt.c
@@ -23,6 +23,7 @@
#include "torture/nbt/proto.h"
#include "torture/ui.h"
#include "libcli/resolve/resolve.h"
+#include "param/param.h"
bool torture_nbt_get_name(struct torture_context *tctx,
struct nbt_name *name,
@@ -33,7 +34,7 @@ bool torture_nbt_get_name(struct torture_context *tctx,
/* do an initial name resolution to find its IP */
torture_assert_ntstatus_ok(tctx,
- resolve_name(name, tctx, address, NULL),
+ resolve_name(name, tctx, address, NULL, lp_name_resolve_order(tctx->lp_ctx)),
talloc_asprintf(tctx,
"Failed to resolve %s", name->name));
diff --git a/source4/torture/rpc/dssync.c b/source4/torture/rpc/dssync.c
index 7c56a52203..738a049e73 100644
--- a/source4/torture/rpc/dssync.c
+++ b/source4/torture/rpc/dssync.c
@@ -78,14 +78,14 @@ struct DsSyncTest {
} old_dc;
};
-static struct DsSyncTest *test_create_context(TALLOC_CTX *mem_ctx)
+static struct DsSyncTest *test_create_context(struct torture_context *tctx)
{
NTSTATUS status;
struct DsSyncTest *ctx;
struct drsuapi_DsBindInfo28 *our_bind_info28;
struct drsuapi_DsBindInfoCtr *our_bind_info_ctr;
- const char *binding = lp_parm_string(global_loadparm, NULL, "torture", "binding");
- ctx = talloc_zero(mem_ctx, struct DsSyncTest);
+ const char *binding = torture_setting_string(tctx, "binding", NULL);
+ ctx = talloc_zero(tctx, struct DsSyncTest);
if (!ctx) return NULL;
status = dcerpc_parse_binding(ctx, binding, &ctx->drsuapi_binding);
@@ -149,7 +149,7 @@ static struct DsSyncTest *test_create_context(TALLOC_CTX *mem_ctx)
our_bind_info28->supported_extensions |= DRSUAPI_SUPPORTED_EXTENSION_ADDENTRYREPLY_V3;
our_bind_info28->supported_extensions |= DRSUAPI_SUPPORTED_EXTENSION_GETCHGREPLY_V7;
our_bind_info28->supported_extensions |= DRSUAPI_SUPPORTED_EXTENSION_VERIFY_OBJECT;
- if (lp_parm_bool(global_loadparm, NULL, "dssync", "xpress", false)) {
+ if (lp_parm_bool(tctx->lp_ctx, NULL, "dssync", "xpress", false)) {
our_bind_info28->supported_extensions |= DRSUAPI_SUPPORTED_EXTENSION_XPRESS_COMPRESS;
}
our_bind_info28->site_guid = GUID_zero();
@@ -246,7 +246,7 @@ static bool test_LDAPBind(struct DsSyncTest *ctx, struct cli_credentials *creden
return ret;
}
-static bool test_GetInfo(struct DsSyncTest *ctx)
+static bool test_GetInfo(struct torture_context *tctx, struct DsSyncTest *ctx)
{
NTSTATUS status;
struct drsuapi_DsCrackNames r;
@@ -265,7 +265,7 @@ static bool test_GetInfo(struct DsSyncTest *ctx)
r.in.req.req1.format_flags = DRSUAPI_DS_NAME_FLAG_NO_FLAGS;
r.in.req.req1.format_offered = DRSUAPI_DS_NAME_FORMAT_NT4_ACCOUNT;
r.in.req.req1.format_desired = DRSUAPI_DS_NAME_FORMAT_FQDN_1779;
- names[0].str = talloc_asprintf(ctx, "%s\\", lp_workgroup(global_loadparm));
+ names[0].str = talloc_asprintf(ctx, "%s\\", lp_workgroup(tctx->lp_ctx));
status = dcerpc_drsuapi_DsCrackNames(ctx->admin.drsuapi.pipe, ctx, &r);
if (!NT_STATUS_IS_OK(status)) {
@@ -413,18 +413,19 @@ static DATA_BLOB decrypt_blob(TALLOC_CTX *mem_ctx,
return plain_buffer;
}
-static void test_analyse_objects(struct DsSyncTest *ctx,
+static void test_analyse_objects(struct torture_context *tctx,
+ struct DsSyncTest *ctx,
const DATA_BLOB *gensec_skey,
struct drsuapi_DsReplicaObjectListItemEx *cur)
{
static uint32_t object_id;
const char *save_values_dir;
- if (!lp_parm_bool(global_loadparm, NULL, "dssync", "print_pwd_blobs", false)) {
+ if (!lp_parm_bool(tctx->lp_ctx, NULL, "dssync", "print_pwd_blobs", false)) {
return;
}
- save_values_dir = lp_parm_string(global_loadparm, NULL, "dssync", "save_pwd_blobs_dir");
+ save_values_dir = lp_parm_string(tctx->lp_ctx, NULL, "dssync", "save_pwd_blobs_dir");
for (; cur; cur = cur->next_object) {
const char *dn;
@@ -531,7 +532,7 @@ static void test_analyse_objects(struct DsSyncTest *ctx,
}
}
-static bool test_FetchData(struct DsSyncTest *ctx)
+static bool test_FetchData(struct torture_context *tctx, struct DsSyncTest *ctx)
{
NTSTATUS status;
bool ret = true;
@@ -560,17 +561,17 @@ static bool test_FetchData(struct DsSyncTest *ctx)
ZERO_STRUCT(null_guid);
ZERO_STRUCT(null_sid);
- partition = lp_parm_string(global_loadparm, NULL, "dssync", "partition");
+ partition = lp_parm_string(tctx->lp_ctx, NULL, "dssync", "partition");
if (partition == NULL) {
partition = ctx->domain_dn;
printf("dssync:partition not specified, defaulting to %s.\n", ctx->domain_dn);
}
- highest_usn = lp_parm_int(global_loadparm, NULL, "dssync", "highest_usn", 0);
+ highest_usn = lp_parm_int(tctx->lp_ctx, NULL, "dssync", "highest_usn", 0);
- array[0].level = lp_parm_int(global_loadparm, NULL, "dssync", "get_nc_changes_level", array[0].level);
+ array[0].level = lp_parm_int(tctx->lp_ctx, NULL, "dssync", "get_nc_changes_level", array[0].level);
- if (lp_parm_bool(global_loadparm, NULL, "dssync", "print_pwd_blobs", false)) {
+ if (lp_parm_bool(tctx->lp_ctx, NULL, "dssync", "print_pwd_blobs", false)) {
const struct samr_Password *nthash;
nthash = cli_credentials_get_nt_hash(ctx->new_dc.credentials, ctx);
if (nthash) {
@@ -605,10 +606,10 @@ static bool test_FetchData(struct DsSyncTest *ctx)
r.in.req.req5.highwatermark.highest_usn = highest_usn;
r.in.req.req5.uptodateness_vector = NULL;
r.in.req.req5.replica_flags = 0;
- if (lp_parm_bool(global_loadparm, NULL, "dssync", "compression", false)) {
+ if (lp_parm_bool(tctx->lp_ctx, NULL, "dssync", "compression", false)) {
r.in.req.req5.replica_flags |= DRSUAPI_DS_REPLICA_NEIGHBOUR_COMPRESS_CHANGES;
}
- if (lp_parm_bool(global_loadparm, NULL, "dssync", "neighbour_writeable", true)) {
+ if (lp_parm_bool(tctx->lp_ctx, NULL, "dssync", "neighbour_writeable", true)) {
r.in.req.req5.replica_flags |= DRSUAPI_DS_REPLICA_NEIGHBOUR_WRITEABLE;
}
r.in.req.req5.replica_flags |= DRSUAPI_DS_REPLICA_NEIGHBOUR_SYNC_ON_STARTUP
@@ -636,10 +637,10 @@ static bool test_FetchData(struct DsSyncTest *ctx)
r.in.req.req8.highwatermark.highest_usn = highest_usn;
r.in.req.req8.uptodateness_vector = NULL;
r.in.req.req8.replica_flags = 0;
- if (lp_parm_bool(global_loadparm, NULL, "dssync", "compression", false)) {
+ if (lp_parm_bool(tctx->lp_ctx, NULL, "dssync", "compression", false)) {
r.in.req.req8.replica_flags |= DRSUAPI_DS_REPLICA_NEIGHBOUR_COMPRESS_CHANGES;
}
- if (lp_parm_bool(global_loadparm, NULL, "dssync", "neighbour_writeable", true)) {
+ if (lp_parm_bool(tctx->lp_ctx, NULL, "dssync", "neighbour_writeable", true)) {
r.in.req.req8.replica_flags |= DRSUAPI_DS_REPLICA_NEIGHBOUR_WRITEABLE;
}
r.in.req.req8.replica_flags |= DRSUAPI_DS_REPLICA_NEIGHBOUR_SYNC_ON_STARTUP
@@ -704,7 +705,7 @@ static bool test_FetchData(struct DsSyncTest *ctx)
(long long)ctr1->new_highwatermark.tmp_highest_usn,
(long long)ctr1->new_highwatermark.highest_usn));
- test_analyse_objects(ctx, &gensec_skey, ctr1->first_object);
+ test_analyse_objects(tctx, ctx, &gensec_skey, ctr1->first_object);
if (ctr1->new_highwatermark.tmp_highest_usn > ctr1->new_highwatermark.highest_usn) {
r.in.req.req5.highwatermark = ctr1->new_highwatermark;
@@ -727,7 +728,7 @@ static bool test_FetchData(struct DsSyncTest *ctx)
(long long)ctr6->new_highwatermark.tmp_highest_usn,
(long long)ctr6->new_highwatermark.highest_usn));
- test_analyse_objects(ctx, &gensec_skey, ctr6->first_object);
+ test_analyse_objects(tctx, ctx, &gensec_skey, ctr6->first_object);
if (ctr6->new_highwatermark.tmp_highest_usn > ctr6->new_highwatermark.highest_usn) {
r.in.req.req8.highwatermark = ctr6->new_highwatermark;
@@ -742,7 +743,8 @@ static bool test_FetchData(struct DsSyncTest *ctx)
return ret;
}
-static bool test_FetchNT4Data(struct DsSyncTest *ctx)
+static bool test_FetchNT4Data(struct torture_context *tctx,
+ struct DsSyncTest *ctx)
{
NTSTATUS status;
bool ret = true;
@@ -759,8 +761,8 @@ static bool test_FetchNT4Data(struct DsSyncTest *ctx)
r.in.bind_handle = &ctx->new_dc.drsuapi.bind_handle;
r.in.level = 1;
- r.in.req.req1.unknown1 = lp_parm_int(global_loadparm, NULL, "dssync", "nt4-1", 3);
- r.in.req.req1.unknown2 = lp_parm_int(global_loadparm, NULL, "dssync", "nt4-2", 0x00004000);
+ r.in.req.req1.unknown1 = lp_parm_int(tctx->lp_ctx, NULL, "dssync", "nt4-1", 3);
+ r.in.req.req1.unknown2 = lp_parm_int(tctx->lp_ctx, NULL, "dssync", "nt4-2", 0x00004000);
while (1) {
r.in.req.req1.length = cookie.length;
@@ -806,7 +808,7 @@ bool torture_rpc_dssync(struct torture_context *torture)
struct DsSyncTest *ctx;
mem_ctx = talloc_init("torture_rpc_dssync");
- ctx = test_create_context(mem_ctx);
+ ctx = test_create_context(torture);
ret &= _test_DsBind(ctx, ctx->admin.credentials, &ctx->admin.drsuapi);
if (!ret) {
@@ -816,13 +818,13 @@ bool torture_rpc_dssync(struct torture_context *torture)
if (!ret) {
return ret;
}
- ret &= test_GetInfo(ctx);
+ ret &= test_GetInfo(torture, ctx);
ret &= _test_DsBind(ctx, ctx->new_dc.credentials, &ctx->new_dc.drsuapi);
if (!ret) {
return ret;
}
- ret &= test_FetchData(ctx);
- ret &= test_FetchNT4Data(ctx);
+ ret &= test_FetchData(torture, ctx);
+ ret &= test_FetchNT4Data(torture, ctx);
return ret;
}