summaryrefslogtreecommitdiff
path: root/source4/torture/rpc
diff options
context:
space:
mode:
authorJelmer Vernooij <jelmer@samba.org>2007-09-08 16:46:30 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 15:05:43 -0500
commit98b57d5eb61094a9c88e2f7d90d3e21b7e74e9d8 (patch)
tree044b24a249cc2b63c2f69214d7e7da288c170c74 /source4/torture/rpc
parentce0ff008b5c5af931526d14fa6232f8647e0880f (diff)
downloadsamba-98b57d5eb61094a9c88e2f7d90d3e21b7e74e9d8.tar.gz
samba-98b57d5eb61094a9c88e2f7d90d3e21b7e74e9d8.tar.bz2
samba-98b57d5eb61094a9c88e2f7d90d3e21b7e74e9d8.zip
r25035: Fix some more warnings, use service pointer rather than service number in more places.
(This used to be commit df9cebcb97e20564359097148665bd519f31bc6f)
Diffstat (limited to 'source4/torture/rpc')
-rw-r--r--source4/torture/rpc/autoidl.c3
-rw-r--r--source4/torture/rpc/bench.c4
-rw-r--r--source4/torture/rpc/countcalls.c2
-rw-r--r--source4/torture/rpc/drsuapi.c6
-rw-r--r--source4/torture/rpc/dssync.c32
-rw-r--r--source4/torture/rpc/echo.c6
-rw-r--r--source4/torture/rpc/eventlog.c2
-rw-r--r--source4/torture/rpc/lsa.c10
-rw-r--r--source4/torture/rpc/netlogon.c4
-rw-r--r--source4/torture/rpc/samba3rpc.c2
-rw-r--r--source4/torture/rpc/samlogon.c2
-rw-r--r--source4/torture/rpc/samr.c16
-rw-r--r--source4/torture/rpc/samsync.c4
-rw-r--r--source4/torture/rpc/schannel.c4
-rw-r--r--source4/torture/rpc/session_key.c3
-rw-r--r--source4/torture/rpc/svcctl.c2
-rw-r--r--source4/torture/rpc/testjoin.c6
17 files changed, 54 insertions, 54 deletions
diff --git a/source4/torture/rpc/autoidl.c b/source4/torture/rpc/autoidl.c
index 76d838517c..451b8ab120 100644
--- a/source4/torture/rpc/autoidl.c
+++ b/source4/torture/rpc/autoidl.c
@@ -95,8 +95,7 @@ static void reopen(TALLOC_CTX *mem_ctx,
talloc_free(*p);
- status = torture_rpc_connection(mem_ctx,
- p, iface);
+ status = torture_rpc_connection(mem_ctx, p, iface);
if (!NT_STATUS_IS_OK(status)) {
printf("Failed to reopen '%s' - %s\n", iface->name, nt_errstr(status));
exit(1);
diff --git a/source4/torture/rpc/bench.c b/source4/torture/rpc/bench.c
index be00e0b7a6..7f71723e6d 100644
--- a/source4/torture/rpc/bench.c
+++ b/source4/torture/rpc/bench.c
@@ -72,7 +72,7 @@ static BOOL bench_NetShareEnumAll(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx)
{
struct timeval tv = timeval_current();
BOOL ret = True;
- int timelimit = lp_parm_int(-1, "torture", "timelimit", 10);
+ int timelimit = lp_parm_int(NULL, "torture", "timelimit", 10);
int count=0;
printf("Running for %d seconds\n", timelimit);
@@ -82,7 +82,7 @@ static BOOL bench_NetShareEnumAll(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx)
talloc_free(tmp_ctx);
count++;
if (count % 50 == 0) {
- if (lp_parm_bool(-1, "torture", "progress", true)) {
+ if (lp_parm_bool(NULL, "torture", "progress", true)) {
printf("%.1f queries per second \r",
count / timeval_elapsed(&tv));
}
diff --git a/source4/torture/rpc/countcalls.c b/source4/torture/rpc/countcalls.c
index c1fdc069cb..0d3df0ffb3 100644
--- a/source4/torture/rpc/countcalls.c
+++ b/source4/torture/rpc/countcalls.c
@@ -111,7 +111,7 @@ BOOL torture_rpc_countcalls(struct torture_context *torture)
if (!mem_ctx) {
return False;
}
- iface_name = lp_parm_string(-1, "countcalls", "interface");
+ iface_name = lp_parm_string(NULL, "countcalls", "interface");
if (iface_name != NULL) {
iface = ndr_table_by_name(iface_name);
if (!iface) {
diff --git a/source4/torture/rpc/drsuapi.c b/source4/torture/rpc/drsuapi.c
index c3ec54cbcd..3f59f1d56d 100644
--- a/source4/torture/rpc/drsuapi.c
+++ b/source4/torture/rpc/drsuapi.c
@@ -538,7 +538,7 @@ static bool test_DsGetNCChanges(struct torture_context *tctx,
r.in.req.req5.highwatermark.highest_usn = 0;
r.in.req.req5.uptodateness_vector = NULL;
r.in.req.req5.replica_flags = 0;
- if (lp_parm_bool(-1, "drsuapi", "compression", false)) {
+ if (lp_parm_bool(NULL, "drsuapi", "compression", false)) {
r.in.req.req5.replica_flags |= DRSUAPI_DS_REPLICA_NEIGHBOUR_COMPRESS_CHANGES;
}
r.in.req.req5.max_object_count = 0;
@@ -560,10 +560,10 @@ static bool test_DsGetNCChanges(struct torture_context *tctx,
r.in.req.req8.highwatermark.highest_usn = 0;
r.in.req.req8.uptodateness_vector = NULL;
r.in.req.req8.replica_flags = 0;
- if (lp_parm_bool(-1, "drsuapi", "compression", false)) {
+ if (lp_parm_bool(NULL, "drsuapi", "compression", false)) {
r.in.req.req8.replica_flags |= DRSUAPI_DS_REPLICA_NEIGHBOUR_COMPRESS_CHANGES;
}
- if (lp_parm_bool(-1, "drsuapi", "neighbour_writeable",true)) {
+ if (lp_parm_bool(NULL, "drsuapi", "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
diff --git a/source4/torture/rpc/dssync.c b/source4/torture/rpc/dssync.c
index bf3e59c380..5ea578e041 100644
--- a/source4/torture/rpc/dssync.c
+++ b/source4/torture/rpc/dssync.c
@@ -84,7 +84,7 @@ static struct DsSyncTest *test_create_context(TALLOC_CTX *mem_ctx)
struct DsSyncTest *ctx;
struct drsuapi_DsBindInfo28 *our_bind_info28;
struct drsuapi_DsBindInfoCtr *our_bind_info_ctr;
- const char *binding = lp_parm_string(-1, "torture", "binding");
+ const char *binding = lp_parm_string(NULL, "torture", "binding");
ctx = talloc_zero(mem_ctx, struct DsSyncTest);
if (!ctx) return NULL;
@@ -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(-1,"dssync","xpress",False)) {
+ if (lp_parm_bool(NULL, "dssync", "xpress", false)) {
our_bind_info28->supported_extensions |= DRSUAPI_SUPPORTED_EXTENSION_XPRESS_COMPRESS;
}
our_bind_info28->site_guid = GUID_zero();
@@ -420,11 +420,11 @@ static void test_analyse_objects(struct DsSyncTest *ctx,
static uint32_t object_id;
const char *save_values_dir;
- if (!lp_parm_bool(-1,"dssync","print_pwd_blobs", false)) {
+ if (!lp_parm_bool(NULL,"dssync","print_pwd_blobs", false)) {
return;
}
- save_values_dir = lp_parm_string(-1,"dssync","save_pwd_blobs_dir");
+ save_values_dir = lp_parm_string(NULL, "dssync", "save_pwd_blobs_dir");
for (; cur; cur = cur->next_object) {
const char *dn;
@@ -560,17 +560,17 @@ static BOOL test_FetchData(struct DsSyncTest *ctx)
ZERO_STRUCT(null_guid);
ZERO_STRUCT(null_sid);
- partition = lp_parm_string(-1, "dssync", "partition");
+ partition = lp_parm_string(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(-1, "dssync", "highest_usn", 0);
+ highest_usn = lp_parm_int(NULL, "dssync", "highest_usn", 0);
- array[0].level = lp_parm_int(-1, "dssync", "get_nc_changes_level", array[0].level);
+ array[0].level = lp_parm_int(NULL, "dssync", "get_nc_changes_level", array[0].level);
- if (lp_parm_bool(-1,"dssync","print_pwd_blobs",False)) {
+ if (lp_parm_bool(NULL, "dssync", "print_pwd_blobs", false)) {
const struct samr_Password *nthash;
nthash = cli_credentials_get_nt_hash(ctx->new_dc.credentials, ctx);
if (nthash) {
@@ -606,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(-1,"dssync","compression",False)) {
+ if (lp_parm_bool(NULL, "dssync", "compression", false)) {
r.in.req.req5.replica_flags |= DRSUAPI_DS_REPLICA_NEIGHBOUR_COMPRESS_CHANGES;
}
- if (lp_parm_bool(-1,"dssync","neighbour_writeable",True)) {
+ if (lp_parm_bool(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
@@ -637,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(-1,"dssync","compression",False)) {
+ if (lp_parm_bool(NULL, "dssync", "compression", false)) {
r.in.req.req8.replica_flags |= DRSUAPI_DS_REPLICA_NEIGHBOUR_COMPRESS_CHANGES;
}
- if (lp_parm_bool(-1,"dssync","neighbour_writeable",True)) {
+ if (lp_parm_bool(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
@@ -760,8 +760,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(-1, "dssync", "nt4-1", 3);
- r.in.req.req1.unknown2 = lp_parm_int(-1, "dssync", "nt4-2", 0x00004000);
+ r.in.req.req1.unknown1 = lp_parm_int(NULL, "dssync", "nt4-1", 3);
+ r.in.req.req1.unknown2 = lp_parm_int(NULL, "dssync", "nt4-2", 0x00004000);
while (1) {
r.in.req.req1.length = cookie.length;
@@ -800,9 +800,9 @@ static BOOL test_FetchNT4Data(struct DsSyncTest *ctx)
return ret;
}
-BOOL torture_rpc_dssync(struct torture_context *torture)
+bool torture_rpc_dssync(struct torture_context *torture)
{
- BOOL ret = True;
+ bool ret = true;
TALLOC_CTX *mem_ctx;
struct DsSyncTest *ctx;
diff --git a/source4/torture/rpc/echo.c b/source4/torture/rpc/echo.c
index 52f6d76d0e..c873cdf0ae 100644
--- a/source4/torture/rpc/echo.c
+++ b/source4/torture/rpc/echo.c
@@ -78,8 +78,8 @@ static bool test_echodata(struct torture_context *tctx,
len = 1 + (random() % 5000);
}
- data_in = talloc_size(tctx, len);
- data_out = talloc_size(tctx, len);
+ data_in = talloc_array(tctx, uint8_t, len);
+ data_out = talloc_array(tctx, uint8_t, len);
for (i=0;i<len;i++) {
data_in[i] = i;
}
@@ -159,7 +159,7 @@ static bool test_sinkdata(struct torture_context *tctx,
len = 200000 + (random() % 5000);
}
- data_in = talloc_size(tctx, len);
+ data_in = talloc_array(tctx, uint8_t, len);
for (i=0;i<len;i++) {
data_in[i] = i+1;
}
diff --git a/source4/torture/rpc/eventlog.c b/source4/torture/rpc/eventlog.c
index 539923a2e0..c1d863454c 100644
--- a/source4/torture/rpc/eventlog.c
+++ b/source4/torture/rpc/eventlog.c
@@ -125,7 +125,7 @@ static bool test_ReadEventLog(struct torture_context *tctx,
/* Now read the actual record */
r.in.number_of_bytes = *r.out.real_size;
- r.out.data = talloc_size(tctx, r.in.number_of_bytes);
+ r.out.data = talloc_array(tctx, uint8_t, r.in.number_of_bytes);
status = dcerpc_eventlog_ReadEventLogW(p, tctx, &r);
diff --git a/source4/torture/rpc/lsa.c b/source4/torture/rpc/lsa.c
index 46660231f8..2cc2b78a78 100644
--- a/source4/torture/rpc/lsa.c
+++ b/source4/torture/rpc/lsa.c
@@ -1224,7 +1224,7 @@ static BOOL test_QuerySecurity(struct dcerpc_pipe *p,
NTSTATUS status;
struct lsa_QuerySecurity r;
- if (lp_parm_bool(-1, "torture", "samba4", False)) {
+ if (lp_parm_bool(NULL, "torture", "samba4", false)) {
printf("skipping QuerySecurity test against Samba4\n");
return True;
}
@@ -1463,7 +1463,7 @@ static BOOL test_QueryForestTrustInformation(struct dcerpc_pipe *p,
printf("\nTesting lsaRQueryForestTrustInformation\n");
- if (lp_parm_bool(-1, "torture", "samba4", False)) {
+ if (lp_parm_bool(NULL, "torture", "samba4", false)) {
printf("skipping QueryForestTrustInformation against Samba4\n");
return True;
}
@@ -1830,7 +1830,7 @@ static BOOL test_QueryDomainInfoPolicy(struct dcerpc_pipe *p,
NTSTATUS status;
int i;
BOOL ret = True;
- if (lp_parm_bool(-1, "torture", "samba4", False)) {
+ if (lp_parm_bool(NULL, "torture", "samba4", false)) {
printf("skipping QueryDomainInformationPolicy test against Samba4\n");
return True;
}
@@ -1866,7 +1866,7 @@ static BOOL test_QueryInfoPolicy(struct dcerpc_pipe *p,
BOOL ret = True;
printf("\nTesting QueryInfoPolicy\n");
- if (lp_parm_bool(-1, "torture", "samba4", False)) {
+ if (lp_parm_bool(NULL, "torture", "samba4", false)) {
printf("skipping QueryInfoPolicy against Samba4\n");
return True;
}
@@ -1904,7 +1904,7 @@ static BOOL test_QueryInfoPolicy2(struct dcerpc_pipe *p,
int i;
BOOL ret = True;
printf("\nTesting QueryInfoPolicy2\n");
- if (lp_parm_bool(-1, "torture", "samba4", False)) {
+ if (lp_parm_bool(NULL, "torture", "samba4", false)) {
printf("skipping QueryInfoPolicy2 against Samba4\n");
return True;
}
diff --git a/source4/torture/rpc/netlogon.c b/source4/torture/rpc/netlogon.c
index 907772ac8a..6352865d98 100644
--- a/source4/torture/rpc/netlogon.c
+++ b/source4/torture/rpc/netlogon.c
@@ -1226,7 +1226,7 @@ static bool test_GetDomainInfo(struct torture_context *tctx,
static void async_callback(struct rpc_request *req)
{
- int *counter = req->async.private_data;
+ int *counter = (int *)req->async.private_data;
if (NT_STATUS_IS_OK(req->status)) {
(*counter)++;
}
@@ -1278,7 +1278,7 @@ static bool test_GetDomainInfo_async(struct torture_context *tctx,
for (i=0;i<ASYNC_COUNT;i++) {
creds_client_authenticator(creds, &a);
- creds_async[i] = talloc_memdup(creds, creds, sizeof(*creds));
+ creds_async[i] = (struct creds_CredentialState *)talloc_memdup(creds, creds, sizeof(*creds));
req[i] = dcerpc_netr_LogonGetDomainInfo_send(p, tctx, &r);
req[i]->async.callback = async_callback;
diff --git a/source4/torture/rpc/samba3rpc.c b/source4/torture/rpc/samba3rpc.c
index 73bb12de87..e6f54037bc 100644
--- a/source4/torture/rpc/samba3rpc.c
+++ b/source4/torture/rpc/samba3rpc.c
@@ -1230,7 +1230,7 @@ static BOOL test_join3(TALLOC_CTX *mem_ctx,
struct cli_credentials *wks_creds;
status = smbcli_full_connection(mem_ctx, &cli,
- lp_parm_string(-1, "torture", "host"),
+ lp_parm_string(NULL, "torture", "host"),
"IPC$", NULL, smb_creds, NULL);
if (!NT_STATUS_IS_OK(status)) {
d_printf("smbcli_full_connection failed: %s\n",
diff --git a/source4/torture/rpc/samlogon.c b/source4/torture/rpc/samlogon.c
index b149af1859..92c4da6321 100644
--- a/source4/torture/rpc/samlogon.c
+++ b/source4/torture/rpc/samlogon.c
@@ -1573,7 +1573,7 @@ BOOL torture_rpc_samlogon(struct torture_context *torture)
u.info21.fields_present = SAMR_FIELD_WORKSTATIONS | SAMR_FIELD_LOGON_HOURS;
u.info21.workstations.string = TEST_MACHINE_NAME;
u.info21.logon_hours.units_per_week = 168;
- u.info21.logon_hours.bits = talloc_zero_size(mem_ctx, 168);
+ u.info21.logon_hours.bits = talloc_zero_array(mem_ctx, uint8_t, 168);
status = dcerpc_samr_SetUserInfo(torture_join_samr_pipe(user_ctx_wrong_time), mem_ctx, &s);
if (!NT_STATUS_IS_OK(status)) {
diff --git a/source4/torture/rpc/samr.c b/source4/torture/rpc/samr.c
index 757142003a..2a70a5b71f 100644
--- a/source4/torture/rpc/samr.c
+++ b/source4/torture/rpc/samr.c
@@ -84,7 +84,7 @@ static BOOL test_Shutdown(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx,
NTSTATUS status;
struct samr_Shutdown r;
- if (!lp_parm_bool(-1, "torture", "dangerous", False)) {
+ if (!lp_parm_bool(NULL, "torture", "dangerous", false)) {
printf("samr_Shutdown disabled - enable dangerous tests to use\n");
return True;
}
@@ -110,7 +110,7 @@ static BOOL test_SetDsrmPassword(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx,
struct lsa_String string;
struct samr_Password hash;
- if (!lp_parm_bool(-1, "torture", "dangerous", False)) {
+ if (!lp_parm_bool(NULL, "torture", "dangerous", false)) {
printf("samr_SetDsrmPassword disabled - enable dangerous tests to use\n");
return True;
}
@@ -159,7 +159,7 @@ static BOOL test_QuerySecurity(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx,
s.in.sec_info = 7;
s.in.sdbuf = r.out.sdbuf;
- if (lp_parm_bool(-1, "torture", "samba4", False)) {
+ if (lp_parm_bool(NULL, "torture", "samba4", false)) {
printf("skipping SetSecurity test against Samba4\n");
return True;
}
@@ -415,7 +415,7 @@ static BOOL test_SetUserInfo(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx,
TEST_USERINFO_INT(21, logon_hours.bits[3], 21, logon_hours.bits[3], 4,
SAMR_FIELD_LOGON_HOURS);
- if (lp_parm_bool(-1, "torture", "samba4", False)) {
+ if (lp_parm_bool(NULL, "torture", "samba4", false)) {
printf("skipping Set Account Flag tests against Samba4\n");
return ret;
}
@@ -2121,7 +2121,7 @@ static BOOL test_alias_ops(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx,
ret = False;
}
- if (lp_parm_bool(-1, "torture", "samba4", False)) {
+ if (lp_parm_bool(NULL, "torture", "samba4", false)) {
printf("skipping MultipleMembers Alias tests against Samba4\n");
return ret;
}
@@ -3180,7 +3180,7 @@ static BOOL test_EnumDomainUsers_async(struct dcerpc_pipe *p, TALLOC_CTX *mem_ct
#define ASYNC_COUNT 100
struct rpc_request *req[ASYNC_COUNT];
- if (!lp_parm_bool(-1, "torture", "dangerous", False)) {
+ if (!lp_parm_bool(NULL, "torture", "dangerous", false)) {
printf("samr async test disabled - enable dangerous tests to use\n");
return True;
}
@@ -4067,7 +4067,7 @@ static BOOL test_AddGroupMember(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx,
return False;
}
- if (lp_parm_bool(-1, "torture", "samba4", False)) {
+ if (lp_parm_bool(NULL, "torture", "samba4", false)) {
printf("skipping SetMemberAttributesOfGroup test against Samba4\n");
} else {
/* this one is quite strange. I am using random inputs in the
@@ -4256,7 +4256,7 @@ static BOOL test_OpenDomain(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx,
ret &= test_QueryDisplayInfo3(p, mem_ctx, &domain_handle);
ret &= test_QueryDisplayInfo_continue(p, mem_ctx, &domain_handle);
- if (lp_parm_bool(-1, "torture", "samba4", False)) {
+ if (lp_parm_bool(NULL, "torture", "samba4", false)) {
printf("skipping GetDisplayEnumerationIndex test against Samba4\n");
} else {
ret &= test_GetDisplayEnumerationIndex(p, mem_ctx, &domain_handle);
diff --git a/source4/torture/rpc/samsync.c b/source4/torture/rpc/samsync.c
index baf4edca98..013a6db0bb 100644
--- a/source4/torture/rpc/samsync.c
+++ b/source4/torture/rpc/samsync.c
@@ -68,7 +68,7 @@ static NTSTATUS test_SamLogon(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx,
sizeof(ninfo.challenge));
if (nt_hash) {
ninfo.nt.length = 24;
- ninfo.nt.data = talloc_size(mem_ctx, 24);
+ ninfo.nt.data = talloc_array(mem_ctx, uint8_t, 24);
SMBOWFencrypt(nt_hash->hash, ninfo.challenge, ninfo.nt.data);
} else {
ninfo.nt.length = 0;
@@ -77,7 +77,7 @@ static NTSTATUS test_SamLogon(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx,
if (lm_hash) {
ninfo.lm.length = 24;
- ninfo.lm.data = talloc_size(mem_ctx, 24);
+ ninfo.lm.data = talloc_array(mem_ctx, uint8_t, 24);
SMBOWFencrypt(lm_hash->hash, ninfo.challenge, ninfo.lm.data);
} else {
ninfo.lm.length = 0;
diff --git a/source4/torture/rpc/schannel.c b/source4/torture/rpc/schannel.c
index 2494fbefff..7d963be1bb 100644
--- a/source4/torture/rpc/schannel.c
+++ b/source4/torture/rpc/schannel.c
@@ -233,7 +233,7 @@ static bool test_schannel(struct torture_context *tctx,
{
struct test_join *join_ctx;
NTSTATUS status;
- const char *binding = lp_parm_string(-1, "torture", "binding");
+ const char *binding = lp_parm_string(NULL, "torture", "binding");
struct dcerpc_binding *b;
struct dcerpc_pipe *p = NULL;
struct dcerpc_pipe *p_netlogon = NULL;
@@ -435,7 +435,7 @@ bool torture_rpc_schannel2(struct torture_context *torture)
torture_assert(torture, join_ctx != NULL,
"Failed to join domain with acct_flags=ACB_WSTRUST");
- credentials2 = talloc_memdup(torture, credentials1, sizeof(*credentials1));
+ credentials2 = (struct cli_credentials *)talloc_memdup(torture, credentials1, sizeof(*credentials1));
credentials1->netlogon_creds = NULL;
credentials2->netlogon_creds = NULL;
diff --git a/source4/torture/rpc/session_key.c b/source4/torture/rpc/session_key.c
index 0e1c2666f8..a976d2fec2 100644
--- a/source4/torture/rpc/session_key.c
+++ b/source4/torture/rpc/session_key.c
@@ -145,7 +145,8 @@ static bool test_secrets(struct torture_context *torture, const void *_data)
struct dcerpc_pipe *p;
struct policy_handle *handle;
struct dcerpc_binding *binding;
- const struct secret_settings *settings = _data;
+ const struct secret_settings *settings =
+ (const struct secret_settings *)_data;
lp_set_cmdline("ntlmssp client:keyexchange", settings->keyexchange?"True":"False");
lp_set_cmdline("ntlmssp_client:ntlm2", settings->ntlm2?"True":"False");
diff --git a/source4/torture/rpc/svcctl.c b/source4/torture/rpc/svcctl.c
index 2f2b4ec485..c9006baaf5 100644
--- a/source4/torture/rpc/svcctl.c
+++ b/source4/torture/rpc/svcctl.c
@@ -80,7 +80,7 @@ static bool test_EnumServicesStatus(struct torture_context *tctx, struct dcerpc_
if (W_ERROR_EQUAL(r.out.result, WERR_MORE_DATA)) {
r.in.buf_size = *r.out.bytes_needed;
- r.out.service = talloc_size(tctx, *r.out.bytes_needed);
+ r.out.service = talloc_array(tctx, uint8_t, *r.out.bytes_needed);
status = dcerpc_svcctl_EnumServicesStatusW(p, tctx, &r);
diff --git a/source4/torture/rpc/testjoin.c b/source4/torture/rpc/testjoin.c
index e20699cc04..f32d6832a3 100644
--- a/source4/torture/rpc/testjoin.c
+++ b/source4/torture/rpc/testjoin.c
@@ -126,7 +126,7 @@ struct test_join *torture_create_testuser(struct torture_context *torture,
int policy_min_pw_len = 0;
struct test_join *join;
char *random_pw;
- const char *dc_binding = lp_parm_string(-1, "torture", "dc_binding");
+ const char *dc_binding = lp_parm_string(NULL, "torture", "dc_binding");
join = talloc(NULL, struct test_join);
if (join == NULL) {
@@ -327,9 +327,9 @@ _PUBLIC_ struct test_join *torture_join_domain(const char *machine_name,
tj->libnet_r = libnet_r;
libnet_ctx->cred = cmdline_credentials;
- libnet_r->in.binding = lp_parm_string(-1, "torture", "binding");
+ libnet_r->in.binding = lp_parm_string(NULL, "torture", "binding");
if (!libnet_r->in.binding) {
- libnet_r->in.binding = talloc_asprintf(libnet_r, "ncacn_np:%s", lp_parm_string(-1, "torture", "host"));
+ libnet_r->in.binding = talloc_asprintf(libnet_r, "ncacn_np:%s", lp_parm_string(NULL, "torture", "host"));
}
libnet_r->in.level = LIBNET_JOINDOMAIN_SPECIFIED;
libnet_r->in.netbios_name = machine_name;