summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGünther Deschner <gd@samba.org>2010-03-11 23:15:14 +0100
committerGünther Deschner <gd@samba.org>2010-03-11 23:25:04 +0100
commit98ba174fa2bd174de58b9c97ba16627ff77374e8 (patch)
treea8326d2cd50a27dd3d2ecc321dc8131574535f7f
parent222b955237ed2a0d838738b4bacffc1106af2dc3 (diff)
downloadsamba-98ba174fa2bd174de58b9c97ba16627ff77374e8.tar.gz
samba-98ba174fa2bd174de58b9c97ba16627ff77374e8.tar.bz2
samba-98ba174fa2bd174de58b9c97ba16627ff77374e8.zip
s4-smbtorture: add netr_SamLogon test with NULL domain to RPC-NETLOGON-S3.
This is to demonstrate how a "Windows 2002 Service Pack 3 2600" box constantly crashes smbd (in preparation of fixing bug #7237). Guenther
-rw-r--r--source4/torture/rpc/netlogon.c34
1 files changed, 30 insertions, 4 deletions
diff --git a/source4/torture/rpc/netlogon.c b/source4/torture/rpc/netlogon.c
index c2ff86d877..dd23c6eab0 100644
--- a/source4/torture/rpc/netlogon.c
+++ b/source4/torture/rpc/netlogon.c
@@ -660,9 +660,10 @@ static bool test_GetTrustPasswords(struct torture_context *tctx,
/*
try a netlogon SamLogon
*/
-bool test_netlogon_ops(struct dcerpc_pipe *p, struct torture_context *tctx,
- struct cli_credentials *credentials,
- struct netlogon_creds_CredentialState *creds)
+static bool test_netlogon_ops_args(struct dcerpc_pipe *p, struct torture_context *tctx,
+ struct cli_credentials *credentials,
+ struct netlogon_creds_CredentialState *creds,
+ bool null_domain)
{
NTSTATUS status;
struct netr_LogonSamLogon r;
@@ -685,7 +686,11 @@ bool test_netlogon_ops(struct dcerpc_pipe *p, struct torture_context *tctx,
cli_credentials_get_ntlm_username_domain(cmdline_credentials, tctx,
&ninfo.identity_info.account_name.string,
&ninfo.identity_info.domain_name.string);
-
+
+ if (null_domain) {
+ ninfo.identity_info.domain_name.string = NULL;
+ }
+
generate_random_buffer(ninfo.challenge,
sizeof(ninfo.challenge));
chal = data_blob_const(ninfo.challenge,
@@ -757,6 +762,13 @@ bool test_netlogon_ops(struct dcerpc_pipe *p, struct torture_context *tctx,
return true;
}
+bool test_netlogon_ops(struct dcerpc_pipe *p, struct torture_context *tctx,
+ struct cli_credentials *credentials,
+ struct netlogon_creds_CredentialState *creds)
+{
+ return test_netlogon_ops_args(p, tctx, credentials, creds, false);
+}
+
/*
try a netlogon SamLogon
*/
@@ -773,6 +785,19 @@ static bool test_SamLogon(struct torture_context *tctx,
return test_netlogon_ops(p, tctx, credentials, creds);
}
+static bool test_SamLogon_NULL_domain(struct torture_context *tctx,
+ struct dcerpc_pipe *p,
+ struct cli_credentials *credentials)
+{
+ struct netlogon_creds_CredentialState *creds;
+
+ if (!test_SetupCredentials(p, tctx, credentials, &creds)) {
+ return false;
+ }
+
+ return test_netlogon_ops_args(p, tctx, credentials, creds, true);
+}
+
/* we remember the sequence numbers so we can easily do a DatabaseDelta */
static uint64_t sequence_nums[3];
@@ -2939,6 +2964,7 @@ struct torture_suite *torture_rpc_netlogon_s3(TALLOC_CTX *mem_ctx)
&ndr_table_netlogon, TEST_MACHINE_NAME);
torture_rpc_tcase_add_test_creds(tcase, "SamLogon", test_SamLogon);
+ torture_rpc_tcase_add_test_creds(tcase, "SamLogon_NULL_domain", test_SamLogon_NULL_domain);
torture_rpc_tcase_add_test_creds(tcase, "SetPassword", test_SetPassword);
torture_rpc_tcase_add_test_creds(tcase, "SetPassword_with_flags", test_SetPassword_with_flags);
torture_rpc_tcase_add_test_creds(tcase, "SetPassword2", test_SetPassword2);