summaryrefslogtreecommitdiff
path: root/source4/torture
diff options
context:
space:
mode:
authorJelmer Vernooij <jelmer@samba.org>2008-10-11 03:12:21 +0200
committerJelmer Vernooij <jelmer@samba.org>2008-10-11 03:12:21 +0200
commit0fd0fc75c46b39a611c7f9a56081105714d73e36 (patch)
treeb93ef5e67e49a3aa49c37e13df3d6222b2df7095 /source4/torture
parent69d38a95c29498c0266cb98b911faa3e7240c787 (diff)
parent47f7ef8f39ba482a7d6578ab82c9e0670381c4f8 (diff)
downloadsamba-0fd0fc75c46b39a611c7f9a56081105714d73e36.tar.gz
samba-0fd0fc75c46b39a611c7f9a56081105714d73e36.tar.bz2
samba-0fd0fc75c46b39a611c7f9a56081105714d73e36.zip
Merge branch 'master' of ssh://git.samba.org/data/git/samba into selftest
Conflicts: selftest/selftest.pl
Diffstat (limited to 'source4/torture')
-rw-r--r--source4/torture/basic/misc.c1
-rw-r--r--source4/torture/basic/secleak.c5
-rw-r--r--source4/torture/config.mk2
-rw-r--r--source4/torture/gentest.c38
-rw-r--r--source4/torture/ldap/cldap.c88
-rw-r--r--source4/torture/ldap/schema.c68
-rw-r--r--source4/torture/ldap/uptodatevector.c10
-rw-r--r--source4/torture/local/dbspeed.c7
-rw-r--r--source4/torture/local/local.c2
-rw-r--r--source4/torture/locktest.c4
-rw-r--r--source4/torture/locktest2.c19
-rw-r--r--source4/torture/masktest.c9
-rw-r--r--source4/torture/nbt/dgram.c42
-rw-r--r--source4/torture/nbt/nbt.c2
-rw-r--r--source4/torture/nbt/query.c4
-rw-r--r--source4/torture/nbt/winsbench.c12
-rw-r--r--source4/torture/nbt/winsreplication.c6
-rw-r--r--source4/torture/ndr/lsa.c8
-rw-r--r--source4/torture/raw/chkpath.c10
-rw-r--r--source4/torture/raw/composite.c3
-rw-r--r--source4/torture/raw/context.c26
-rw-r--r--source4/torture/raw/lock.c5
-rw-r--r--source4/torture/raw/lockbench.c1
-rw-r--r--source4/torture/raw/notify.c37
-rw-r--r--source4/torture/raw/open.c59
-rw-r--r--source4/torture/raw/openbench.c1
-rw-r--r--source4/torture/raw/oplock.c5
-rw-r--r--source4/torture/raw/tconrate.c4
-rw-r--r--source4/torture/rpc/drsuapi_cracknames.c1
-rw-r--r--source4/torture/rpc/dssync.c8
-rw-r--r--source4/torture/rpc/join.c6
-rw-r--r--source4/torture/rpc/lsa.c64
-rw-r--r--source4/torture/rpc/netlogon.c14
-rw-r--r--source4/torture/rpc/object_uuid.c87
-rw-r--r--source4/torture/rpc/remote_pac.c57
-rw-r--r--source4/torture/rpc/rpc.c1
-rw-r--r--source4/torture/rpc/samba3rpc.c28
-rw-r--r--source4/torture/rpc/samlogon.c10
-rw-r--r--source4/torture/rpc/samr.c2
-rw-r--r--source4/torture/rpc/samsync.c2
-rw-r--r--source4/torture/rpc/testjoin.c3
-rw-r--r--source4/torture/rpc/winreg.c16
-rw-r--r--source4/torture/rpc/wkssvc.c2
-rw-r--r--source4/torture/smb2/create.c7
-rw-r--r--source4/torture/unix/unix_info2.c4
-rw-r--r--source4/torture/unix/whoami.c4
-rw-r--r--source4/torture/util_smb.c4
47 files changed, 518 insertions, 280 deletions
diff --git a/source4/torture/basic/misc.c b/source4/torture/basic/misc.c
index 24e0324bc3..c129fd586b 100644
--- a/source4/torture/basic/misc.c
+++ b/source4/torture/basic/misc.c
@@ -823,6 +823,7 @@ static struct composite_context *torture_connect_async(
smb->in.fallback_to_anonymous=false;
smb->in.workgroup=workgroup;
lp_smbcli_options(tctx->lp_ctx, &smb->in.options);
+ lp_smbcli_session_options(tctx->lp_ctx, &smb->in.session_options);
return smb_composite_connect_send(smb,mem_ctx,
lp_resolve_context(tctx->lp_ctx),ev);
diff --git a/source4/torture/basic/secleak.c b/source4/torture/basic/secleak.c
index 4caeee72a4..ca1fd444d9 100644
--- a/source4/torture/basic/secleak.c
+++ b/source4/torture/basic/secleak.c
@@ -36,8 +36,11 @@ static bool try_failed_login(struct torture_context *tctx, struct smbcli_state *
NTSTATUS status;
struct smb_composite_sesssetup setup;
struct smbcli_session *session;
+ struct smbcli_session_options options;
- session = smbcli_session_init(cli->transport, cli, false);
+ lp_smbcli_session_options(tctx->lp_ctx, &options);
+
+ session = smbcli_session_init(cli->transport, cli, false, options);
setup.in.sesskey = cli->transport->negotiate.sesskey;
setup.in.capabilities = cli->transport->negotiate.capabilities;
setup.in.workgroup = lp_workgroup(tctx->lp_ctx);
diff --git a/source4/torture/config.mk b/source4/torture/config.mk
index 96da10b5df..211d09756d 100644
--- a/source4/torture/config.mk
+++ b/source4/torture/config.mk
@@ -116,7 +116,7 @@ torture_rpc_OBJ_FILES = $(addprefix $(torturesrcdir)/rpc/, \
eventlog.o epmapper.o winreg.o initshutdown.o oxidresolve.o remact.o mgmt.o \
scanner.o autoidl.o countcalls.o testjoin.o schannel.o netlogon.o remote_pac.o samlogon.o \
samsync.o bind.o dssetup.o alter_context.o bench.o samba3rpc.o rpc.o async_bind.o \
- handles.o frsapi.o)
+ handles.o frsapi.o object_uuid.o)
$(eval $(call proto_header_template,$(torturesrcdir)/rpc/proto.h,$(torture_rpc_OBJ_FILES:.o=.c)))
diff --git a/source4/torture/gentest.c b/source4/torture/gentest.c
index af5a95e751..3bf3ad8b1b 100644
--- a/source4/torture/gentest.c
+++ b/source4/torture/gentest.c
@@ -214,7 +214,9 @@ static bool connect_servers(struct event_context *ev,
for (j=0;j<NINSTANCES;j++) {
NTSTATUS status;
struct smbcli_options smb_options;
+ struct smbcli_session_options smb_session_options;
lp_smbcli_options(lp_ctx, &smb_options);
+ lp_smbcli_session_options(lp_ctx, &smb_session_options);
printf("Connecting to \\\\%s\\%s as %s - instance %d\n",
servers[i].server_name, servers[i].share_name,
@@ -238,7 +240,8 @@ static bool connect_servers(struct event_context *ev,
servers[i].share_name, "A:",
servers[i].credentials,
lp_resolve_context(lp_ctx), ev,
- &smb_options);
+ &smb_options,
+ &smb_session_options);
}
if (!NT_STATUS_IS_OK(status)) {
printf("Failed to connect to \\\\%s\\%s - %s\n",
@@ -1165,6 +1168,8 @@ static void idle_func_smb2(struct smb2_transport *transport, void *private)
*/
static bool compare_status(NTSTATUS status1, NTSTATUS status2)
{
+ char *s;
+
if (NT_STATUS_EQUAL(status1, status2)) return true;
/* one code being an error and the other OK is always an error */
@@ -1178,6 +1183,17 @@ static bool compare_status(NTSTATUS status1, NTSTATUS status2)
ignore_pattern(nt_errstr(status2))) {
return true;
}
+
+ /* also support ignore patterns of the form NT_STATUS_XX:NT_STATUS_YY
+ meaning that the first server returns NT_STATUS_XX and the 2nd
+ returns NT_STATUS_YY */
+ s = talloc_asprintf(current_op.mem_ctx, "%s:%s",
+ nt_errstr(status1),
+ nt_errstr(status2));
+ if (ignore_pattern(s)) {
+ return true;
+ }
+
current_op.mismatch = nt_errstr(status1);
return false;
}
@@ -1348,7 +1364,7 @@ again:
} \
current_op.status = status[0]; \
for (i=1;i<NSERVERS;i++) { \
- if (!compare_status(status[i], status[0])) { \
+ if (!compare_status(status[0], status[1])) { \
printf("status different in %s - %s %s\n", #call, \
nt_errstr(status[0]), nt_errstr(status[i])); \
current_op.mismatch = nt_errstr(status[0]); \
@@ -2166,6 +2182,9 @@ static void gen_setfileinfo(int instance, union smb_setfileinfo *info)
case RAW_SFILEINFO_MODE_INFORMATION:
info->mode_information.in.mode = gen_bits_mask(0xFFFFFFFF);
break;
+ case RAW_SFILEINFO_FULL_EA_INFORMATION:
+ info->full_ea_information.in.eas = gen_ea_list();
+ break;
case RAW_SFILEINFO_GENERIC:
case RAW_SFILEINFO_SEC_DESC:
case RAW_SFILEINFO_UNIX_BASIC:
@@ -2222,7 +2241,8 @@ static void gen_setfileinfo(int instance, union smb_setfileinfo *info)
do {
i = gen_int_range(0, num_levels-1);
} while (ignore_pattern(levels[i].name));
-
+
+ ZERO_STRUCTP(info);
info->generic.level = levels[i].level;
switch (info->generic.level) {
@@ -2279,6 +2299,9 @@ static void gen_setfileinfo(int instance, union smb_setfileinfo *info)
case RAW_SFILEINFO_MODE_INFORMATION:
info->mode_information.in.mode = gen_bits_mask(0xFFFFFFFF);
break;
+ case RAW_SFILEINFO_FULL_EA_INFORMATION:
+ info->full_ea_information.in.eas = gen_ea_list();
+ break;
case RAW_SFILEINFO_GENERIC:
case RAW_SFILEINFO_SEC_DESC:
@@ -2372,9 +2395,8 @@ static bool handler_smb_spathinfo(int instance)
union smb_setfileinfo parm[NSERVERS];
NTSTATUS status[NSERVERS];
- parm[0].generic.in.file.path = gen_fname_open(instance);
-
gen_setfileinfo(instance, &parm[0]);
+ parm[0].generic.in.file.path = gen_fname_open(instance);
GEN_COPY_PARM;
@@ -2743,9 +2765,8 @@ static bool handler_smb2_sfileinfo(int instance)
union smb_setfileinfo parm[NSERVERS];
NTSTATUS status[NSERVERS];
- parm[0].generic.in.file.fnum = gen_fnum(instance);
-
gen_setfileinfo(instance, &parm[0]);
+ parm[0].generic.in.file.fnum = gen_fnum(instance);
GEN_COPY_PARM;
GEN_SET_FNUM_SMB2(generic.in.file.handle);
@@ -2907,12 +2928,11 @@ static int run_test(struct event_context *ev, struct loadparm_context *lp_ctx)
current_op.opnum = op;
current_op.name = gen_ops[which_op].name;
current_op.status = NT_STATUS_OK;
+ talloc_free(current_op.mem_ctx);
current_op.mem_ctx = talloc_named(NULL, 0, "%s", current_op.name);
ret = gen_ops[which_op].handler(instance);
- talloc_free(current_op.mem_ctx);
-
gen_ops[which_op].count++;
if (NT_STATUS_IS_OK(current_op.status)) {
gen_ops[which_op].success_count++;
diff --git a/source4/torture/ldap/cldap.c b/source4/torture/ldap/cldap.c
index 3730193c86..23b0554c4f 100644
--- a/source4/torture/ldap/cldap.c
+++ b/source4/torture/ldap/cldap.c
@@ -64,7 +64,7 @@ static bool test_cldap_netlogon(struct torture_context *tctx, const char *dest)
n1 = search.out.netlogon;
search.in.user = "Administrator";
- search.in.realm = n1.nt5_ex.dns_domain;
+ search.in.realm = n1.data.nt5_ex.dns_domain;
search.in.host = "__cldap_torture__";
printf("Scanning for netlogon levels\n");
@@ -93,8 +93,8 @@ static bool test_cldap_netlogon(struct torture_context *tctx, const char *dest)
search.in.user = NULL;
status = cldap_netlogon(cldap, tctx, &search);
CHECK_STATUS(status, NT_STATUS_OK);
- CHECK_STRING(search.out.netlogon.nt5_ex.user_name, "");
- CHECK_VAL(search.out.netlogon.nt5_ex.command, LOGON_SAM_LOGON_RESPONSE_EX);
+ CHECK_STRING(search.out.netlogon.data.nt5_ex.user_name, "");
+ CHECK_VAL(search.out.netlogon.data.nt5_ex.command, LOGON_SAM_LOGON_RESPONSE_EX);
printf("Trying with User=Administrator\n");
@@ -102,8 +102,8 @@ static bool test_cldap_netlogon(struct torture_context *tctx, const char *dest)
status = cldap_netlogon(cldap, tctx, &search);
CHECK_STATUS(status, NT_STATUS_OK);
- CHECK_STRING(search.out.netlogon.nt5_ex.user_name, search.in.user);
- CHECK_VAL(search.out.netlogon.nt5_ex.command, LOGON_SAM_LOGON_USER_UNKNOWN_EX);
+ CHECK_STRING(search.out.netlogon.data.nt5_ex.user_name, search.in.user);
+ CHECK_VAL(search.out.netlogon.data.nt5_ex.command, LOGON_SAM_LOGON_USER_UNKNOWN_EX);
search.in.version = NETLOGON_NT_VERSION_5;
status = cldap_netlogon(cldap, tctx, &search);
@@ -114,8 +114,8 @@ static bool test_cldap_netlogon(struct torture_context *tctx, const char *dest)
search.in.user = NULL;
status = cldap_netlogon(cldap, tctx, &search);
CHECK_STATUS(status, NT_STATUS_OK);
- CHECK_STRING(search.out.netlogon.nt5_ex.user_name, "");
- CHECK_VAL(search.out.netlogon.nt5_ex.command, LOGON_SAM_LOGON_RESPONSE);
+ CHECK_STRING(search.out.netlogon.data.nt5_ex.user_name, "");
+ CHECK_VAL(search.out.netlogon.data.nt5_ex.command, LOGON_SAM_LOGON_RESPONSE);
printf("Trying with User=Administrator\n");
@@ -123,18 +123,18 @@ static bool test_cldap_netlogon(struct torture_context *tctx, const char *dest)
status = cldap_netlogon(cldap, tctx, &search);
CHECK_STATUS(status, NT_STATUS_OK);
- CHECK_STRING(search.out.netlogon.nt5_ex.user_name, search.in.user);
- CHECK_VAL(search.out.netlogon.nt5_ex.command, LOGON_SAM_LOGON_USER_UNKNOWN);
+ CHECK_STRING(search.out.netlogon.data.nt5_ex.user_name, search.in.user);
+ CHECK_VAL(search.out.netlogon.data.nt5_ex.command, LOGON_SAM_LOGON_USER_UNKNOWN);
search.in.version = NETLOGON_NT_VERSION_5 | NETLOGON_NT_VERSION_5EX;
printf("Trying with a GUID\n");
search.in.realm = NULL;
- search.in.domain_guid = GUID_string(tctx, &n1.nt5_ex.domain_uuid);
+ search.in.domain_guid = GUID_string(tctx, &n1.data.nt5_ex.domain_uuid);
status = cldap_netlogon(cldap, tctx, &search);
CHECK_STATUS(status, NT_STATUS_OK);
- CHECK_VAL(search.out.netlogon.nt5_ex.command, LOGON_SAM_LOGON_USER_UNKNOWN_EX);
- CHECK_STRING(GUID_string(tctx, &search.out.netlogon.nt5_ex.domain_uuid), search.in.domain_guid);
+ CHECK_VAL(search.out.netlogon.data.nt5_ex.command, LOGON_SAM_LOGON_USER_UNKNOWN_EX);
+ CHECK_STRING(GUID_string(tctx, &search.out.netlogon.data.nt5_ex.domain_uuid), search.in.domain_guid);
printf("Trying with a incorrect GUID\n");
guid = GUID_random();
@@ -145,53 +145,53 @@ static bool test_cldap_netlogon(struct torture_context *tctx, const char *dest)
printf("Trying with a AAC\n");
search.in.acct_control = ACB_WSTRUST|ACB_SVRTRUST;
- search.in.realm = n1.nt5_ex.dns_domain;
+ search.in.realm = n1.data.nt5_ex.dns_domain;
status = cldap_netlogon(cldap, tctx, &search);
CHECK_STATUS(status, NT_STATUS_OK);
- CHECK_VAL(search.out.netlogon.nt5_ex.command, LOGON_SAM_LOGON_RESPONSE_EX);
- CHECK_STRING(search.out.netlogon.nt5_ex.user_name, "");
+ CHECK_VAL(search.out.netlogon.data.nt5_ex.command, LOGON_SAM_LOGON_RESPONSE_EX);
+ CHECK_STRING(search.out.netlogon.data.nt5_ex.user_name, "");
printf("Trying with a zero AAC\n");
search.in.acct_control = 0x0;
- search.in.realm = n1.nt5_ex.dns_domain;
+ search.in.realm = n1.data.nt5_ex.dns_domain;
status = cldap_netlogon(cldap, tctx, &search);
CHECK_STATUS(status, NT_STATUS_OK);
- CHECK_VAL(search.out.netlogon.nt5_ex.command, LOGON_SAM_LOGON_RESPONSE_EX);
- CHECK_STRING(search.out.netlogon.nt5_ex.user_name, "");
+ CHECK_VAL(search.out.netlogon.data.nt5_ex.command, LOGON_SAM_LOGON_RESPONSE_EX);
+ CHECK_STRING(search.out.netlogon.data.nt5_ex.user_name, "");
printf("Trying with a zero AAC and user=Administrator\n");
search.in.acct_control = 0x0;
search.in.user = "Administrator";
- search.in.realm = n1.nt5_ex.dns_domain;
+ search.in.realm = n1.data.nt5_ex.dns_domain;
status = cldap_netlogon(cldap, tctx, &search);
CHECK_STATUS(status, NT_STATUS_OK);
- CHECK_VAL(search.out.netlogon.nt5_ex.command, LOGON_SAM_LOGON_USER_UNKNOWN_EX);
- CHECK_STRING(search.out.netlogon.nt5_ex.user_name, "Administrator");
+ CHECK_VAL(search.out.netlogon.data.nt5_ex.command, LOGON_SAM_LOGON_USER_UNKNOWN_EX);
+ CHECK_STRING(search.out.netlogon.data.nt5_ex.user_name, "Administrator");
printf("Trying with a bad AAC\n");
search.in.user = NULL;
search.in.acct_control = 0xFF00FF00;
- search.in.realm = n1.nt5_ex.dns_domain;
+ search.in.realm = n1.data.nt5_ex.dns_domain;
status = cldap_netlogon(cldap, tctx, &search);
CHECK_STATUS(status, NT_STATUS_OK);
- CHECK_VAL(search.out.netlogon.nt5_ex.command, LOGON_SAM_LOGON_RESPONSE_EX);
- CHECK_STRING(search.out.netlogon.nt5_ex.user_name, "");
+ CHECK_VAL(search.out.netlogon.data.nt5_ex.command, LOGON_SAM_LOGON_RESPONSE_EX);
+ CHECK_STRING(search.out.netlogon.data.nt5_ex.user_name, "");
printf("Trying with a user only\n");
search = empty_search;
search.in.user = "Administrator";
status = cldap_netlogon(cldap, tctx, &search);
CHECK_STATUS(status, NT_STATUS_OK);
- CHECK_STRING(search.out.netlogon.nt5_ex.dns_domain, n1.nt5_ex.dns_domain);
- CHECK_STRING(search.out.netlogon.nt5_ex.user_name, search.in.user);
+ CHECK_STRING(search.out.netlogon.data.nt5_ex.dns_domain, n1.data.nt5_ex.dns_domain);
+ CHECK_STRING(search.out.netlogon.data.nt5_ex.user_name, search.in.user);
printf("Trying with just a bad username\n");
search.in.user = "___no_such_user___";
status = cldap_netlogon(cldap, tctx, &search);
CHECK_STATUS(status, NT_STATUS_OK);
- CHECK_STRING(search.out.netlogon.nt5_ex.user_name, search.in.user);
- CHECK_STRING(search.out.netlogon.nt5_ex.dns_domain, n1.nt5_ex.dns_domain);
- CHECK_VAL(search.out.netlogon.nt5_ex.command, LOGON_SAM_LOGON_USER_UNKNOWN_EX);
+ CHECK_STRING(search.out.netlogon.data.nt5_ex.user_name, search.in.user);
+ CHECK_STRING(search.out.netlogon.data.nt5_ex.dns_domain, n1.data.nt5_ex.dns_domain);
+ CHECK_VAL(search.out.netlogon.data.nt5_ex.command, LOGON_SAM_LOGON_USER_UNKNOWN_EX);
printf("Trying with just a bad domain\n");
search = empty_search;
@@ -200,29 +200,29 @@ static bool test_cldap_netlogon(struct torture_context *tctx, const char *dest)
CHECK_STATUS(status, NT_STATUS_NOT_FOUND);
printf("Trying with a incorrect domain and correct guid\n");
- search.in.domain_guid = GUID_string(tctx, &n1.nt5_ex.domain_uuid);
+ search.in.domain_guid = GUID_string(tctx, &n1.data.nt5_ex.domain_uuid);
status = cldap_netlogon(cldap, tctx, &search);
CHECK_STATUS(status, NT_STATUS_OK);
- CHECK_STRING(search.out.netlogon.nt5_ex.dns_domain, n1.nt5_ex.dns_domain);
- CHECK_STRING(search.out.netlogon.nt5_ex.user_name, "");
- CHECK_VAL(search.out.netlogon.nt5_ex.command, LOGON_SAM_LOGON_RESPONSE_EX);
+ CHECK_STRING(search.out.netlogon.data.nt5_ex.dns_domain, n1.data.nt5_ex.dns_domain);
+ CHECK_STRING(search.out.netlogon.data.nt5_ex.user_name, "");
+ CHECK_VAL(search.out.netlogon.data.nt5_ex.command, LOGON_SAM_LOGON_RESPONSE_EX);
printf("Trying with a incorrect domain and incorrect guid\n");
search.in.domain_guid = GUID_string(tctx, &guid);
status = cldap_netlogon(cldap, tctx, &search);
CHECK_STATUS(status, NT_STATUS_NOT_FOUND);
- CHECK_STRING(search.out.netlogon.nt5_ex.dns_domain, n1.nt5_ex.dns_domain);
- CHECK_STRING(search.out.netlogon.nt5_ex.user_name, "");
- CHECK_VAL(search.out.netlogon.nt5_ex.command, LOGON_SAM_LOGON_RESPONSE_EX);
+ CHECK_STRING(search.out.netlogon.data.nt5_ex.dns_domain, n1.data.nt5_ex.dns_domain);
+ CHECK_STRING(search.out.netlogon.data.nt5_ex.user_name, "");
+ CHECK_VAL(search.out.netlogon.data.nt5_ex.command, LOGON_SAM_LOGON_RESPONSE_EX);
printf("Trying with a incorrect GUID and correct domain\n");
search.in.domain_guid = GUID_string(tctx, &guid);
- search.in.realm = n1.nt5_ex.dns_domain;
+ search.in.realm = n1.data.nt5_ex.dns_domain;
status = cldap_netlogon(cldap, tctx, &search);
CHECK_STATUS(status, NT_STATUS_OK);
- CHECK_STRING(search.out.netlogon.nt5_ex.dns_domain, n1.nt5_ex.dns_domain);
- CHECK_STRING(search.out.netlogon.nt5_ex.user_name, "");
- CHECK_VAL(search.out.netlogon.nt5_ex.command, LOGON_SAM_LOGON_RESPONSE_EX);
+ CHECK_STRING(search.out.netlogon.data.nt5_ex.dns_domain, n1.data.nt5_ex.dns_domain);
+ CHECK_STRING(search.out.netlogon.data.nt5_ex.user_name, "");
+ CHECK_VAL(search.out.netlogon.data.nt5_ex.command, LOGON_SAM_LOGON_RESPONSE_EX);
return true;
}
@@ -255,9 +255,9 @@ static bool test_cldap_netlogon_flags(struct torture_context *tctx,
n1 = search.out.netlogon;
if (n1.ntver == NETLOGON_NT_VERSION_5)
- server_type = n1.nt5.server_type;
+ server_type = n1.data.nt5.server_type;
else if (n1.ntver == NETLOGON_NT_VERSION_5EX)
- server_type = n1.nt5_ex.server_type;
+ server_type = n1.data.nt5_ex.server_type;
printf("The word is: %i\n", server_type);
if (server_type & NBT_SERVER_PDC)
@@ -366,9 +366,9 @@ static bool test_cldap_netlogon_flag_ds_dns_forest(struct torture_context *tctx,
n1 = search.out.netlogon;
if (n1.ntver == NETLOGON_NT_VERSION_5)
- server_type = n1.nt5.server_type;
+ server_type = n1.data.nt5.server_type;
else if (n1.ntver == NETLOGON_NT_VERSION_5EX)
- server_type = n1.nt5_ex.server_type;
+ server_type = n1.data.nt5_ex.server_type;
if (server_type & NBT_SERVER_DS_DNS_FOREST) {
struct cldap_search search2;
diff --git a/source4/torture/ldap/schema.c b/source4/torture/ldap/schema.c
index 8437e7f79d..fdb4251c15 100644
--- a/source4/torture/ldap/schema.c
+++ b/source4/torture/ldap/schema.c
@@ -41,6 +41,8 @@ struct test_rootDSE {
};
struct test_schema_ctx {
+ struct ldb_context *ldb;
+
struct ldb_paged_control *ctrl;
uint32_t count;
bool pending;
@@ -57,8 +59,8 @@ static bool test_search_rootDSE(struct ldb_context *ldb, struct test_rootDSE *ro
d_printf("Testing RootDSE Search\n");
- ret = ldb_search(ldb, ldb_dn_new(ldb, ldb, NULL), LDB_SCOPE_BASE,
- NULL, NULL, &r);
+ ret = ldb_search(ldb, ldb, &r, ldb_dn_new(ldb, ldb, NULL),
+ LDB_SCOPE_BASE, NULL, NULL);
if (ret != LDB_SUCCESS) {
return false;
} else if (r->count != 1) {
@@ -82,15 +84,24 @@ static bool test_search_rootDSE(struct ldb_context *ldb, struct test_rootDSE *ro
return true;
}
-static int test_schema_search_callback(struct ldb_context *ldb, void *context, struct ldb_reply *ares)
+static int test_schema_search_callback(struct ldb_request *req, struct ldb_reply *ares)
{
- struct test_schema_ctx *actx = talloc_get_type(context, struct test_schema_ctx);
+ struct test_schema_ctx *actx;
int ret = LDB_SUCCESS;
+ actx = talloc_get_type(req->context, struct test_schema_ctx);
+
+ if (!ares) {
+ return ldb_request_done(req, LDB_ERR_OPERATIONS_ERROR);
+ }
+ if (ares->error != LDB_SUCCESS) {
+ return ldb_request_done(req, ares->error);
+ }
+
switch (ares->type) {
case LDB_REPLY_ENTRY:
actx->count++;
- ret = actx->callback(actx->private_data, ldb, ares->message);
+ ret = actx->callback(actx->private_data, actx->ldb, ares->message);
break;
case LDB_REPLY_REFERRAL:
@@ -118,21 +129,22 @@ static int test_schema_search_callback(struct ldb_context *ldb, void *context, s
actx->pending = true;
}
}
- break;
-
+ talloc_free(ares);
+ return ldb_request_done(req, LDB_SUCCESS);
+
default:
d_printf("%s: unknown Reply Type %u\n", __location__, ares->type);
- return LDB_ERR_OTHER;
+ return ldb_request_done(req, LDB_ERR_OTHER);
}
if (talloc_free(ares) == -1) {
d_printf("talloc_free failed\n");
actx->pending = 0;
- return LDB_ERR_OPERATIONS_ERROR;
+ return ldb_request_done(req, LDB_ERR_OPERATIONS_ERROR);
}
if (ret) {
- return LDB_ERR_OPERATIONS_ERROR;
+ return ldb_request_done(req, LDB_ERR_OPERATIONS_ERROR);
}
return LDB_SUCCESS;
@@ -149,10 +161,12 @@ static bool test_create_schema_type(struct ldb_context *ldb, struct test_rootDSE
int ret;
struct test_schema_ctx *actx;
- req = talloc(ldb, struct ldb_request);
- actx = talloc(req, struct test_schema_ctx);
+ actx = talloc(ldb, struct test_schema_ctx);
+ actx->ldb = ldb;
+ actx->private_data = private_data;
+ actx->callback= callback;
- ctrl = talloc_array(req, struct ldb_control *, 2);
+ ctrl = talloc_array(actx, struct ldb_control *, 2);
ctrl[0] = talloc(ctrl, struct ldb_control);
ctrl[0]->oid = LDB_CONTROL_PAGED_RESULTS_OID;
ctrl[0]->critical = true;
@@ -163,33 +177,30 @@ static bool test_create_schema_type(struct ldb_context *ldb, struct test_rootDSE
ctrl[0]->data = control;
ctrl[1] = NULL;
- req->operation = LDB_SEARCH;
- req->op.search.base = ldb_dn_new(req, ldb, root->schemadn);
- req->op.search.scope = LDB_SCOPE_SUBTREE;
- req->op.search.tree = ldb_parse_tree(req, filter);
- if (req->op.search.tree == NULL) return -1;
- req->op.search.attrs = NULL;
- req->controls = ctrl;
- req->context = actx;
- req->callback = test_schema_search_callback;
- ldb_set_timeout(ldb, req, 0);
-
- actx->count = 0;
- actx->ctrl = control;
- actx->callback = callback;
- actx->private_data = private_data;
+ ret = ldb_build_search_req(&req, ldb, actx,
+ ldb_dn_new(actx, ldb, root->schemadn),
+ LDB_SCOPE_SUBTREE,
+ filter, NULL,
+ ctrl,
+ actx, test_schema_search_callback,
+ NULL);
+
+ actx->ctrl = control;
+ actx->count = 0;
again:
actx->pending = false;
ret = ldb_request(ldb, req);
if (ret != LDB_SUCCESS) {
d_printf("search failed - %s\n", ldb_errstring(ldb));
+ talloc_free(actx);
return false;
}
ret = ldb_wait(req->handle, LDB_WAIT_ALL);
if (ret != LDB_SUCCESS) {
d_printf("search error - %s\n", ldb_errstring(ldb));
+ talloc_free(actx);
return false;
}
@@ -197,6 +208,7 @@ again:
goto again;
d_printf("filter[%s] count[%u]\n", filter, actx->count);
+ talloc_free(actx);
return true;
}
diff --git a/source4/torture/ldap/uptodatevector.c b/source4/torture/ldap/uptodatevector.c
index 87b7e09e13..3c491dca05 100644
--- a/source4/torture/ldap/uptodatevector.c
+++ b/source4/torture/ldap/uptodatevector.c
@@ -57,15 +57,14 @@ static bool test_check_uptodatevector(struct torture_context *torture,
torture_comment(torture, "Check replUpToDateVector on partition[%s]\n",
ldb_dn_get_linearized(partition_dn));
- ret = ldb_search(ldb, partition_dn, LDB_SCOPE_BASE,
- "(objectClass=*)", attrs, &r);
+ ret = ldb_search(ldb, torture, &r, partition_dn, LDB_SCOPE_BASE, attrs,
+ "(objectClass=*)");
if (ret != LDB_SUCCESS) {
return false;
} else if (r->count != 1) {
talloc_free(r);
return false;
}
- talloc_steal(torture, r);
ZERO_STRUCT(utdv1);
utdv_val1 = ldb_msg_find_ldb_val(r->msgs[0], "replUpToDateVector");
@@ -104,15 +103,14 @@ static bool test_check_uptodatevector(struct torture_context *torture,
ret = ldb_modify(ldb, msg);
if (ret != LDB_SUCCESS) return false;
- ret = ldb_search(ldb, partition_dn, LDB_SCOPE_BASE,
- "(objectClass=*)", attrs, &r);
+ ret = ldb_search(ldb, msg, &r, partition_dn, LDB_SCOPE_BASE,
+ attrs, "(objectClass=*)");
if (ret != LDB_SUCCESS) {
return false;
} else if (r->count != 1) {
talloc_free(r);
return false;
}
- talloc_steal(msg, r);
ZERO_STRUCT(utdv);
utdv_val = ldb_msg_find_ldb_val(r->msgs[0], "replUpToDateVector");
diff --git a/source4/torture/local/dbspeed.c b/source4/torture/local/dbspeed.c
index 3d449a5991..9547e9ff74 100644
--- a/source4/torture/local/dbspeed.c
+++ b/source4/torture/local/dbspeed.c
@@ -211,21 +211,18 @@ static bool test_ldb_speed(struct torture_context *torture, const void *_data)
for (count=0;timeval_elapsed(&tv) < timelimit;count++) {
struct ldb_dn *dn;
struct ldb_result *res;
- char *expr;
i = random() % torture_entries;
dn = ldb_dn_new_fmt(tmp_ctx, ldb, "SID=S-1-5-21-53173311-3623041448-2049097239-%u", i);
- if (ldb_search(ldb, dn, LDB_SCOPE_BASE, NULL, NULL, &res) != LDB_SUCCESS || res->count != 1) {
+ if (ldb_search(ldb, tmp_ctx, &res, dn, LDB_SCOPE_BASE, NULL, NULL) != LDB_SUCCESS || res->count != 1) {
torture_fail(torture, talloc_asprintf(torture, "Failed to find SID %d", i));
}
talloc_free(res);
talloc_free(dn);
- expr = talloc_asprintf(tmp_ctx, "(UID=%u)", i);
- if (ldb_search(ldb, NULL, LDB_SCOPE_SUBTREE, expr, NULL, &res) != LDB_SUCCESS || res->count != 1) {
+ if (ldb_search(ldb, tmp_ctx, &res, NULL, LDB_SCOPE_SUBTREE, NULL, "(UID=%u)", i) != LDB_SUCCESS || res->count != 1) {
torture_fail(torture, talloc_asprintf(torture, "Failed to find UID %d", i));
}
talloc_free(res);
- talloc_free(expr);
}
if (talloc_total_blocks(torture) > 100) {
diff --git a/source4/torture/local/local.c b/source4/torture/local/local.c
index bf53df4a11..fdefbbe131 100644
--- a/source4/torture/local/local.c
+++ b/source4/torture/local/local.c
@@ -23,7 +23,7 @@
#include "torture/ndr/ndr.h"
#include "torture/ndr/proto.h"
#include "torture/auth/proto.h"
-#include "lib/crypto/test_proto.h"
+#include "../lib/crypto/test_proto.h"
#include "lib/registry/tests/proto.h"
/* ignore me */ static struct torture_suite *
diff --git a/source4/torture/locktest.c b/source4/torture/locktest.c
index 9c7bffb6f4..a511e261cb 100644
--- a/source4/torture/locktest.c
+++ b/source4/torture/locktest.c
@@ -117,8 +117,10 @@ static struct smbcli_state *connect_one(struct event_context *ev,
NTSTATUS status;
int retries = 10;
struct smbcli_options options;
+ struct smbcli_session_options session_options;
lp_smbcli_options(lp_ctx, &options);
+ lp_smbcli_session_options(lp_ctx, &session_options);
printf("connect_one(%s, %d, %d)\n", share, snum, conn);
@@ -164,7 +166,7 @@ static struct smbcli_state *connect_one(struct event_context *ev,
share, NULL,
servers[snum],
lp_resolve_context(lp_ctx),
- ev, &options);
+ ev, &options, &session_options);
if (!NT_STATUS_IS_OK(status)) {
sleep(2);
}
diff --git a/source4/torture/locktest2.c b/source4/torture/locktest2.c
index e6c4728f0d..b49b8d256a 100644
--- a/source4/torture/locktest2.c
+++ b/source4/torture/locktest2.c
@@ -138,7 +138,8 @@ static bool try_unlock(struct smbcli_state *c, int fstype,
return a connection to a server
*******************************************************/
static struct smbcli_state *connect_one(char *share, const char **ports,
- struct smb_options *optionsi,
+ struct smb_options *options,
+ struct smb_options *session_options,
struct event_context *ev)
{
struct smbcli_state *c;
@@ -168,7 +169,7 @@ static struct smbcli_state *connect_one(char *share, const char **ports,
nt_status = smbcli_full_connection(NULL,
&c, myname, server_n, ports, share, NULL,
username, lp_workgroup(), password, ev,
- options);
+ options, session_options);
if (!NT_STATUS_IS_OK(nt_status)) {
DEBUG(0, ("smbcli_full_connection failed with error %s\n", nt_errstr(nt_status)));
return NULL;
@@ -185,6 +186,7 @@ static void reconnect(struct smbcli_state *cli[NSERVERS][NCONNECTIONS],
int fnum[NSERVERS][NUMFSTYPES][NCONNECTIONS][NFILES],
const char **ports,
struct smbcli_options *options,
+ struct smbcli_session_options *session_options,
struct event_context *ev,
char *share1, char *share2)
{
@@ -204,7 +206,7 @@ static void reconnect(struct smbcli_state *cli[NSERVERS][NCONNECTIONS],
smbcli_ulogoff(cli[server][conn]);
talloc_free(cli[server][conn]);
}
- cli[server][conn] = connect_one(share[server], ports, options, ev);
+ cli[server][conn] = connect_one(share[server], ports, options, session_options, ev);
if (!cli[server][conn]) {
DEBUG(0,("Failed to connect to %s\n", share[server]));
exit(1);
@@ -354,6 +356,7 @@ static void test_locks(char *share1, char *share2,
char *nfspath1, char *nfspath2,
const char **ports,
struct smbcli_options *options,
+ struct smbcli_session_options *session_options,
struct event_context *ev)
{
struct smbcli_state *cli[NSERVERS][NCONNECTIONS];
@@ -383,7 +386,7 @@ static void test_locks(char *share1, char *share2,
recorded[n].needed = true;
}
- reconnect(cli, nfs, fnum, ports, options, ev, share1, share2);
+ reconnect(cli, nfs, fnum, ports, options, session_options, ev, share1, share2);
open_files(cli, nfs, fnum);
n = retest(cli, nfs, fnum, numops);
@@ -394,7 +397,7 @@ static void test_locks(char *share1, char *share2,
n1 = n;
close_files(cli, nfs, fnum);
- reconnect(cli, nfs, fnum, ports, options, ev, share1, share2);
+ reconnect(cli, nfs, fnum, ports, options, session_options, ev, share1, share2);
open_files(cli, nfs, fnum);
for (i=0;i<n-1;i++) {
@@ -421,7 +424,7 @@ static void test_locks(char *share1, char *share2,
}
close_files(cli, nfs, fnum);
- reconnect(cli, nfs, fnum, ports, options, ev, share1, share2);
+ reconnect(cli, nfs, fnum, ports, options, session_options, ev, share1, share2);
open_files(cli, nfs, fnum);
showall = true;
n1 = retest(cli, nfs, fnum, n);
@@ -469,6 +472,7 @@ static void usage(void)
extern char *optarg;
extern int optind;
struct smbcli_options options;
+ struct smbcli_session_options session_options;
int opt;
char *p;
int seed;
@@ -554,8 +558,9 @@ static void usage(void)
locking_init(1);
lp_smbcli_options(lp_ctx, &options);
+ lp_smbcli_session_options(lp_ctx, &session_options);
test_locks(share1, share2, nfspath1, nfspath2, lp_smb_ports(lp_ctx),
- &options, ev);
+ &options, &session_options, ev);
return(0);
}
diff --git a/source4/torture/masktest.c b/source4/torture/masktest.c
index 35e9a57fe8..a739a1e1b5 100644
--- a/source4/torture/masktest.c
+++ b/source4/torture/masktest.c
@@ -76,7 +76,8 @@ return a connection to a server
static struct smbcli_state *connect_one(struct resolve_context *resolve_ctx,
struct event_context *ev,
char *share, const char **ports,
- struct smbcli_options *options)
+ struct smbcli_options *options,
+ struct smbcli_session_options *session_options)
{
struct smbcli_state *c;
fstring server;
@@ -95,7 +96,7 @@ static struct smbcli_state *connect_one(struct resolve_context *resolve_ctx,
ports,
share, NULL,
cmdline_credentials, resolve_ctx, ev,
- options);
+ options, session_options);
if (!NT_STATUS_IS_OK(status)) {
return NULL;
@@ -296,6 +297,7 @@ static void usage(poptContext pc)
struct event_context *ev;
struct loadparm_context *lp_ctx;
struct smbcli_options options;
+ struct smbcli_session_options session_options;
poptContext pc;
int argc_new, i;
char **argv_new;
@@ -360,9 +362,10 @@ static void usage(poptContext pc)
gensec_init(lp_ctx);
lp_smbcli_options(lp_ctx, &options);
+ lp_smbcli_session_options(lp_ctx, &session_options);
cli = connect_one(lp_resolve_context(lp_ctx), ev, share,
- lp_smb_ports(lp_ctx), &options);
+ lp_smb_ports(lp_ctx), &options, &session_options);
if (!cli) {
DEBUG(0,("Failed to connect to %s\n", share));
exit(1);
diff --git a/source4/torture/nbt/dgram.c b/source4/torture/nbt/dgram.c
index eac2b1fe30..5d26d65e0c 100644
--- a/source4/torture/nbt/dgram.c
+++ b/source4/torture/nbt/dgram.c
@@ -148,7 +148,7 @@ static bool nbt_test_netlogon(struct torture_context *tctx)
torture_assert(tctx, response != NULL, "Failed to receive a netlogon reply packet");
torture_assert(tctx, response->response_type == NETLOGON_GET_PDC, "Got incorrect type of netlogon response");
- torture_assert(tctx, response->get_pdc.command == NETLOGON_RESPONSE_FROM_PDC, "Got incorrect netlogon response command");
+ torture_assert(tctx, response->data.get_pdc.command == NETLOGON_RESPONSE_FROM_PDC, "Got incorrect netlogon response command");
return true;
}
@@ -243,10 +243,10 @@ static bool nbt_test_netlogon2(struct torture_context *tctx)
torture_assert(tctx, response != NULL, "Failed to receive a netlogon reply packet");
torture_assert_int_equal(tctx, response->response_type, NETLOGON_SAMLOGON, "Got incorrect type of netlogon response");
- map_netlogon_samlogon_response(&response->samlogon);
+ map_netlogon_samlogon_response(&response->data.samlogon);
- torture_assert_int_equal(tctx, response->samlogon.nt5_ex.command, LOGON_SAM_LOGON_RESPONSE_EX, "Got incorrect netlogon response command");
- torture_assert_int_equal(tctx, response->samlogon.nt5_ex.nt_version, NETLOGON_NT_VERSION_5EX_WITH_IP|NETLOGON_NT_VERSION_5EX|NETLOGON_NT_VERSION_1, "Got incorrect netlogon response command");
+ torture_assert_int_equal(tctx, response->data.samlogon.data.nt5_ex.command, LOGON_SAM_LOGON_RESPONSE_EX, "Got incorrect netlogon response command");
+ torture_assert_int_equal(tctx, response->data.samlogon.data.nt5_ex.nt_version, NETLOGON_NT_VERSION_5EX_WITH_IP|NETLOGON_NT_VERSION_5EX|NETLOGON_NT_VERSION_1, "Got incorrect netlogon response command");
/* setup (another) temporary mailslot listener for replies */
dgmslot = dgram_mailslot_temp(dgmsock, NBT_MAILSLOT_GETDC,
@@ -282,11 +282,11 @@ static bool nbt_test_netlogon2(struct torture_context *tctx)
torture_assert(tctx, response != NULL, "Failed to receive a netlogon reply packet");
torture_assert_int_equal(tctx, response->response_type, NETLOGON_SAMLOGON, "Got incorrect type of netlogon response");
- map_netlogon_samlogon_response(&response->samlogon);
+ map_netlogon_samlogon_response(&response->data.samlogon);
- torture_assert_int_equal(tctx, response->samlogon.nt5_ex.command, LOGON_SAM_LOGON_USER_UNKNOWN, "Got incorrect netlogon response command");
+ torture_assert_int_equal(tctx, response->data.samlogon.data.nt5_ex.command, LOGON_SAM_LOGON_USER_UNKNOWN, "Got incorrect netlogon response command");
- torture_assert_str_equal(tctx, response->samlogon.nt5_ex.user_name, TEST_NAME"$", "Got incorrect user in netlogon response");
+ torture_assert_str_equal(tctx, response->data.samlogon.data.nt5_ex.user_name, TEST_NAME"$", "Got incorrect user in netlogon response");
join_ctx = torture_join_domain(tctx, TEST_NAME,
ACB_WSTRUST, &machine_credentials);
@@ -333,9 +333,9 @@ static bool nbt_test_netlogon2(struct torture_context *tctx)
torture_assert(tctx, response != NULL, "Failed to receive a netlogon reply packet");
torture_assert_int_equal(tctx, response->response_type, NETLOGON_SAMLOGON, "Got incorrect type of netlogon response");
- map_netlogon_samlogon_response(&response->samlogon);
+ map_netlogon_samlogon_response(&response->data.samlogon);
- torture_assert_int_equal(tctx, response->samlogon.nt5_ex.command, LOGON_SAM_LOGON_USER_UNKNOWN, "Got incorrect netlogon response command");
+ torture_assert_int_equal(tctx, response->data.samlogon.data.nt5_ex.command, LOGON_SAM_LOGON_USER_UNKNOWN, "Got incorrect netlogon response command");
/* setup (another) temporary mailslot listener for replies */
dgmslot = dgram_mailslot_temp(dgmsock, NBT_MAILSLOT_GETDC,
@@ -374,9 +374,9 @@ static bool nbt_test_netlogon2(struct torture_context *tctx)
torture_assert(tctx, response != NULL, "Failed to receive a netlogon reply packet");
torture_assert_int_equal(tctx, response->response_type, NETLOGON_SAMLOGON, "Got incorrect type of netlogon response");
- map_netlogon_samlogon_response(&response->samlogon);
+ map_netlogon_samlogon_response(&response->data.samlogon);
- torture_assert_int_equal(tctx, response->samlogon.nt5_ex.command, LOGON_SAM_LOGON_RESPONSE, "Got incorrect netlogon response command");
+ torture_assert_int_equal(tctx, response->data.samlogon.data.nt5_ex.command, LOGON_SAM_LOGON_RESPONSE, "Got incorrect netlogon response command");
dgmslot->private = NULL;
@@ -413,9 +413,9 @@ static bool nbt_test_netlogon2(struct torture_context *tctx)
torture_assert(tctx, response != NULL, "Failed to receive a netlogon reply packet");
torture_assert_int_equal(tctx, response->response_type, NETLOGON_SAMLOGON, "Got incorrect type of netlogon response");
- map_netlogon_samlogon_response(&response->samlogon);
+ map_netlogon_samlogon_response(&response->data.samlogon);
- torture_assert_int_equal(tctx, response->samlogon.nt5_ex.command, LOGON_SAM_LOGON_USER_UNKNOWN, "Got incorrect netlogon response command");
+ torture_assert_int_equal(tctx, response->data.samlogon.data.nt5_ex.command, LOGON_SAM_LOGON_USER_UNKNOWN, "Got incorrect netlogon response command");
torture_leave_domain(tctx, join_ctx);
return true;
@@ -522,11 +522,11 @@ static bool nbt_test_ntlogon(struct torture_context *tctx)
torture_assert(tctx, response != NULL, "Failed to receive a netlogon reply packet");
torture_assert_int_equal(tctx, response->response_type, NETLOGON_SAMLOGON, "Got incorrect type of netlogon response");
- map_netlogon_samlogon_response(&response->samlogon);
+ map_netlogon_samlogon_response(&response->data.samlogon);
- torture_assert_int_equal(tctx, response->samlogon.nt5_ex.command, LOGON_SAM_LOGON_RESPONSE, "Got incorrect netlogon response command");
+ torture_assert_int_equal(tctx, response->data.samlogon.data.nt5_ex.command, LOGON_SAM_LOGON_RESPONSE, "Got incorrect netlogon response command");
- torture_assert_str_equal(tctx, response->samlogon.nt5_ex.user_name, TEST_NAME"$", "Got incorrect user in netlogon response");
+ torture_assert_str_equal(tctx, response->data.samlogon.data.nt5_ex.user_name, TEST_NAME"$", "Got incorrect user in netlogon response");
/* setup a temporary mailslot listener for replies */
@@ -566,11 +566,11 @@ static bool nbt_test_ntlogon(struct torture_context *tctx)
torture_assert(tctx, response != NULL, "Failed to receive a netlogon reply packet");
torture_assert_int_equal(tctx, response->response_type, NETLOGON_SAMLOGON, "Got incorrect type of netlogon response");
- map_netlogon_samlogon_response(&response->samlogon);
+ map_netlogon_samlogon_response(&response->data.samlogon);
- torture_assert_int_equal(tctx, response->samlogon.nt5_ex.command, LOGON_SAM_LOGON_RESPONSE, "Got incorrect netlogon response command");
+ torture_assert_int_equal(tctx, response->data.samlogon.data.nt5_ex.command, LOGON_SAM_LOGON_RESPONSE, "Got incorrect netlogon response command");
- torture_assert_str_equal(tctx, response->samlogon.nt5_ex.user_name, TEST_NAME"$", "Got incorrect user in netlogon response");
+ torture_assert_str_equal(tctx, response->data.samlogon.data.nt5_ex.user_name, TEST_NAME"$", "Got incorrect user in netlogon response");
/* setup (another) temporary mailslot listener for replies */
@@ -606,7 +606,7 @@ static bool nbt_test_ntlogon(struct torture_context *tctx)
torture_assert(tctx, response != NULL, "Failed to receive a netlogon reply packet");
torture_assert_int_equal(tctx, response->response_type, NETLOGON_GET_PDC, "Got incorrect type of ntlogon response");
- torture_assert_int_equal(tctx, response->get_pdc.command, NETLOGON_RESPONSE_FROM_PDC, "Got incorrect ntlogon response command");
+ torture_assert_int_equal(tctx, response->data.get_pdc.command, NETLOGON_RESPONSE_FROM_PDC, "Got incorrect ntlogon response command");
torture_leave_domain(tctx, join_ctx);
@@ -643,7 +643,7 @@ static bool nbt_test_ntlogon(struct torture_context *tctx)
torture_assert(tctx, response != NULL, "Failed to receive a netlogon reply packet");
torture_assert_int_equal(tctx, response->response_type, NETLOGON_GET_PDC, "Got incorrect type of ntlogon response");
- torture_assert_int_equal(tctx, response->get_pdc.command, NETLOGON_RESPONSE_FROM_PDC, "Got incorrect ntlogon response command");
+ torture_assert_int_equal(tctx, response->data.get_pdc.command, NETLOGON_RESPONSE_FROM_PDC, "Got incorrect ntlogon response command");
return true;
diff --git a/source4/torture/nbt/nbt.c b/source4/torture/nbt/nbt.c
index 7d35fc856a..aee0c54358 100644
--- a/source4/torture/nbt/nbt.c
+++ b/source4/torture/nbt/nbt.c
@@ -18,7 +18,7 @@
*/
#include "includes.h"
-#include "libcli/nbt/libnbt.h"
+#include "../libcli/nbt/libnbt.h"
#include "torture/torture.h"
#include "torture/nbt/proto.h"
#include "torture/smbtorture.h"
diff --git a/source4/torture/nbt/query.c b/source4/torture/nbt/query.c
index 80027a1b68..b1b703a3c2 100644
--- a/source4/torture/nbt/query.c
+++ b/source4/torture/nbt/query.c
@@ -33,7 +33,7 @@ struct result_struct {
static void increment_handler(struct nbt_name_request *req)
{
- struct result_struct *v = talloc_get_type(req->async.private, struct result_struct);
+ struct result_struct *v = talloc_get_type(req->async.private_data, struct result_struct);
if (req->state != NBT_REQUEST_DONE) {
v->num_fail++;
} else {
@@ -76,7 +76,7 @@ static bool bench_namequery(struct torture_context *tctx)
req = nbt_name_query_send(nbtsock, &io);
torture_assert(tctx, req != NULL, "Failed to setup request!");
req->async.fn = increment_handler;
- req->async.private = result;
+ req->async.private_data = result;
num_sent++;
if (num_sent % 1000 == 0) {
if (torture_setting_bool(tctx, "progress", true)) {
diff --git a/source4/torture/nbt/winsbench.c b/source4/torture/nbt/winsbench.c
index a0d90fb653..bea3d4f9cf 100644
--- a/source4/torture/nbt/winsbench.c
+++ b/source4/torture/nbt/winsbench.c
@@ -56,7 +56,7 @@ static struct nbt_name generate_name(TALLOC_CTX *tctx, int idx)
static void register_handler(struct nbt_name_request *req)
{
- struct idx_state *istate = talloc_get_type(req->async.private, struct idx_state);
+ struct idx_state *istate = talloc_get_type(req->async.private_data, struct idx_state);
struct wins_state *state = istate->state;
struct nbt_name_register io;
NTSTATUS status;
@@ -100,7 +100,7 @@ static void generate_register(struct nbt_name_socket *nbtsock, struct wins_state
req = nbt_name_register_send(nbtsock, &io);
req->async.fn = register_handler;
- req->async.private = istate;
+ req->async.private_data = istate;
talloc_free(tmp_ctx);
}
@@ -108,7 +108,7 @@ static void generate_register(struct nbt_name_socket *nbtsock, struct wins_state
static void release_handler(struct nbt_name_request *req)
{
- struct idx_state *istate = talloc_get_type(req->async.private, struct idx_state);
+ struct idx_state *istate = talloc_get_type(req->async.private_data, struct idx_state);
struct wins_state *state = istate->state;
struct nbt_name_release io;
NTSTATUS status;
@@ -150,7 +150,7 @@ static void generate_release(struct nbt_name_socket *nbtsock, struct wins_state
req = nbt_name_release_send(nbtsock, &io);
req->async.fn = release_handler;
- req->async.private = istate;
+ req->async.private_data = istate;
talloc_free(tmp_ctx);
}
@@ -158,7 +158,7 @@ static void generate_release(struct nbt_name_socket *nbtsock, struct wins_state
static void query_handler(struct nbt_name_request *req)
{
- struct idx_state *istate = talloc_get_type(req->async.private, struct idx_state);
+ struct idx_state *istate = talloc_get_type(req->async.private_data, struct idx_state);
struct wins_state *state = istate->state;
struct nbt_name_query io;
NTSTATUS status;
@@ -197,7 +197,7 @@ static void generate_query(struct nbt_name_socket *nbtsock, struct wins_state *s
req = nbt_name_query_send(nbtsock, &io);
req->async.fn = query_handler;
- req->async.private = istate;
+ req->async.private_data = istate;
talloc_free(tmp_ctx);
}
diff --git a/source4/torture/nbt/winsreplication.c b/source4/torture/nbt/winsreplication.c
index 6b600bd7cd..b688f1fbfe 100644
--- a/source4/torture/nbt/winsreplication.c
+++ b/source4/torture/nbt/winsreplication.c
@@ -9457,7 +9457,7 @@ static void test_conflict_owned_active_vs_replica_handler_query(struct nbt_name_
struct nbt_name *name;
struct nbt_name_packet *rep_packet;
struct test_conflict_owned_active_vs_replica_struct *rec =
- (struct test_conflict_owned_active_vs_replica_struct *)nbtsock->incoming.private;
+ (struct test_conflict_owned_active_vs_replica_struct *)nbtsock->incoming.private_data;
_NBT_ASSERT(req_packet->qdcount, 1);
_NBT_ASSERT(req_packet->questions[0].question_type, NBT_QTYPE_NETBIOS);
@@ -9556,7 +9556,7 @@ static void test_conflict_owned_active_vs_replica_handler_release(
struct nbt_name *name;
struct nbt_name_packet *rep_packet;
struct test_conflict_owned_active_vs_replica_struct *rec =
- (struct test_conflict_owned_active_vs_replica_struct *)nbtsock->incoming.private;
+ (struct test_conflict_owned_active_vs_replica_struct *)nbtsock->incoming.private_data;
_NBT_ASSERT(req_packet->qdcount, 1);
_NBT_ASSERT(req_packet->questions[0].question_type, NBT_QTYPE_NETBIOS);
@@ -9610,7 +9610,7 @@ static void test_conflict_owned_active_vs_replica_handler(struct nbt_name_socket
struct socket_address *src)
{
struct test_conflict_owned_active_vs_replica_struct *rec =
- (struct test_conflict_owned_active_vs_replica_struct *)nbtsock->incoming.private;
+ (struct test_conflict_owned_active_vs_replica_struct *)nbtsock->incoming.private_data;
rec->defend.ret = false;
diff --git a/source4/torture/ndr/lsa.c b/source4/torture/ndr/lsa.c
index a72a03fa38..0d6d786882 100644
--- a/source4/torture/ndr/lsa.c
+++ b/source4/torture/ndr/lsa.c
@@ -1538,8 +1538,8 @@ static bool lsarlookupnames2_in_check(struct torture_context *tctx,
torture_assert_str_equal(tctx, r->in.names[1].string, "Administrators",
"names[1]");
torture_assert_int_equal(tctx, r->in.level, 1, "level");
- torture_assert_int_equal(tctx, r->in.unknown1, 0, "unknown 1");
- torture_assert_int_equal(tctx, r->in.unknown2, 0, "unknown 2");
+ torture_assert_int_equal(tctx, r->in.lookup_options, 0, "lookup_options");
+ torture_assert_int_equal(tctx, r->in.client_revision, 0, "client_revision");
torture_assert_int_equal(tctx, *r->in.count, 0, "count");
torture_assert_int_equal(tctx, r->in.sids->count, 0, "sids count");
torture_assert(tctx, r->in.sids->sids == NULL, "sids sids");
@@ -1637,8 +1637,8 @@ static bool lsarlookupnames3_in_check(struct torture_context *tctx,
torture_assert_str_equal(tctx, r->in.names[1].string, "Administrators",
"names[1]");
torture_assert_int_equal(tctx, r->in.level, 1, "level");
- torture_assert_int_equal(tctx, r->in.unknown1, 0, "unknown 1");
- torture_assert_int_equal(tctx, r->in.unknown2, 0, "unknown 2");
+ torture_assert_int_equal(tctx, r->in.lookup_options, 0, "lookup_options");
+ torture_assert_int_equal(tctx, r->in.client_revision, 0, "client_revision");
torture_assert_int_equal(tctx, *r->in.count, 0, "count");
torture_assert_int_equal(tctx, r->in.sids->count, 0, "sids count");
torture_assert(tctx, r->in.sids->sids == NULL, "sids sids");
diff --git a/source4/torture/raw/chkpath.c b/source4/torture/raw/chkpath.c
index 2ed83d308c..68ef8e226d 100644
--- a/source4/torture/raw/chkpath.c
+++ b/source4/torture/raw/chkpath.c
@@ -147,11 +147,11 @@ static bool test_chkpath(struct smbcli_state *cli, struct torture_context *tctx)
}
ret &= test_path_ex(cli, tctx, BASEDIR, BASEDIR, NT_STATUS_OK, NT_STATUS_OK);
- ret &= test_path_ex(cli, tctx, ((char *)BASEDIR) + 1, BASEDIR, NT_STATUS_OK, NT_STATUS_OK);
- ret &= test_path_ex(cli, tctx, ((char *)BASEDIR"\\\\") + 1, BASEDIR, NT_STATUS_OK, NT_STATUS_OK);
- ret &= test_path_ex(cli, tctx, ((char *)BASEDIR"\\foo\\..") + 1, BASEDIR, NT_STATUS_OK, NT_STATUS_OK);
- ret &= test_path_ex(cli, tctx, ((char *)BASEDIR"\\f\\o\\o\\..\\..\\..") + 1, BASEDIR, NT_STATUS_OK, NT_STATUS_OK);
- ret &= test_path_ex(cli, tctx, ((char *)BASEDIR"\\foo\\\\..\\\\") + 1, BASEDIR, NT_STATUS_OK, NT_STATUS_OK);
+ ret &= test_path_ex(cli, tctx, ((const char *)BASEDIR) + 1, BASEDIR, NT_STATUS_OK, NT_STATUS_OK);
+ ret &= test_path_ex(cli, tctx, ((const char *)BASEDIR"\\\\") + 1, BASEDIR, NT_STATUS_OK, NT_STATUS_OK);
+ ret &= test_path_ex(cli, tctx, ((const char *)BASEDIR"\\foo\\..") + 1, BASEDIR, NT_STATUS_OK, NT_STATUS_OK);
+ ret &= test_path_ex(cli, tctx, ((const char *)BASEDIR"\\f\\o\\o\\..\\..\\..") + 1, BASEDIR, NT_STATUS_OK, NT_STATUS_OK);
+ ret &= test_path_ex(cli, tctx, ((const char *)BASEDIR"\\foo\\\\..\\\\") + 1, BASEDIR, NT_STATUS_OK, NT_STATUS_OK);
ret &= test_path_ex(cli, tctx, BASEDIR"\\", BASEDIR, NT_STATUS_OK, NT_STATUS_OK);
ret &= test_path_ex(cli, tctx, BASEDIR"\\\\..\\"BASEDIR, BASEDIR, NT_STATUS_OK, NT_STATUS_OK);
ret &= test_path_ex(cli, tctx, BASEDIR"\\\\\\", BASEDIR, NT_STATUS_OK, NT_STATUS_OK);
diff --git a/source4/torture/raw/composite.c b/source4/torture/raw/composite.c
index d73ac1327e..7f1f5943e1 100644
--- a/source4/torture/raw/composite.c
+++ b/source4/torture/raw/composite.c
@@ -164,6 +164,7 @@ static bool test_fetchfile(struct smbcli_state *cli, struct torture_context *tct
io2.in.filename = fname;
io2.in.resolve_ctx = lp_resolve_context(tctx->lp_ctx);
lp_smbcli_options(tctx->lp_ctx, &io2.in.options);
+ lp_smbcli_session_options(tctx->lp_ctx, &io2.in.session_options);
printf("testing parallel fetchfile with %d ops\n", torture_numops);
@@ -358,7 +359,7 @@ static bool test_fsinfo(struct smbcli_state *cli, struct torture_context *tctx)
c = talloc_array(tctx, struct composite_context *, torture_numops);
for (i=0; i<torture_numops; i++) {
- c[i] = smb_composite_fsinfo_send(cli->tree,&io1);
+ c[i] = smb_composite_fsinfo_send(cli->tree, &io1, lp_resolve_context(tctx->lp_ctx));
c[i]->async.fn = loadfile_complete;
c[i]->async.private_data = count;
}
diff --git a/source4/torture/raw/context.c b/source4/torture/raw/context.c
index 15e736fff5..450ad0f260 100644
--- a/source4/torture/raw/context.c
+++ b/source4/torture/raw/context.c
@@ -81,6 +81,7 @@ static bool test_session(struct smbcli_state *cli, struct torture_context *tctx)
const char *fname = BASEDIR "\\test.txt";
uint8_t c = 1;
int i;
+ struct smbcli_session_options options;
printf("TESTING SESSION HANDLING\n");
@@ -89,7 +90,10 @@ static bool test_session(struct smbcli_state *cli, struct torture_context *tctx)
}
printf("create a second security context on the same transport\n");
- session = smbcli_session_init(cli->transport, tctx, false);
+
+ lp_smbcli_session_options(tctx->lp_ctx, &options);
+
+ session = smbcli_session_init(cli->transport, tctx, false, options);
setup.in.sesskey = cli->transport->negotiate.sesskey;
setup.in.capabilities = cli->transport->negotiate.capabilities; /* ignored in secondary session setup, except by our libs, which care about the extended security bit */
@@ -103,7 +107,7 @@ static bool test_session(struct smbcli_state *cli, struct torture_context *tctx)
session->vuid = setup.out.vuid;
printf("create a third security context on the same transport, with vuid set\n");
- session2 = smbcli_session_init(cli->transport, tctx, false);
+ session2 = smbcli_session_init(cli->transport, tctx, false, options);
session2->vuid = session->vuid;
setup.in.sesskey = cli->transport->negotiate.sesskey;
@@ -130,7 +134,7 @@ static bool test_session(struct smbcli_state *cli, struct torture_context *tctx)
if (cli->transport->negotiate.capabilities & CAP_EXTENDED_SECURITY) {
printf("create a fourth security context on the same transport, without extended security\n");
- session3 = smbcli_session_init(cli->transport, tctx, false);
+ session3 = smbcli_session_init(cli->transport, tctx, false, options);
session3->vuid = session->vuid;
setup.in.sesskey = cli->transport->negotiate.sesskey;
@@ -144,7 +148,7 @@ static bool test_session(struct smbcli_state *cli, struct torture_context *tctx)
CHECK_STATUS(status, NT_STATUS_LOGON_FAILURE);
printf("create a fouth anonymous security context on the same transport, without extended security\n");
- session4 = smbcli_session_init(cli->transport, tctx, false);
+ session4 = smbcli_session_init(cli->transport, tctx, false, options);
session4->vuid = session->vuid;
setup.in.sesskey = cli->transport->negotiate.sesskey;
@@ -230,7 +234,7 @@ static bool test_session(struct smbcli_state *cli, struct torture_context *tctx)
setups[i].in.credentials = cmdline_credentials;
- sessions[i] = smbcli_session_init(cli->transport, tctx, false);
+ sessions[i] = smbcli_session_init(cli->transport, tctx, false, options);
composite_contexts[i] = smb_composite_sesssetup_send(sessions[i], &setups[i]);
}
@@ -379,6 +383,7 @@ static bool test_tree_ulogoff(struct smbcli_state *cli, struct torture_context *
const char *fname1 = BASEDIR "\\test1.txt";
const char *fname2 = BASEDIR "\\test2.txt";
uint8_t c = 1;
+ struct smbcli_session_options options;
printf("TESTING TREE with ulogoff\n");
@@ -389,8 +394,10 @@ static bool test_tree_ulogoff(struct smbcli_state *cli, struct torture_context *
share = torture_setting_string(tctx, "share", NULL);
host = torture_setting_string(tctx, "host", NULL);
+ lp_smbcli_session_options(tctx->lp_ctx, &options);
+
printf("create the first new sessions\n");
- session1 = smbcli_session_init(cli->transport, tctx, false);
+ session1 = smbcli_session_init(cli->transport, tctx, false, options);
setup.in.sesskey = cli->transport->negotiate.sesskey;
setup.in.capabilities = cli->transport->negotiate.capabilities;
setup.in.workgroup = lp_workgroup(tctx->lp_ctx);
@@ -446,7 +453,7 @@ static bool test_tree_ulogoff(struct smbcli_state *cli, struct torture_context *
CHECK_STATUS(status, NT_STATUS_OK);
printf("create the second new sessions\n");
- session2 = smbcli_session_init(cli->transport, tctx, false);
+ session2 = smbcli_session_init(cli->transport, tctx, false, options);
setup.in.sesskey = cli->transport->negotiate.sesskey;
setup.in.capabilities = cli->transport->negotiate.capabilities;
setup.in.workgroup = lp_workgroup(tctx->lp_ctx);
@@ -634,6 +641,7 @@ static bool test_pid_2sess(struct smbcli_state *cli, struct torture_context *tct
const char *fname = BASEDIR "\\test.txt";
uint8_t c = 1;
uint16_t vuid1, vuid2;
+ struct smbcli_session_options options;
printf("TESTING PID HANDLING WITH 2 SESSIONS\n");
@@ -641,8 +649,10 @@ static bool test_pid_2sess(struct smbcli_state *cli, struct torture_context *tct
return false;
}
+ lp_smbcli_session_options(tctx->lp_ctx, &options);
+
printf("create a second security context on the same transport\n");
- session = smbcli_session_init(cli->transport, tctx, false);
+ session = smbcli_session_init(cli->transport, tctx, false, options);
setup.in.sesskey = cli->transport->negotiate.sesskey;
setup.in.capabilities = cli->transport->negotiate.capabilities; /* ignored in secondary session setup, except by our libs, which care about the extended security bit */
diff --git a/source4/torture/raw/lock.c b/source4/torture/raw/lock.c
index cd8d606795..dbe071c9ad 100644
--- a/source4/torture/raw/lock.c
+++ b/source4/torture/raw/lock.c
@@ -456,11 +456,14 @@ static bool test_async(struct torture_context *tctx,
const char *fname = BASEDIR "\\test.txt";
time_t t;
struct smbcli_request *req;
+ struct smbcli_session_options options;
if (!torture_setup_dir(cli, BASEDIR)) {
return false;
}
+ lp_smbcli_session_options(tctx->lp_ctx, &options);
+
printf("Testing LOCKING_ANDX_CANCEL_LOCK\n");
io.generic.level = RAW_LOCK_LOCKX;
@@ -590,7 +593,7 @@ static bool test_async(struct torture_context *tctx,
}
printf("create a new sessions\n");
- session = smbcli_session_init(cli->transport, tctx, false);
+ session = smbcli_session_init(cli->transport, tctx, false, options);
setup.in.sesskey = cli->transport->negotiate.sesskey;
setup.in.capabilities = cli->transport->negotiate.capabilities;
setup.in.workgroup = lp_workgroup(tctx->lp_ctx);
diff --git a/source4/torture/raw/lockbench.c b/source4/torture/raw/lockbench.c
index 21541d003b..26fad4235e 100644
--- a/source4/torture/raw/lockbench.c
+++ b/source4/torture/raw/lockbench.c
@@ -195,6 +195,7 @@ static void reopen_connection(struct event_context *ev, struct timed_event *te,
io->in.fallback_to_anonymous = false;
io->in.workgroup = lp_workgroup(state->tctx->lp_ctx);
lp_smbcli_options(state->tctx->lp_ctx, &io->in.options);
+ lp_smbcli_session_options(state->tctx->lp_ctx, &io->in.session_options);
/* kill off the remnants of the old connection */
talloc_free(state->tree);
diff --git a/source4/torture/raw/notify.c b/source4/torture/raw/notify.c
index 25c91eb88b..d7541b7c71 100644
--- a/source4/torture/raw/notify.c
+++ b/source4/torture/raw/notify.c
@@ -583,7 +583,9 @@ static bool test_notify_mask(struct smbcli_state *cli, struct torture_context *t
notify.nttrans.in.buffer_size = 1000;
notify.nttrans.in.recursive = true;
-#define NOTIFY_MASK_TEST(setup, op, cleanup, Action, expected, nchanges) \
+#define NOTIFY_MASK_TEST(test_name, setup, op, cleanup, Action, expected, nchanges) \
+ do { \
+ smbcli_getatr(cli->tree, test_name, NULL, NULL, NULL); \
do { for (mask=i=0;i<32;i++) { \
struct smbcli_request *req; \
status = smb_raw_open(cli->tree, tctx, &io); \
@@ -640,24 +642,25 @@ static bool test_notify_mask(struct smbcli_state *cli, struct torture_context *t
mask, expected); \
} \
} \
- } while (0)
+ } while (0); \
+ } while (0);
printf("testing mkdir\n");
- NOTIFY_MASK_TEST(;,
+ NOTIFY_MASK_TEST("testing mkdir",;,
smbcli_mkdir(cli->tree, BASEDIR "\\tname1");,
smbcli_rmdir(cli->tree, BASEDIR "\\tname1");,
NOTIFY_ACTION_ADDED,
FILE_NOTIFY_CHANGE_DIR_NAME, 1);
printf("testing create file\n");
- NOTIFY_MASK_TEST(;,
+ NOTIFY_MASK_TEST("testing create file",;,
smbcli_close(cli->tree, smbcli_open(cli->tree, BASEDIR "\\tname1", O_CREAT, 0));,
smbcli_unlink(cli->tree, BASEDIR "\\tname1");,
NOTIFY_ACTION_ADDED,
FILE_NOTIFY_CHANGE_FILE_NAME, 1);
printf("testing unlink\n");
- NOTIFY_MASK_TEST(
+ NOTIFY_MASK_TEST("testing unlink",
smbcli_close(cli->tree, smbcli_open(cli->tree, BASEDIR "\\tname1", O_CREAT, 0));,
smbcli_unlink(cli->tree, BASEDIR "\\tname1");,
;,
@@ -665,7 +668,7 @@ static bool test_notify_mask(struct smbcli_state *cli, struct torture_context *t
FILE_NOTIFY_CHANGE_FILE_NAME, 1);
printf("testing rmdir\n");
- NOTIFY_MASK_TEST(
+ NOTIFY_MASK_TEST("testing rmdir",
smbcli_mkdir(cli->tree, BASEDIR "\\tname1");,
smbcli_rmdir(cli->tree, BASEDIR "\\tname1");,
;,
@@ -673,7 +676,7 @@ static bool test_notify_mask(struct smbcli_state *cli, struct torture_context *t
FILE_NOTIFY_CHANGE_DIR_NAME, 1);
printf("testing rename file\n");
- NOTIFY_MASK_TEST(
+ NOTIFY_MASK_TEST("testing rename file",
smbcli_close(cli->tree, smbcli_open(cli->tree, BASEDIR "\\tname1", O_CREAT, 0));,
smbcli_rename(cli->tree, BASEDIR "\\tname1", BASEDIR "\\tname2");,
smbcli_unlink(cli->tree, BASEDIR "\\tname2");,
@@ -681,7 +684,7 @@ static bool test_notify_mask(struct smbcli_state *cli, struct torture_context *t
FILE_NOTIFY_CHANGE_FILE_NAME|FILE_NOTIFY_CHANGE_ATTRIBUTES|FILE_NOTIFY_CHANGE_CREATION, 2);
printf("testing rename dir\n");
- NOTIFY_MASK_TEST(
+ NOTIFY_MASK_TEST("testing rename dir",
smbcli_mkdir(cli->tree, BASEDIR "\\tname1");,
smbcli_rename(cli->tree, BASEDIR "\\tname1", BASEDIR "\\tname2");,
smbcli_rmdir(cli->tree, BASEDIR "\\tname2");,
@@ -689,7 +692,7 @@ static bool test_notify_mask(struct smbcli_state *cli, struct torture_context *t
FILE_NOTIFY_CHANGE_DIR_NAME, 2);
printf("testing set path attribute\n");
- NOTIFY_MASK_TEST(
+ NOTIFY_MASK_TEST("testing set path attribute",
smbcli_close(cli->tree, smbcli_open(cli->tree, BASEDIR "\\tname1", O_CREAT, 0));,
smbcli_setatr(cli->tree, BASEDIR "\\tname1", FILE_ATTRIBUTE_HIDDEN, 0);,
smbcli_unlink(cli->tree, BASEDIR "\\tname1");,
@@ -697,7 +700,7 @@ static bool test_notify_mask(struct smbcli_state *cli, struct torture_context *t
FILE_NOTIFY_CHANGE_ATTRIBUTES, 1);
printf("testing set path write time\n");
- NOTIFY_MASK_TEST(
+ NOTIFY_MASK_TEST("testing set path write time",
smbcli_close(cli->tree, smbcli_open(cli->tree, BASEDIR "\\tname1", O_CREAT, 0));,
smbcli_setatr(cli->tree, BASEDIR "\\tname1", FILE_ATTRIBUTE_NORMAL, 1000);,
smbcli_unlink(cli->tree, BASEDIR "\\tname1");,
@@ -705,7 +708,7 @@ static bool test_notify_mask(struct smbcli_state *cli, struct torture_context *t
FILE_NOTIFY_CHANGE_LAST_WRITE, 1);
printf("testing set file attribute\n");
- NOTIFY_MASK_TEST(
+ NOTIFY_MASK_TEST("testing set file attribute",
fnum2 = create_complex_file(cli, tctx, BASEDIR "\\tname1");,
smbcli_fsetatr(cli->tree, fnum2, FILE_ATTRIBUTE_HIDDEN, 0, 0, 0, 0);,
(smbcli_close(cli->tree, fnum2), smbcli_unlink(cli->tree, BASEDIR "\\tname1"));,
@@ -718,7 +721,7 @@ static bool test_notify_mask(struct smbcli_state *cli, struct torture_context *t
}
else {
printf("testing set file create time\n");
- NOTIFY_MASK_TEST(
+ NOTIFY_MASK_TEST("testing set file create time",
fnum2 = create_complex_file(cli, tctx,
BASEDIR "\\tname1");,
smbcli_fsetatr(cli->tree, fnum2, 0, t, 0, 0, 0);,
@@ -729,7 +732,7 @@ static bool test_notify_mask(struct smbcli_state *cli, struct torture_context *t
}
printf("testing set file access time\n");
- NOTIFY_MASK_TEST(
+ NOTIFY_MASK_TEST("testing set file access time",
fnum2 = create_complex_file(cli, tctx, BASEDIR "\\tname1");,
smbcli_fsetatr(cli->tree, fnum2, 0, 0, t, 0, 0);,
(smbcli_close(cli->tree, fnum2), smbcli_unlink(cli->tree, BASEDIR "\\tname1"));,
@@ -737,7 +740,7 @@ static bool test_notify_mask(struct smbcli_state *cli, struct torture_context *t
FILE_NOTIFY_CHANGE_LAST_ACCESS, 1);
printf("testing set file write time\n");
- NOTIFY_MASK_TEST(
+ NOTIFY_MASK_TEST("testing set file write time",
fnum2 = create_complex_file(cli, tctx, BASEDIR "\\tname1");,
smbcli_fsetatr(cli->tree, fnum2, 0, 0, 0, t, 0);,
(smbcli_close(cli->tree, fnum2), smbcli_unlink(cli->tree, BASEDIR "\\tname1"));,
@@ -745,7 +748,7 @@ static bool test_notify_mask(struct smbcli_state *cli, struct torture_context *t
FILE_NOTIFY_CHANGE_LAST_WRITE, 1);
printf("testing set file change time\n");
- NOTIFY_MASK_TEST(
+ NOTIFY_MASK_TEST("testing set file change time",
fnum2 = create_complex_file(cli, tctx, BASEDIR "\\tname1");,
smbcli_fsetatr(cli->tree, fnum2, 0, 0, 0, 0, t);,
(smbcli_close(cli->tree, fnum2), smbcli_unlink(cli->tree, BASEDIR "\\tname1"));,
@@ -754,7 +757,7 @@ static bool test_notify_mask(struct smbcli_state *cli, struct torture_context *t
printf("testing write\n");
- NOTIFY_MASK_TEST(
+ NOTIFY_MASK_TEST("testing write",
fnum2 = create_complex_file(cli, tctx, BASEDIR "\\tname1");,
smbcli_write(cli->tree, fnum2, 1, &c, 10000, 1);,
(smbcli_close(cli->tree, fnum2), smbcli_unlink(cli->tree, BASEDIR "\\tname1"));,
@@ -762,7 +765,7 @@ static bool test_notify_mask(struct smbcli_state *cli, struct torture_context *t
0, 1);
printf("testing truncate\n");
- NOTIFY_MASK_TEST(
+ NOTIFY_MASK_TEST("testing truncate",
fnum2 = create_complex_file(cli, tctx, BASEDIR "\\tname1");,
smbcli_ftruncate(cli->tree, fnum2, 10000);,
(smbcli_close(cli->tree, fnum2), smbcli_unlink(cli->tree, BASEDIR "\\tname1"));,
diff --git a/source4/torture/raw/open.c b/source4/torture/raw/open.c
index f3494ea3d0..dd5ef0d0b9 100644
--- a/source4/torture/raw/open.c
+++ b/source4/torture/raw/open.c
@@ -1545,6 +1545,64 @@ static bool test_raw_open_multi(struct torture_context *tctx)
return ret;
}
+/*
+ test opening for delete on a read-only attribute file.
+*/
+static bool test_open_for_delete(struct smbcli_state *cli, struct torture_context *tctx)
+{
+ union smb_open io;
+ union smb_fileinfo finfo;
+ const char *fname = BASEDIR "\\torture_open_for_delete.txt";
+ NTSTATUS status;
+ int fnum = -1;
+ bool ret = true;
+
+ printf("Checking RAW_NTCREATEX for delete on a readonly file.\n");
+
+ /* reasonable default parameters */
+ io.generic.level = RAW_OPEN_NTCREATEX;
+ io.ntcreatex.in.flags = NTCREATEX_FLAGS_EXTENDED;
+ io.ntcreatex.in.root_fid = 0;
+ io.ntcreatex.in.alloc_size = 0;
+ io.ntcreatex.in.access_mask = SEC_RIGHTS_FILE_ALL;
+ io.ntcreatex.in.file_attr = FILE_ATTRIBUTE_READONLY;
+ io.ntcreatex.in.share_access = NTCREATEX_SHARE_ACCESS_NONE;
+ io.ntcreatex.in.open_disposition = NTCREATEX_DISP_CREATE;
+ io.ntcreatex.in.create_options = 0;
+ io.ntcreatex.in.impersonation = NTCREATEX_IMPERSONATION_ANONYMOUS;
+ io.ntcreatex.in.security_flags = 0;
+ io.ntcreatex.in.fname = fname;
+
+ /* Create the readonly file. */
+
+ status = smb_raw_open(cli->tree, tctx, &io);
+ CHECK_STATUS(status, NT_STATUS_OK);
+ fnum = io.ntcreatex.out.file.fnum;
+
+ CHECK_VAL(io.ntcreatex.out.oplock_level, 0);
+ io.ntcreatex.in.create_options = 0;
+ CHECK_VAL(io.ntcreatex.out.create_action, NTCREATEX_ACTION_CREATED);
+ CHECK_ALL_INFO(io.ntcreatex.out.attrib, attrib);
+ smbcli_close(cli->tree, fnum);
+
+ /* Now try and open for delete only - should succeed. */
+ io.ntcreatex.in.access_mask = SEC_STD_DELETE;
+ io.ntcreatex.in.file_attr = 0;
+ io.ntcreatex.in.share_access = NTCREATEX_SHARE_ACCESS_READ | NTCREATEX_SHARE_ACCESS_WRITE | NTCREATEX_SHARE_ACCESS_DELETE;
+ io.ntcreatex.in.open_disposition = NTCREATEX_DISP_OPEN;
+ status = smb_raw_open(cli->tree, tctx, &io);
+ CHECK_STATUS(status, NT_STATUS_OK);
+
+ smbcli_unlink(cli->tree, fname);
+
+done:
+ smbcli_close(cli->tree, fnum);
+ smbcli_unlink(cli->tree, fname);
+
+ return ret;
+}
+
+
/* basic testing of all RAW_OPEN_* calls
*/
bool torture_raw_open(struct torture_context *torture, struct smbcli_state *cli)
@@ -1567,6 +1625,7 @@ bool torture_raw_open(struct torture_context *torture, struct smbcli_state *cli)
ret &= test_ctemp(cli, torture);
ret &= test_chained(cli, torture);
ret &= test_no_leading_slash(cli, torture);
+ ret &= test_open_for_delete(cli, torture);
smb_raw_exit(cli->session);
smbcli_deltree(cli->tree, BASEDIR);
diff --git a/source4/torture/raw/openbench.c b/source4/torture/raw/openbench.c
index 26b862c33f..ec94637445 100644
--- a/source4/torture/raw/openbench.c
+++ b/source4/torture/raw/openbench.c
@@ -137,6 +137,7 @@ static void reopen_connection(struct event_context *ev, struct timed_event *te,
io->in.fallback_to_anonymous = false;
io->in.workgroup = lp_workgroup(state->tctx->lp_ctx);
lp_smbcli_options(state->tctx->lp_ctx, &io->in.options);
+ lp_smbcli_session_options(state->tctx->lp_ctx, &io->in.session_options);
/* kill off the remnants of the old connection */
talloc_free(state->tree);
diff --git a/source4/torture/raw/oplock.c b/source4/torture/raw/oplock.c
index fd8d292980..7e964b4d42 100644
--- a/source4/torture/raw/oplock.c
+++ b/source4/torture/raw/oplock.c
@@ -175,10 +175,11 @@ static bool open_connection_no_level2_oplocks(struct torture_context *tctx,
struct smbcli_state **c)
{
NTSTATUS status;
-
struct smbcli_options options;
+ struct smbcli_session_options session_options;
lp_smbcli_options(tctx->lp_ctx, &options);
+ lp_smbcli_session_options(tctx->lp_ctx, &session_options);
options.use_level2_oplocks = false;
@@ -188,7 +189,7 @@ static bool open_connection_no_level2_oplocks(struct torture_context *tctx,
torture_setting_string(tctx, "share", NULL),
NULL, cmdline_credentials,
lp_resolve_context(tctx->lp_ctx),
- tctx->ev, &options);
+ tctx->ev, &options, &session_options);
if (!NT_STATUS_IS_OK(status)) {
printf("Failed to open connection - %s\n", nt_errstr(status));
return false;
diff --git a/source4/torture/raw/tconrate.c b/source4/torture/raw/tconrate.c
index 6f0ba0d617..66ef2ae2dd 100644
--- a/source4/torture/raw/tconrate.c
+++ b/source4/torture/raw/tconrate.c
@@ -69,8 +69,10 @@ static int fork_tcon_client(struct torture_context *tctx,
struct timeval end;
struct timeval now;
struct smbcli_options options;
+ struct smbcli_session_options session_options;
lp_smbcli_options(tctx->lp_ctx, &options);
+ lp_smbcli_session_options(tctx->lp_ctx, &session_options);
child = fork();
if (child == -1) {
@@ -100,7 +102,7 @@ static int fork_tcon_client(struct torture_context *tctx,
host, lp_smb_ports(tctx->lp_ctx), share,
NULL, cmdline_credentials,
lp_resolve_context(tctx->lp_ctx),
- tctx->ev, &options);
+ tctx->ev, &options, &session_options);
if (!NT_STATUS_IS_OK(status)) {
printf("failed to connect to //%s/%s: %s\n",
diff --git a/source4/torture/rpc/drsuapi_cracknames.c b/source4/torture/rpc/drsuapi_cracknames.c
index fbda69df57..a9a614953d 100644
--- a/source4/torture/rpc/drsuapi_cracknames.c
+++ b/source4/torture/rpc/drsuapi_cracknames.c
@@ -39,6 +39,7 @@ static bool test_DsCrackNamesMatrix(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx,
bool ret = true;
struct drsuapi_DsCrackNames r;
enum drsuapi_DsNameFormat formats[] = {
+ DRSUAPI_DS_NAME_FORMAT_UNKNOWN,
DRSUAPI_DS_NAME_FORMAT_FQDN_1779,
DRSUAPI_DS_NAME_FORMAT_NT4_ACCOUNT,
DRSUAPI_DS_NAME_FORMAT_DISPLAY,
diff --git a/source4/torture/rpc/dssync.c b/source4/torture/rpc/dssync.c
index e9346f9605..41bb168619 100644
--- a/source4/torture/rpc/dssync.c
+++ b/source4/torture/rpc/dssync.c
@@ -29,7 +29,7 @@
#include "torture/torture.h"
#include "torture/ldap/proto.h"
#include "libcli/auth/libcli_auth.h"
-#include "lib/crypto/crypto.h"
+#include "../lib/crypto/crypto.h"
#include "auth/credentials/credentials.h"
#include "libcli/auth/libcli_auth.h"
#include "auth/gensec/gensec.h"
@@ -310,14 +310,14 @@ static bool test_GetInfo(struct torture_context *tctx, struct DsSyncTest *ctx)
ctx->site_name = talloc_asprintf(ctx, "%s", "Default-First-Site-Name");
printf("cldap_netlogon() returned %s. Defaulting to Site-Name: %s\n", errstr, ctx->site_name);
} else {
- ctx->site_name = talloc_steal(ctx, search.out.netlogon.nt5_ex.client_site);
+ ctx->site_name = talloc_steal(ctx, search.out.netlogon.data.nt5_ex.client_site);
printf("cldap_netlogon() returned Client Site-Name: %s.\n",ctx->site_name);
- printf("cldap_netlogon() returned Server Site-Name: %s.\n",search.out.netlogon.nt5_ex.server_site);
+ printf("cldap_netlogon() returned Server Site-Name: %s.\n",search.out.netlogon.data.nt5_ex.server_site);
}
if (!ctx->domain_dn) {
struct ldb_context *ldb = ldb_init(ctx, tctx->ev);
- struct ldb_dn *dn = samdb_dns_domain_to_dn(ldb, ctx, search.out.netlogon.nt5_ex.dns_domain);
+ struct ldb_dn *dn = samdb_dns_domain_to_dn(ldb, ctx, search.out.netlogon.data.nt5_ex.dns_domain);
ctx->domain_dn = ldb_dn_alloc_linearized(ctx, dn);
talloc_free(dn);
talloc_free(ldb);
diff --git a/source4/torture/rpc/join.c b/source4/torture/rpc/join.c
index 77da32d572..ee0c05360f 100644
--- a/source4/torture/rpc/join.c
+++ b/source4/torture/rpc/join.c
@@ -19,6 +19,7 @@ bool torture_rpc_join(struct torture_context *torture)
struct smbcli_state *cli;
const char *host = torture_setting_string(torture, "host", NULL);
struct smbcli_options options;
+ struct smbcli_session_options session_options;
/* Join domain as a member server. */
tj = torture_join_domain(torture,
@@ -33,13 +34,14 @@ bool torture_rpc_join(struct torture_context *torture)
}
lp_smbcli_options(torture->lp_ctx, &options);
+ lp_smbcli_session_options(torture->lp_ctx, &session_options);
status = smbcli_full_connection(tj, &cli, host,
lp_smb_ports(torture->lp_ctx),
"IPC$", NULL,
machine_account,
lp_resolve_context(torture->lp_ctx),
- torture->ev, &options);
+ torture->ev, &options, &session_options);
if (!NT_STATUS_IS_OK(status)) {
DEBUG(0, ("%s failed to connect to IPC$ with workstation credentials\n",
TORTURE_NETBIOS_NAME));
@@ -65,7 +67,7 @@ bool torture_rpc_join(struct torture_context *torture)
"IPC$", NULL,
machine_account,
lp_resolve_context(torture->lp_ctx),
- torture->ev, &options);
+ torture->ev, &options, &session_options);
if (!NT_STATUS_IS_OK(status)) {
DEBUG(0, ("%s failed to connect to IPC$ with workstation credentials\n",
TORTURE_NETBIOS_NAME));
diff --git a/source4/torture/rpc/lsa.c b/source4/torture/rpc/lsa.c
index a13a8d8818..245ed1e41b 100644
--- a/source4/torture/rpc/lsa.c
+++ b/source4/torture/rpc/lsa.c
@@ -29,7 +29,7 @@
#include "libcli/auth/libcli_auth.h"
#include "torture/rpc/rpc.h"
#include "param/param.h"
-#include "lib/crypto/crypto.h"
+#include "../lib/crypto/crypto.h"
#define TEST_MACHINENAME "lsatestmach"
static void init_lsa_String(struct lsa_String *name, const char *s)
@@ -222,12 +222,13 @@ static bool test_LookupNames_bogus(struct dcerpc_pipe *p,
NTSTATUS status;
int i;
- struct lsa_TranslatedName name;
+ struct lsa_TranslatedName name[2];
struct lsa_TransNameArray tnames;
- tnames.names = &name;
- tnames.count = 1;
- name.name.string = "NT AUTHORITY\\BOGUS";
+ tnames.names = name;
+ tnames.count = 2;
+ name[0].name.string = "NT AUTHORITY\\BOGUS";
+ name[1].name.string = NULL;
printf("\nTesting LookupNames with bogus names\n");
@@ -337,8 +338,8 @@ static bool test_LookupNames2(struct dcerpc_pipe *p,
r.in.sids = &sids;
r.in.level = 1;
r.in.count = &count;
- r.in.unknown1 = 0;
- r.in.unknown2 = 0;
+ r.in.lookup_options = 0;
+ r.in.client_revision = 0;
r.out.count = &count;
r.out.sids = &sids;
@@ -382,8 +383,8 @@ static bool test_LookupNames3(struct dcerpc_pipe *p,
r.in.sids = &sids;
r.in.level = 1;
r.in.count = &count;
- r.in.unknown1 = 0;
- r.in.unknown2 = 0;
+ r.in.lookup_options = 0;
+ r.in.client_revision = 0;
r.out.count = &count;
r.out.sids = &sids;
@@ -424,8 +425,8 @@ static bool test_LookupNames4(struct dcerpc_pipe *p,
r.in.sids = &sids;
r.in.level = 1;
r.in.count = &count;
- r.in.unknown1 = 0;
- r.in.unknown2 = 0;
+ r.in.lookup_options = 0;
+ r.in.client_revision = 0;
r.out.count = &count;
r.out.sids = &sids;
@@ -1898,7 +1899,11 @@ static bool test_EnumTrustDom(struct dcerpc_pipe *p,
/* NO_MORE_ENTRIES is allowed */
if (NT_STATUS_EQUAL(enum_status, NT_STATUS_NO_MORE_ENTRIES)) {
- return true;
+ if (domains.count == 0) {
+ return true;
+ }
+ printf("EnumTrustDom failed - should have returned 0 trusted domains with 'NT_STATUS_NO_MORE_ENTRIES'\n");
+ return false;
} else if (NT_STATUS_EQUAL(enum_status, STATUS_MORE_ENTRIES)) {
/* Windows 2003 gets this off by one on the first run */
if (r.out.domains->count < 3 || r.out.domains->count > 4) {
@@ -1949,7 +1954,11 @@ static bool test_EnumTrustDom(struct dcerpc_pipe *p,
/* NO_MORE_ENTRIES is allowed */
if (NT_STATUS_EQUAL(enum_status, NT_STATUS_NO_MORE_ENTRIES)) {
- return true;
+ if (domains_ex.count == 0) {
+ return true;
+ }
+ printf("EnumTrustDomainsEx failed - should have returned 0 trusted domains with 'NT_STATUS_NO_MORE_ENTRIES'\n");
+ return false;
} else if (NT_STATUS_EQUAL(enum_status, STATUS_MORE_ENTRIES)) {
/* Windows 2003 gets this off by one on the first run */
if (r_ex.out.domains->count < 3 || r_ex.out.domains->count > 4) {
@@ -2077,7 +2086,7 @@ static bool test_CreateTrustedDomainEx2(struct dcerpc_pipe *p,
struct lsa_CreateTrustedDomainEx2 r;
struct lsa_TrustDomainInfoInfoEx trustinfo;
struct lsa_TrustDomainInfoAuthInfoInternal authinfo;
- struct trustAuthInAndOutBlob auth_struct;
+ struct trustDomainPasswords auth_struct;
DATA_BLOB auth_blob;
struct dom_sid *domsid[12];
struct policy_handle trustdom_handle[12];
@@ -2114,7 +2123,7 @@ static bool test_CreateTrustedDomainEx2(struct dcerpc_pipe *p,
/* Try different trust types too */
- /* 1 == downleven (NT4), 2 == uplevel (ADS), 3 == MIT (kerberos but not AD) */
+ /* 1 == downlevel (NT4), 2 == uplevel (ADS), 3 == MIT (kerberos but not AD) */
trustinfo.trust_type = (((i / 3) + 1) % 3) + 1;
trustinfo.trust_attributes = LSA_TRUST_ATTRIBUTE_USES_RC4_ENCRYPTION;
@@ -2125,9 +2134,9 @@ static bool test_CreateTrustedDomainEx2(struct dcerpc_pipe *p,
auth_struct.incoming.count = 0;
ndr_err = ndr_push_struct_blob(&auth_blob, mem_ctx, lp_iconv_convenience(tctx->lp_ctx), &auth_struct,
- (ndr_push_flags_fn_t)ndr_push_trustAuthInAndOutBlob);
+ (ndr_push_flags_fn_t)ndr_push_trustDomainPasswords);
if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
- printf("ndr_push_struct_blob of trustAuthInAndOutBlob structure failed");
+ printf("ndr_push_struct_blob of trustDomainPasswords structure failed");
ret = false;
}
@@ -2159,6 +2168,7 @@ static bool test_CreateTrustedDomainEx2(struct dcerpc_pipe *p,
printf("QueryTrustedDomainInfo level 1 failed - %s\n", nt_errstr(status));
ret = false;
} else if (!q.out.info) {
+ printf("QueryTrustedDomainInfo level 1 failed to return an info pointer\n");
ret = false;
} else {
if (strcmp(q.out.info->info_ex.netbios_name.string, trustinfo.netbios_name.string) != 0) {
@@ -2187,11 +2197,13 @@ static bool test_CreateTrustedDomainEx2(struct dcerpc_pipe *p,
/* now that we have some domains to look over, we can test the enum calls */
if (!test_EnumTrustDom(p, mem_ctx, handle)) {
+ printf("test_EnumTrustDom failed\n");
ret = false;
}
for (i=0; i<12; i++) {
if (!test_DeleteTrustedDomainBySid(p, mem_ctx, handle, domsid[i])) {
+ printf("test_DeleteTrustedDomainBySid failed\n");
ret = false;
}
}
@@ -2242,7 +2254,7 @@ static bool test_QueryInfoPolicy(struct dcerpc_pipe *p,
bool ret = true;
printf("\nTesting QueryInfoPolicy\n");
- for (i=1;i<13;i++) {
+ for (i=1;i<=13;i++) {
r.in.handle = handle;
r.in.level = i;
@@ -2261,7 +2273,14 @@ static bool test_QueryInfoPolicy(struct dcerpc_pipe *p,
break;
case LSA_POLICY_INFO_DOMAIN:
case LSA_POLICY_INFO_ACCOUNT_DOMAIN:
+ case LSA_POLICY_INFO_DNS_INT:
case LSA_POLICY_INFO_DNS:
+ case LSA_POLICY_INFO_REPLICA:
+ case LSA_POLICY_INFO_QUOTA:
+ case LSA_POLICY_INFO_ROLE:
+ case LSA_POLICY_INFO_AUDIT_LOG:
+ case LSA_POLICY_INFO_AUDIT_EVENTS:
+ case LSA_POLICY_INFO_PD:
if (!NT_STATUS_IS_OK(status)) {
printf("QueryInfoPolicy failed - %s\n", nt_errstr(status));
ret = false;
@@ -2351,7 +2370,14 @@ static bool test_QueryInfoPolicy2(struct dcerpc_pipe *p,
break;
case LSA_POLICY_INFO_DOMAIN:
case LSA_POLICY_INFO_ACCOUNT_DOMAIN:
+ case LSA_POLICY_INFO_DNS_INT:
case LSA_POLICY_INFO_DNS:
+ case LSA_POLICY_INFO_REPLICA:
+ case LSA_POLICY_INFO_QUOTA:
+ case LSA_POLICY_INFO_ROLE:
+ case LSA_POLICY_INFO_AUDIT_LOG:
+ case LSA_POLICY_INFO_AUDIT_EVENTS:
+ case LSA_POLICY_INFO_PD:
if (!NT_STATUS_IS_OK(status)) {
printf("QueryInfoPolicy2 failed - %s\n", nt_errstr(status));
ret = false;
@@ -2457,7 +2483,6 @@ bool torture_rpc_lsa(struct torture_context *tctx)
if (!join) {
ret = false;
}
-
if (!test_LookupNames_wellknown(p, tctx, handle)) {
ret = false;
}
@@ -2481,7 +2506,6 @@ bool torture_rpc_lsa(struct torture_context *tctx)
if (!test_CreateSecret(p, tctx, handle)) {
ret = false;
}
-
if (!test_CreateTrustedDomain(p, tctx, handle)) {
ret = false;
}
diff --git a/source4/torture/rpc/netlogon.c b/source4/torture/rpc/netlogon.c
index 5ec2c29a20..3d4c594d05 100644
--- a/source4/torture/rpc/netlogon.c
+++ b/source4/torture/rpc/netlogon.c
@@ -250,6 +250,10 @@ static bool test_SetupCredentials3(struct dcerpc_pipe *p, struct torture_context
torture_assert(tctx, creds_client_check(creds, &credentials3), "Credential chaining failed");
torture_comment(tctx, "negotiate_flags=0x%08x\n", negotiate_flags);
+
+ /* Prove that requesting a challenge again won't break it */
+ status = dcerpc_netr_ServerReqChallenge(p, tctx, &r);
+ torture_assert_ntstatus_ok(tctx, status, "ServerReqChallenge");
*creds_out = creds;
return true;
@@ -1393,7 +1397,14 @@ static bool test_GetDomainInfo(struct torture_context *tctx,
q1.blob2.data = NULL;
q1.product.string = "product string";
- torture_comment(tctx, "Testing netr_uogonGetDomainInfo\n");
+ torture_comment(tctx, "Testing netr_LogonGetDomainInfo\n");
+
+ status = dcerpc_netr_LogonGetDomainInfo(p, tctx, &r);
+ torture_assert_ntstatus_ok(tctx, status, "netr_LogonGetDomainInfo");
+ torture_assert(tctx, creds_client_check(creds, &a.cred), "Credential chaining failed");
+
+ torture_comment(tctx, "Testing netr_LogonGetDomainInfo 2nd call\n");
+ creds_client_authenticator(creds, &a);
status = dcerpc_netr_LogonGetDomainInfo(p, tctx, &r);
torture_assert_ntstatus_ok(tctx, status, "netr_LogonGetDomainInfo");
@@ -1577,6 +1588,7 @@ struct torture_suite *torture_rpc_netlogon(TALLOC_CTX *mem_ctx)
tcase = torture_suite_add_machine_rpc_iface_tcase(suite, "netlogon",
&ndr_table_netlogon, TEST_MACHINE_NAME);
+
torture_rpc_tcase_add_test(tcase, "LogonUasLogon", test_LogonUasLogon);
torture_rpc_tcase_add_test(tcase, "LogonUasLogoff", test_LogonUasLogoff);
torture_rpc_tcase_add_test_creds(tcase, "SamLogon", test_SamLogon);
diff --git a/source4/torture/rpc/object_uuid.c b/source4/torture/rpc/object_uuid.c
new file mode 100644
index 0000000000..5a77bd1c29
--- /dev/null
+++ b/source4/torture/rpc/object_uuid.c
@@ -0,0 +1,87 @@
+/*
+ Unix SMB/CIFS implementation.
+
+ test suite for behaviour of object uuids in rpc requests
+
+ Copyright (C) Stefan Metzmacher 2008
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>.
+*/
+
+#include "includes.h"
+#include "torture/torture.h"
+#include "librpc/gen_ndr/ndr_dssetup.h"
+#include "librpc/gen_ndr/ndr_dssetup_c.h"
+#include "librpc/gen_ndr/ndr_lsa.h"
+#include "librpc/gen_ndr/ndr_lsa_c.h"
+#include "torture/rpc/rpc.h"
+
+/*
+ this tests the send object uuids in the dcerpc request
+*/
+
+static bool test_random_uuid(struct torture_context *torture)
+{
+ NTSTATUS status;
+ struct dcerpc_pipe *p1, *p2;
+ struct rpc_request *req;
+ struct GUID uuid;
+ struct dssetup_DsRoleGetPrimaryDomainInformation r1;
+ struct lsa_GetUserName r2;
+ struct lsa_StringPointer authority_name_p;
+
+ torture_comment(torture, "RPC-OBJECTUUID-RANDOM\n");
+
+ status = torture_rpc_connection(torture, &p1, &ndr_table_dssetup);
+ torture_assert_ntstatus_ok(torture, status, "opening dsetup pipe1");
+
+ status = torture_rpc_connection(torture, &p2, &ndr_table_lsarpc);
+ torture_assert_ntstatus_ok(torture, status, "opening lsa pipe1");
+
+ uuid = GUID_random();
+
+ r1.in.level = DS_ROLE_BASIC_INFORMATION;
+ req = dcerpc_ndr_request_send(p1, &uuid,
+ &ndr_table_dssetup,
+ NDR_DSSETUP_DSROLEGETPRIMARYDOMAININFORMATION,
+ torture, &r1);
+ status = dcerpc_ndr_request_recv(req);
+ torture_assert_ntstatus_ok(torture, status, "DsRoleGetPrimaryDomainInformation failed");
+ torture_assert_werr_ok(torture, r1.out.result, "DsRoleGetPrimaryDomainInformation failed");
+
+ uuid = GUID_random();
+
+ r2.in.system_name = "\\";
+ r2.in.account_name = NULL;
+ r2.in.authority_name = &authority_name_p;
+ authority_name_p.string = NULL;
+
+ req = dcerpc_ndr_request_send(p2, &uuid,
+ &ndr_table_lsarpc,
+ NDR_LSA_GETUSERNAME,
+ torture, &r2);
+ status = dcerpc_ndr_request_recv(req);
+ torture_assert_ntstatus_ok(torture, status, "lsaClose failed");
+ torture_assert_ntstatus_ok(torture, r2.out.result, "lsaClose failed");
+
+ return true;
+}
+
+struct torture_suite *torture_rpc_object_uuid(TALLOC_CTX *mem_ctx)
+{
+ struct torture_suite *suite;
+ suite = torture_suite_create(mem_ctx, "OBJECTUUID");
+ torture_suite_add_simple_test(suite, "random-uuid", test_random_uuid);
+ return suite;
+}
diff --git a/source4/torture/rpc/remote_pac.c b/source4/torture/rpc/remote_pac.c
index 6419e40014..a4111d1c3e 100644
--- a/source4/torture/rpc/remote_pac.c
+++ b/source4/torture/rpc/remote_pac.c
@@ -68,8 +68,6 @@ static bool test_PACVerify(struct torture_context *tctx,
TALLOC_CTX *tmp_ctx = talloc_new(tctx);
- int i;
-
torture_assert(tctx, tmp_ctx != NULL, "talloc_new() failed");
if (!test_SetupCredentials2(p, tctx, NETLOGON_NEG_AUTH2_ADS_FLAGS,
@@ -118,16 +116,12 @@ static bool test_PACVerify(struct torture_context *tctx,
torture_assert_ntstatus_ok(tctx, status, "gensec_update (client) failed");
}
- if (client_to_server.length == 0) {
- break;
- }
-
status = gensec_update(gensec_server_context, tmp_ctx, client_to_server, &server_to_client);
if (!NT_STATUS_EQUAL(status, NT_STATUS_MORE_PROCESSING_REQUIRED)) {;
torture_assert_ntstatus_ok(tctx, status, "gensec_update (server) failed");
}
- if (server_to_client.length == 0) {
+ if (NT_STATUS_IS_OK(status)) {
break;
}
} while (1);
@@ -137,7 +131,6 @@ static bool test_PACVerify(struct torture_context *tctx,
status = gensec_session_info(gensec_server_context, &session_info);
torture_assert_ntstatus_ok(tctx, status, "gensec_session_info failed");
- pac_wrapped_struct.MessageType = 0x3;
pac_wrapped_struct.ChecksumLength = session_info->server_info->pac_srv_sig.signature.length;
pac_wrapped_struct.SignatureType = session_info->server_info->pac_kdc_sig.type;
pac_wrapped_struct.SignatureLength = session_info->server_info->pac_kdc_sig.signature.length;
@@ -207,51 +200,6 @@ static bool test_PACVerify(struct torture_context *tctx,
torture_assert(tctx, creds_client_check(creds, &r.out.return_authenticator->cred),
"Credential chaining failed");
- /* This will break message type, check that however we still get NT_STATUS_OK */
- for (i=0; i < 256; i++) {
- pac_wrapped_struct.MessageType = i;
- pac_wrapped_struct.ChecksumLength = session_info->server_info->pac_srv_sig.signature.length;
- pac_wrapped_struct.SignatureType = session_info->server_info->pac_kdc_sig.type;
- pac_wrapped_struct.SignatureLength = session_info->server_info->pac_kdc_sig.signature.length;
- pac_wrapped_struct.ChecksumAndSignature = payload
- = data_blob_talloc(tmp_ctx, NULL,
- pac_wrapped_struct.ChecksumLength
- + pac_wrapped_struct.SignatureLength);
- memcpy(&payload.data[0],
- session_info->server_info->pac_srv_sig.signature.data,
- pac_wrapped_struct.ChecksumLength);
- memcpy(&payload.data[pac_wrapped_struct.ChecksumLength],
- session_info->server_info->pac_kdc_sig.signature.data,
- pac_wrapped_struct.SignatureLength);
-
- ndr_err = ndr_push_struct_blob(&pac_wrapped, tmp_ctx, lp_iconv_convenience(tctx->lp_ctx), &pac_wrapped_struct,
- (ndr_push_flags_fn_t)ndr_push_PAC_Validate);
- torture_assert(tctx, NDR_ERR_CODE_IS_SUCCESS(ndr_err), "ndr_push_struct_blob of PACValidate structure failed");
-
- torture_assert(tctx, (creds->negotiate_flags & NETLOGON_NEG_ARCFOUR), "not willing to even try a PACValidate without RC4 encryption");
- creds_arcfour_crypt(creds, pac_wrapped.data, pac_wrapped.length);
-
- generic.length = pac_wrapped.length;
- generic.data = pac_wrapped.data;
-
- ZERO_STRUCT(auth2);
- creds_client_authenticator(creds, &auth);
- r.in.credential = &auth;
- r.in.return_authenticator = &auth2;
- r.in.logon_level = NetlogonGenericInformation;
- r.in.logon.generic = &generic;
- r.in.server_name = talloc_asprintf(tctx, "\\\\%s", dcerpc_server_name(p));
- r.in.computer_name = cli_credentials_get_workstation(credentials);
- r.in.validation_level = NetlogonValidationGenericInfo2;
-
- status = dcerpc_netr_LogonSamLogon(p, tctx, &r);
-
- torture_assert_ntstatus_ok(tctx, status, "LogonSamLogon failed");
-
- torture_assert(tctx, creds_client_check(creds, &r.out.return_authenticator->cred),
- "Credential chaining failed");
- }
-
/* This will break the parsing nicely (even in the crypto wrapping), check we get INVALID_PARAMETER */
generic.length--;
@@ -272,7 +220,6 @@ static bool test_PACVerify(struct torture_context *tctx,
torture_assert(tctx, creds_client_check(creds, &r.out.return_authenticator->cred),
"Credential chaining failed");
- pac_wrapped_struct.MessageType = 0x3;
pac_wrapped_struct.ChecksumLength = session_info->server_info->pac_srv_sig.signature.length;
pac_wrapped_struct.SignatureType = session_info->server_info->pac_kdc_sig.type;
@@ -318,8 +265,6 @@ static bool test_PACVerify(struct torture_context *tctx,
torture_assert(tctx, creds_client_check(creds, &r.out.return_authenticator->cred),
"Credential chaining failed");
-
- pac_wrapped_struct.MessageType = 0x3;
pac_wrapped_struct.ChecksumLength = session_info->server_info->pac_srv_sig.signature.length;
pac_wrapped_struct.SignatureType = session_info->server_info->pac_kdc_sig.type;
pac_wrapped_struct.SignatureLength = session_info->server_info->pac_kdc_sig.signature.length;
diff --git a/source4/torture/rpc/rpc.c b/source4/torture/rpc/rpc.c
index 85f7bde16c..c35f93e3f9 100644
--- a/source4/torture/rpc/rpc.c
+++ b/source4/torture/rpc/rpc.c
@@ -387,6 +387,7 @@ NTSTATUS torture_rpc_init(void)
torture_suite_add_suite(suite, torture_rpc_atsvc(suite));
torture_suite_add_suite(suite, torture_rpc_wkssvc(suite));
torture_suite_add_suite(suite, torture_rpc_handles(suite));
+ torture_suite_add_suite(suite, torture_rpc_object_uuid(suite));
torture_suite_add_suite(suite, torture_rpc_winreg(suite));
torture_suite_add_simple_test(suite, "SPOOLSS", torture_rpc_spoolss);
torture_suite_add_suite(suite, torture_rpc_spoolss_notify(suite));
diff --git a/source4/torture/rpc/samba3rpc.c b/source4/torture/rpc/samba3rpc.c
index 17342f9b86..260c1cc149 100644
--- a/source4/torture/rpc/samba3rpc.c
+++ b/source4/torture/rpc/samba3rpc.c
@@ -47,7 +47,7 @@
#include "libcli/composite/composite.h"
#include "libcli/smb_composite/smb_composite.h"
#include "libcli/auth/libcli_auth.h"
-#include "lib/crypto/crypto.h"
+#include "../lib/crypto/crypto.h"
#include "auth/ntlmssp/ntlmssp.h"
#include "libcli/security/proto.h"
#include "param/param.h"
@@ -74,6 +74,7 @@ bool torture_bind_authcontext(struct torture_context *torture)
struct cli_credentials *anon_creds;
struct smb_composite_sesssetup setup;
struct smbcli_options options;
+ struct smbcli_session_options session_options;
mem_ctx = talloc_init("torture_bind_authcontext");
@@ -83,13 +84,14 @@ bool torture_bind_authcontext(struct torture_context *torture)
}
lp_smbcli_options(torture->lp_ctx, &options);
+ lp_smbcli_session_options(torture->lp_ctx, &session_options);
status = smbcli_full_connection(mem_ctx, &cli,
torture_setting_string(torture, "host", NULL),
lp_smb_ports(torture->lp_ctx),
"IPC$", NULL, cmdline_credentials,
lp_resolve_context(torture->lp_ctx),
- torture->ev, &options);
+ torture->ev, &options, &session_options);
if (!NT_STATUS_IS_OK(status)) {
d_printf("smbcli_full_connection failed: %s\n",
nt_errstr(status));
@@ -142,7 +144,7 @@ bool torture_bind_authcontext(struct torture_context *torture)
goto done;
}
- session2 = smbcli_session_init(cli->transport, mem_ctx, false);
+ session2 = smbcli_session_init(cli->transport, mem_ctx, false, session_options);
if (session2 == NULL) {
d_printf("smbcli_session_init failed\n");
goto done;
@@ -288,6 +290,7 @@ bool torture_bind_samba3(struct torture_context *torture)
bool ret = false;
struct smbcli_state *cli;
struct smbcli_options options;
+ struct smbcli_session_options session_options;
mem_ctx = talloc_init("torture_bind_authcontext");
@@ -297,13 +300,14 @@ bool torture_bind_samba3(struct torture_context *torture)
}
lp_smbcli_options(torture->lp_ctx, &options);
+ lp_smbcli_session_options(torture->lp_ctx, &session_options);
status = smbcli_full_connection(mem_ctx, &cli,
torture_setting_string(torture, "host", NULL),
lp_smb_ports(torture->lp_ctx),
"IPC$", NULL, cmdline_credentials,
lp_resolve_context(torture->lp_ctx),
- torture->ev, &options);
+ torture->ev, &options, &session_options);
if (!NT_STATUS_IS_OK(status)) {
d_printf("smbcli_full_connection failed: %s\n",
nt_errstr(status));
@@ -1195,6 +1199,7 @@ bool torture_netlogon_samba3(struct torture_context *torture)
const char *wks_name;
int i;
struct smbcli_options options;
+ struct smbcli_session_options session_options;
wks_name = torture_setting_string(torture, "wksname", NULL);
if (wks_name == NULL) {
@@ -1214,13 +1219,14 @@ bool torture_netlogon_samba3(struct torture_context *torture)
}
lp_smbcli_options(torture->lp_ctx, &options);
+ lp_smbcli_session_options(torture->lp_ctx, &session_options);
status = smbcli_full_connection(mem_ctx, &cli,
torture_setting_string(torture, "host", NULL),
lp_smb_ports(torture->lp_ctx),
"IPC$", NULL, anon_creds,
lp_resolve_context(torture->lp_ctx),
- torture->ev, &options);
+ torture->ev, &options, &session_options);
if (!NT_STATUS_IS_OK(status)) {
d_printf("smbcli_full_connection failed: %s\n",
nt_errstr(status));
@@ -1299,15 +1305,17 @@ static bool test_join3(struct torture_context *tctx,
struct smbcli_state *cli;
struct cli_credentials *wks_creds;
struct smbcli_options options;
+ struct smbcli_session_options session_options;
lp_smbcli_options(tctx->lp_ctx, &options);
+ lp_smbcli_session_options(tctx->lp_ctx, &session_options);
status = smbcli_full_connection(tctx, &cli,
torture_setting_string(tctx, "host", NULL),
lp_smb_ports(tctx->lp_ctx),
"IPC$", NULL, smb_creds,
lp_resolve_context(tctx->lp_ctx),
- tctx->ev, &options);
+ tctx->ev, &options, &session_options);
if (!NT_STATUS_IS_OK(status)) {
d_printf("smbcli_full_connection failed: %s\n",
nt_errstr(status));
@@ -1670,19 +1678,21 @@ bool torture_samba3_rpc_getusername(struct torture_context *torture)
struct cli_credentials *user_creds;
char *domain_name;
struct smbcli_options options;
+ struct smbcli_session_options session_options;
if (!(mem_ctx = talloc_new(torture))) {
return false;
}
lp_smbcli_options(torture->lp_ctx, &options);
+ lp_smbcli_session_options(torture->lp_ctx, &session_options);
status = smbcli_full_connection(
mem_ctx, &cli, torture_setting_string(torture, "host", NULL),
lp_smb_ports(torture->lp_ctx),
"IPC$", NULL, cmdline_credentials,
lp_resolve_context(torture->lp_ctx),
- torture->ev, &options);
+ torture->ev, &options, &session_options);
if (!NT_STATUS_IS_OK(status)) {
d_printf("(%s) smbcli_full_connection failed: %s\n",
__location__, nt_errstr(status));
@@ -1709,7 +1719,7 @@ bool torture_samba3_rpc_getusername(struct torture_context *torture)
lp_smb_ports(torture->lp_ctx),
"IPC$", NULL, anon_creds,
lp_resolve_context(torture->lp_ctx),
- torture->ev, &options);
+ torture->ev, &options, &session_options);
if (!NT_STATUS_IS_OK(status)) {
d_printf("(%s) anon smbcli_full_connection failed: %s\n",
__location__, nt_errstr(status));
@@ -1762,7 +1772,7 @@ bool torture_samba3_rpc_getusername(struct torture_context *torture)
struct smb_composite_sesssetup setup;
struct smbcli_tree *tree;
- session2 = smbcli_session_init(cli->transport, mem_ctx, false);
+ session2 = smbcli_session_init(cli->transport, mem_ctx, false, session_options);
if (session2 == NULL) {
d_printf("(%s) smbcli_session_init failed\n",
__location__);
diff --git a/source4/torture/rpc/samlogon.c b/source4/torture/rpc/samlogon.c
index e2558ff0a9..b7028e6609 100644
--- a/source4/torture/rpc/samlogon.c
+++ b/source4/torture/rpc/samlogon.c
@@ -26,7 +26,7 @@
#include "librpc/gen_ndr/ndr_netlogon_c.h"
#include "librpc/gen_ndr/ndr_samr_c.h"
#include "auth/auth.h"
-#include "lib/crypto/crypto.h"
+#include "../lib/crypto/crypto.h"
#include "lib/cmdline/popt_common.h"
#include "torture/rpc/rpc.h"
#include "auth/gensec/schannel_proto.h"
@@ -53,7 +53,9 @@ struct samlogon_state {
const char *comment;
const char *account_name;
const char *account_domain;
+ const char *netbios_name;
const char *password;
+ const char *workgroup;
struct dcerpc_pipe *p;
int function_level;
uint32_t parameter_control;
@@ -593,7 +595,7 @@ static bool test_lmv2_ntlmv2_broken(struct samlogon_state *samlogon_state,
DATA_BLOB lmv2_response = data_blob(NULL, 0);
DATA_BLOB lmv2_session_key = data_blob(NULL, 0);
DATA_BLOB ntlmv2_session_key = data_blob(NULL, 0);
- DATA_BLOB names_blob = NTLMv2_generate_names_blob(samlogon_state->mem_ctx, samlogon_state->iconv_convenience, TEST_MACHINE_NAME, lp_workgroup(global_loadparm));
+ DATA_BLOB names_blob = NTLMv2_generate_names_blob(samlogon_state->mem_ctx, samlogon_state->iconv_convenience, TEST_MACHINE_NAME, samlogon_state->workgroup);
uint8_t lm_session_key[8];
uint8_t user_session_key[16];
@@ -741,7 +743,7 @@ static bool test_lmv2_ntlm_broken(struct samlogon_state *samlogon_state,
DATA_BLOB lmv2_response = data_blob(NULL, 0);
DATA_BLOB lmv2_session_key = data_blob(NULL, 0);
DATA_BLOB ntlmv2_session_key = data_blob(NULL, 0);
- DATA_BLOB names_blob = NTLMv2_generate_names_blob(samlogon_state->mem_ctx, samlogon_state->iconv_convenience, lp_netbios_name(global_loadparm), lp_workgroup(global_loadparm));
+ DATA_BLOB names_blob = NTLMv2_generate_names_blob(samlogon_state->mem_ctx, samlogon_state->iconv_convenience, samlogon_state->netbios_name, samlogon_state->workgroup);
DATA_BLOB ntlm_response = data_blob_talloc(samlogon_state->mem_ctx, NULL, 24);
DATA_BLOB ntlm_session_key = data_blob_talloc(samlogon_state->mem_ctx, NULL, 16);
@@ -1337,6 +1339,8 @@ static bool test_SamLogon(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx,
samlogon_state.account_name = account_name;
samlogon_state.account_domain = account_domain;
samlogon_state.password = plain_pass;
+ samlogon_state.workgroup = lp_workgroup(tctx->lp_ctx);
+ samlogon_state.netbios_name = lp_netbios_name(tctx->lp_ctx);
samlogon_state.p = p;
samlogon_state.creds = creds;
samlogon_state.expected_error = expected_error;
diff --git a/source4/torture/rpc/samr.c b/source4/torture/rpc/samr.c
index 6afda6e9b5..d0aee057d3 100644
--- a/source4/torture/rpc/samr.c
+++ b/source4/torture/rpc/samr.c
@@ -24,7 +24,7 @@
#include "system/time.h"
#include "librpc/gen_ndr/lsa.h"
#include "librpc/gen_ndr/ndr_samr_c.h"
-#include "lib/crypto/crypto.h"
+#include "../lib/crypto/crypto.h"
#include "libcli/auth/libcli_auth.h"
#include "libcli/security/security.h"
#include "torture/rpc/rpc.h"
diff --git a/source4/torture/rpc/samsync.c b/source4/torture/rpc/samsync.c
index 1e76de1dd2..6a02af5bb5 100644
--- a/source4/torture/rpc/samsync.c
+++ b/source4/torture/rpc/samsync.c
@@ -25,7 +25,7 @@
#include "torture/torture.h"
#include "auth/auth.h"
#include "lib/util/dlinklist.h"
-#include "lib/crypto/crypto.h"
+#include "../lib/crypto/crypto.h"
#include "system/time.h"
#include "torture/rpc/rpc.h"
#include "auth/gensec/schannel_proto.h"
diff --git a/source4/torture/rpc/testjoin.c b/source4/torture/rpc/testjoin.c
index 2af8c4f872..3408a1924c 100644
--- a/source4/torture/rpc/testjoin.c
+++ b/source4/torture/rpc/testjoin.c
@@ -27,7 +27,7 @@
#include "includes.h"
#include "torture/torture.h"
#include "system/time.h"
-#include "lib/crypto/crypto.h"
+#include "../lib/crypto/crypto.h"
#include "libnet/libnet.h"
#include "lib/cmdline/popt_common.h"
#include "lib/ldb/include/ldb.h"
@@ -472,6 +472,7 @@ static NTSTATUS torture_leave_ads_domain(struct torture_context *torture,
}
ldb_set_opaque(ldb_ctx, "credentials", cmdline_credentials);
+ ldb_set_opaque(ldb_ctx, "loadparm", cmdline_lp_ctx);
rtn = ldb_connect(ldb_ctx, remote_ldb_url, 0, NULL);
if (rtn != 0) {
diff --git a/source4/torture/rpc/winreg.c b/source4/torture/rpc/winreg.c
index 8b602ef652..898813f807 100644
--- a/source4/torture/rpc/winreg.c
+++ b/source4/torture/rpc/winreg.c
@@ -80,6 +80,7 @@ static bool test_NotifyChangeKeyValue(struct dcerpc_pipe *p,
{
struct winreg_NotifyChangeKeyValue r;
+ ZERO_STRUCT(r);
r.in.handle = handle;
r.in.watch_subtree = true;
r.in.notify_filter = 0;
@@ -109,6 +110,7 @@ static bool test_CreateKey(struct dcerpc_pipe *p, struct torture_context *tctx,
struct policy_handle newhandle;
enum winreg_CreateAction action_taken = 0;
+ ZERO_STRUCT(r);
r.in.handle = handle;
r.out.new_handle = &newhandle;
init_winreg_String(&r.in.name, name);
@@ -163,6 +165,7 @@ static bool test_CreateKey_sd(struct dcerpc_pipe *p,
secbuf.length = sdblob.length-10;
secbuf.inherit = 0;
+ ZERO_STRUCT(r);
r.in.handle = handle;
r.out.new_handle = newhandle;
init_winreg_String(&r.in.name, name);
@@ -317,6 +320,7 @@ static bool test_CloseKey(struct dcerpc_pipe *p, struct torture_context *tctx,
{
struct winreg_CloseKey r;
+ ZERO_STRUCT(r);
r.in.handle = r.out.handle = handle;
torture_assert_ntstatus_ok(tctx, dcerpc_winreg_CloseKey(p, tctx, &r),
@@ -332,6 +336,7 @@ static bool test_FlushKey(struct dcerpc_pipe *p, struct torture_context *tctx,
{
struct winreg_FlushKey r;
+ ZERO_STRUCT(r);
r.in.handle = handle;
torture_assert_ntstatus_ok(tctx, dcerpc_winreg_FlushKey(p, tctx, &r),
@@ -351,6 +356,7 @@ static bool _test_OpenKey(struct dcerpc_pipe *p, struct torture_context *tctx,
{
struct winreg_OpenKey r;
+ ZERO_STRUCT(r);
r.in.parent_handle = hive_handle;
init_winreg_String(&r.in.keyname, keyname);
r.in.unknown = 0x00000000;
@@ -384,6 +390,7 @@ static bool test_Cleanup(struct dcerpc_pipe *p, struct torture_context *tctx,
{
struct winreg_DeleteKey r;
+ ZERO_STRUCT(r);
r.in.handle = handle;
init_winreg_String(&r.in.key, key);
@@ -1435,6 +1442,7 @@ static bool test_EnumKey(struct dcerpc_pipe *p, struct torture_context *tctx,
class.name = "";
class.size = 1024;
+ ZERO_STRUCT(r);
r.in.handle = handle;
r.in.enum_index = 0;
r.in.name = &name;
@@ -1486,6 +1494,7 @@ static bool test_QueryMultipleValues(struct dcerpc_pipe *p,
NTSTATUS status;
uint32_t bufsize=0;
+ ZERO_STRUCT(r);
r.in.key_handle = handle;
r.in.values = r.out.values = talloc_array(tctx, struct QueryMultipleValue, 1);
r.in.values[0].name = talloc(tctx, struct winreg_String);
@@ -1527,6 +1536,7 @@ static bool test_QueryValue(struct dcerpc_pipe *p,
uint32_t offered = 0xfff;
uint32_t zero = 0;
+ ZERO_STRUCT(r);
r.in.handle = handle;
r.in.data = NULL;
r.in.value_name.name = valuename;
@@ -1558,6 +1568,7 @@ static bool test_EnumValue(struct dcerpc_pipe *p, struct torture_context *tctx,
name.name = "";
name.size = 1024;
+ ZERO_STRUCT(r);
r.in.handle = handle;
r.in.enum_index = 0;
r.in.name = &name;
@@ -1594,6 +1605,7 @@ static bool test_AbortSystemShutdown(struct dcerpc_pipe *p,
struct winreg_AbortSystemShutdown r;
uint16_t server = 0x0;
+ ZERO_STRUCT(r);
r.in.server = &server;
torture_assert_ntstatus_ok(tctx,
@@ -1612,6 +1624,7 @@ static bool test_InitiateSystemShutdown(struct torture_context *tctx,
struct winreg_InitiateSystemShutdown r;
uint16_t hostname = 0x0;
+ ZERO_STRUCT(r);
r.in.hostname = &hostname;
r.in.message = talloc(tctx, struct lsa_StringLarge);
init_lsa_StringLarge(r.in.message, "spottyfood");
@@ -1636,6 +1649,7 @@ static bool test_InitiateSystemShutdownEx(struct torture_context *tctx,
struct winreg_InitiateSystemShutdownEx r;
uint16_t hostname = 0x0;
+ ZERO_STRUCT(r);
r.in.hostname = &hostname;
r.in.message = talloc(tctx, struct lsa_StringLarge);
init_lsa_StringLarge(r.in.message, "spottyfood");
@@ -1694,6 +1708,7 @@ static bool test_Open_Security(struct torture_context *tctx,
winreg_open_fn open_fn = userdata;
+ ZERO_STRUCT(r);
r.in.system_name = 0;
r.in.access_mask = SEC_FLAG_MAXIMUM_ALLOWED;
r.out.handle = &handle;
@@ -1767,6 +1782,7 @@ static bool test_Open(struct torture_context *tctx, struct dcerpc_pipe *p,
winreg_open_fn open_fn = userdata;
+ ZERO_STRUCT(r);
r.in.system_name = 0;
r.in.access_mask = SEC_FLAG_MAXIMUM_ALLOWED;
r.out.handle = &handle;
diff --git a/source4/torture/rpc/wkssvc.c b/source4/torture/rpc/wkssvc.c
index b212a44b33..6e9937086e 100644
--- a/source4/torture/rpc/wkssvc.c
+++ b/source4/torture/rpc/wkssvc.c
@@ -25,7 +25,7 @@
#include "torture/rpc/rpc.h"
#include "lib/cmdline/popt_common.h"
#include "param/param.h"
-#include "lib/crypto/crypto.h"
+#include "../lib/crypto/crypto.h"
#include "libcli/auth/libcli_auth.h"
#define SMBTORTURE_MACHINE_NAME "smbtrt_name"
diff --git a/source4/torture/smb2/create.c b/source4/torture/smb2/create.c
index 4d1b4a7ed0..124e244151 100644
--- a/source4/torture/smb2/create.c
+++ b/source4/torture/smb2/create.c
@@ -256,6 +256,13 @@ static bool test_create_gentest(struct torture_context *torture, struct smb2_tre
status = smb2_getinfo_file(tree, tmp_ctx, &q);
CHECK_STATUS(status, NT_STATUS_OK);
CHECK_EQUAL(q.access_information.out.access_flags, io.in.desired_access);
+
+ io.in.file_attributes = 0;
+ io.in.desired_access = 0;
+ io.in.query_maximal_access = false;
+ io.in.share_access = 0;
+ status = smb2_create(tree, tmp_ctx, &io);
+ CHECK_STATUS(status, NT_STATUS_ACCESS_DENIED);
talloc_free(tmp_ctx);
diff --git a/source4/torture/unix/unix_info2.c b/source4/torture/unix/unix_info2.c
index d7482ddcf1..3bddde2a97 100644
--- a/source4/torture/unix/unix_info2.c
+++ b/source4/torture/unix/unix_info2.c
@@ -56,15 +56,17 @@ static struct smbcli_state *connect_to_server(struct torture_context *tctx)
const char *host = torture_setting_string(tctx, "host", NULL);
const char *share = torture_setting_string(tctx, "share", NULL);
struct smbcli_options options;
+ struct smbcli_session_options session_options;
lp_smbcli_options(tctx->lp_ctx, &options);
+ lp_smbcli_session_options(tctx->lp_ctx, &session_options);
status = smbcli_full_connection(tctx, &cli, host,
lp_smb_ports(tctx->lp_ctx),
share, NULL,
cmdline_credentials,
lp_resolve_context(tctx->lp_ctx),
- tctx->ev, &options);
+ tctx->ev, &options, &session_options);
if (!NT_STATUS_IS_OK(status)) {
printf("failed to connect to //%s/%s: %s\n",
diff --git a/source4/torture/unix/whoami.c b/source4/torture/unix/whoami.c
index 39d0a12ab1..d742e23e82 100644
--- a/source4/torture/unix/whoami.c
+++ b/source4/torture/unix/whoami.c
@@ -77,14 +77,16 @@ static struct smbcli_state *connect_to_server(struct torture_context *tctx,
const char *host = torture_setting_string(tctx, "host", NULL);
const char *share = torture_setting_string(tctx, "share", NULL);
struct smbcli_options options;
+ struct smbcli_session_options session_options;
lp_smbcli_options(tctx->lp_ctx, &options);
+ lp_smbcli_session_options(tctx->lp_ctx, &session_options);
status = smbcli_full_connection(tctx, &cli, host,
lp_smb_ports(tctx->lp_ctx),
share, NULL,
creds, lp_resolve_context(tctx->lp_ctx),
- tctx->ev, &options);
+ tctx->ev, &options, &session_options);
if (!NT_STATUS_IS_OK(status)) {
printf("failed to connect to //%s/%s: %s\n",
diff --git a/source4/torture/util_smb.c b/source4/torture/util_smb.c
index 938e7d6c03..32e4453aca 100644
--- a/source4/torture/util_smb.c
+++ b/source4/torture/util_smb.c
@@ -475,8 +475,10 @@ _PUBLIC_ bool torture_open_connection_share(TALLOC_CTX *mem_ctx,
NTSTATUS status;
struct smbcli_options options;
+ struct smbcli_session_options session_options;
lp_smbcli_options(tctx->lp_ctx, &options);
+ lp_smbcli_session_options(tctx->lp_ctx, &session_options);
options.use_oplocks = torture_setting_bool(tctx, "use_oplocks", true);
options.use_level2_oplocks = torture_setting_bool(tctx, "use_level2_oplocks", true);
@@ -486,7 +488,7 @@ _PUBLIC_ bool torture_open_connection_share(TALLOC_CTX *mem_ctx,
sharename, NULL,
cmdline_credentials,
lp_resolve_context(tctx->lp_ctx),
- ev, &options);
+ ev, &options, &session_options);
if (!NT_STATUS_IS_OK(status)) {
printf("Failed to open connection - %s\n", nt_errstr(status));
return false;