From 9038f2a0fd87075cf2125b1444e2669125bc72ea Mon Sep 17 00:00:00 2001 From: Matthias Dieter Wallnöfer Date: Mon, 15 Sep 2008 21:09:32 +0200 Subject: Torture suite: Fixes the tests to not segfault again SAMBA 4 registry server --- source4/torture/rpc/samba3rpc.c | 13 +++++++++++++ source4/torture/rpc/winreg.c | 19 +++++++++++++++++++ 2 files changed, 32 insertions(+) (limited to 'source4/torture') diff --git a/source4/torture/rpc/samba3rpc.c b/source4/torture/rpc/samba3rpc.c index 17342f9b86..7017233cab 100644 --- a/source4/torture/rpc/samba3rpc.c +++ b/source4/torture/rpc/samba3rpc.c @@ -2897,6 +2897,7 @@ static NTSTATUS enumvalues(struct dcerpc_pipe *p, struct policy_handle *handle, r.in.handle = handle; r.in.enum_index = enum_index; name.name = ""; + name.length = 0; name.size = 1024; r.in.name = r.out.name = &name; size = 1024; @@ -2927,6 +2928,7 @@ static NTSTATUS enumkeys(struct dcerpc_pipe *p, struct policy_handle *handle, } class.name = ""; + class.length = 0; class.size = 1024; r.in.handle = handle; @@ -2947,6 +2949,7 @@ static NTSTATUS enumkeys(struct dcerpc_pipe *p, struct policy_handle *handle, } name.name = NULL; + name.length = 0; name.size = 1024; status = dcerpc_winreg_EnumKey(p, tmp_ctx, &r); @@ -2963,6 +2966,8 @@ static NTSTATUS enumkeys(struct dcerpc_pipe *p, struct policy_handle *handle, o.in.parent_handle = handle; o.in.keyname.name = r.out.name->name; + o.in.keyname.name_len = strlen(o.in.keyname.name); + o.in.keyname.name_size = 1024; o.in.unknown = 0; o.in.access_mask = SEC_FLAG_MAXIMUM_ALLOWED; o.out.handle = &key_handle; @@ -3215,6 +3220,8 @@ static NTSTATUS torture_samba3_createshare(struct smbcli_state *cli, goto fail; } c.in.keyclass.name = ""; + c.in.keyclass.name_len = 0; + c.in.keyclass.name_size = 1024; c.in.options = 0; c.in.access_mask = SEC_FLAG_MAXIMUM_ALLOWED; c.in.secdesc = NULL; @@ -3272,6 +3279,8 @@ static NTSTATUS torture_samba3_deleteshare(struct torture_context *torture, status = NT_STATUS_NO_MEMORY; goto fail; } + d.in.key.name_len = strlen(d.in.key.name); + d.in.key.name_size = 1024; status = dcerpc_winreg_DeleteKey(p, p, &d); if (!NT_STATUS_IS_OK(status) || !W_ERROR_IS_OK(d.out.result)) { d_printf("(%s) OpenKey failed: %s, %s\n", __location__, @@ -3312,6 +3321,8 @@ static NTSTATUS torture_samba3_setconfig(struct smbcli_state *cli, status = NT_STATUS_NO_MEMORY; goto done; } + o.in.keyname.name_len = strlen(o.in.keyname.name); + o.in.keyname.name_size = 1024; o.in.unknown = 0; o.in.access_mask = SEC_FLAG_MAXIMUM_ALLOWED; o.out.handle = &key_handle; @@ -3331,6 +3342,8 @@ static NTSTATUS torture_samba3_setconfig(struct smbcli_state *cli, s.in.handle = &key_handle; s.in.name.name = parameter; + s.in.name.name_len = strlen(s.in.name.name); + s.in.name.name_size = 1024; s.in.type = type; s.in.data = val.data; s.in.size = val.length; diff --git a/source4/torture/rpc/winreg.c b/source4/torture/rpc/winreg.c index 8b602ef652..eb439bd5f6 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); @@ -1433,8 +1440,10 @@ static bool test_EnumKey(struct dcerpc_pipe *p, struct torture_context *tctx, NTTIME t = 0; class.name = ""; + class.length = 0; class.size = 1024; + ZERO_STRUCT(r); r.in.handle = handle; r.in.enum_index = 0; r.in.name = &name; @@ -1444,6 +1453,7 @@ static bool test_EnumKey(struct dcerpc_pipe *p, struct torture_context *tctx, do { name.name = NULL; + name.length = 0; name.size = 1024; status = dcerpc_winreg_EnumKey(p, tctx, &r); @@ -1486,6 +1496,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 +1538,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; @@ -1556,8 +1568,10 @@ static bool test_EnumValue(struct dcerpc_pipe *p, struct torture_context *tctx, struct winreg_StringBuf name; name.name = ""; + name.length = 0; name.size = 1024; + ZERO_STRUCT(r); r.in.handle = handle; r.in.enum_index = 0; r.in.name = &name; @@ -1594,6 +1608,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 +1627,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 +1652,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 +1711,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 +1785,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; -- cgit From 89b23974d3efa3d8a1e97cf49c2f949d3fa52ffa Mon Sep 17 00:00:00 2001 From: Matthias Dieter Wallnöfer Date: Fri, 19 Sep 2008 16:03:20 +0200 Subject: Torture suite: Revert some changes because they aren't necessary This reverts some changes made by me because they aren't necessary. The "ZERO_STRUCT"'s remain in. --- source4/torture/rpc/samba3rpc.c | 13 ------------- source4/torture/rpc/winreg.c | 3 --- 2 files changed, 16 deletions(-) (limited to 'source4/torture') diff --git a/source4/torture/rpc/samba3rpc.c b/source4/torture/rpc/samba3rpc.c index 7017233cab..17342f9b86 100644 --- a/source4/torture/rpc/samba3rpc.c +++ b/source4/torture/rpc/samba3rpc.c @@ -2897,7 +2897,6 @@ static NTSTATUS enumvalues(struct dcerpc_pipe *p, struct policy_handle *handle, r.in.handle = handle; r.in.enum_index = enum_index; name.name = ""; - name.length = 0; name.size = 1024; r.in.name = r.out.name = &name; size = 1024; @@ -2928,7 +2927,6 @@ static NTSTATUS enumkeys(struct dcerpc_pipe *p, struct policy_handle *handle, } class.name = ""; - class.length = 0; class.size = 1024; r.in.handle = handle; @@ -2949,7 +2947,6 @@ static NTSTATUS enumkeys(struct dcerpc_pipe *p, struct policy_handle *handle, } name.name = NULL; - name.length = 0; name.size = 1024; status = dcerpc_winreg_EnumKey(p, tmp_ctx, &r); @@ -2966,8 +2963,6 @@ static NTSTATUS enumkeys(struct dcerpc_pipe *p, struct policy_handle *handle, o.in.parent_handle = handle; o.in.keyname.name = r.out.name->name; - o.in.keyname.name_len = strlen(o.in.keyname.name); - o.in.keyname.name_size = 1024; o.in.unknown = 0; o.in.access_mask = SEC_FLAG_MAXIMUM_ALLOWED; o.out.handle = &key_handle; @@ -3220,8 +3215,6 @@ static NTSTATUS torture_samba3_createshare(struct smbcli_state *cli, goto fail; } c.in.keyclass.name = ""; - c.in.keyclass.name_len = 0; - c.in.keyclass.name_size = 1024; c.in.options = 0; c.in.access_mask = SEC_FLAG_MAXIMUM_ALLOWED; c.in.secdesc = NULL; @@ -3279,8 +3272,6 @@ static NTSTATUS torture_samba3_deleteshare(struct torture_context *torture, status = NT_STATUS_NO_MEMORY; goto fail; } - d.in.key.name_len = strlen(d.in.key.name); - d.in.key.name_size = 1024; status = dcerpc_winreg_DeleteKey(p, p, &d); if (!NT_STATUS_IS_OK(status) || !W_ERROR_IS_OK(d.out.result)) { d_printf("(%s) OpenKey failed: %s, %s\n", __location__, @@ -3321,8 +3312,6 @@ static NTSTATUS torture_samba3_setconfig(struct smbcli_state *cli, status = NT_STATUS_NO_MEMORY; goto done; } - o.in.keyname.name_len = strlen(o.in.keyname.name); - o.in.keyname.name_size = 1024; o.in.unknown = 0; o.in.access_mask = SEC_FLAG_MAXIMUM_ALLOWED; o.out.handle = &key_handle; @@ -3342,8 +3331,6 @@ static NTSTATUS torture_samba3_setconfig(struct smbcli_state *cli, s.in.handle = &key_handle; s.in.name.name = parameter; - s.in.name.name_len = strlen(s.in.name.name); - s.in.name.name_size = 1024; s.in.type = type; s.in.data = val.data; s.in.size = val.length; diff --git a/source4/torture/rpc/winreg.c b/source4/torture/rpc/winreg.c index eb439bd5f6..898813f807 100644 --- a/source4/torture/rpc/winreg.c +++ b/source4/torture/rpc/winreg.c @@ -1440,7 +1440,6 @@ static bool test_EnumKey(struct dcerpc_pipe *p, struct torture_context *tctx, NTTIME t = 0; class.name = ""; - class.length = 0; class.size = 1024; ZERO_STRUCT(r); @@ -1453,7 +1452,6 @@ static bool test_EnumKey(struct dcerpc_pipe *p, struct torture_context *tctx, do { name.name = NULL; - name.length = 0; name.size = 1024; status = dcerpc_winreg_EnumKey(p, tctx, &r); @@ -1568,7 +1566,6 @@ static bool test_EnumValue(struct dcerpc_pipe *p, struct torture_context *tctx, struct winreg_StringBuf name; name.name = ""; - name.length = 0; name.size = 1024; ZERO_STRUCT(r); -- cgit From cebd9a9013a76073c3035b74175d228116fc7e48 Mon Sep 17 00:00:00 2001 From: Andrew Bartlett Date: Mon, 22 Sep 2008 14:23:22 -0700 Subject: This torture test and skipping of the server-side check was bogus. The IDL is declared to force the MessageType to 3 on output, so we instead checked the same thing 255 times... Andrew Bartlett --- source4/torture/rpc/remote_pac.c | 49 ---------------------------------------- 1 file changed, 49 deletions(-) (limited to 'source4/torture') diff --git a/source4/torture/rpc/remote_pac.c b/source4/torture/rpc/remote_pac.c index 6419e40014..b32881cc69 100644 --- a/source4/torture/rpc/remote_pac.c +++ b/source4/torture/rpc/remote_pac.c @@ -137,7 +137,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 +206,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 +226,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 +271,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; -- cgit From 7831169af5a909b614c8e34ef505f3565b4e2a0a Mon Sep 17 00:00:00 2001 From: Andrew Bartlett Date: Mon, 22 Sep 2008 15:37:16 -0700 Subject: Test re-setting the challenge after an auth3 in RPC-NETLOGON --- source4/torture/rpc/netlogon.c | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'source4/torture') diff --git a/source4/torture/rpc/netlogon.c b/source4/torture/rpc/netlogon.c index 5ec2c29a20..2522062696 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; -- cgit From aaa45c832596d8f1b75f09f1de8fbee7483f6977 Mon Sep 17 00:00:00 2001 From: Andrew Bartlett Date: Mon, 22 Sep 2008 17:24:57 -0700 Subject: Remove unused variable --- source4/torture/rpc/remote_pac.c | 2 -- 1 file changed, 2 deletions(-) (limited to 'source4/torture') diff --git a/source4/torture/rpc/remote_pac.c b/source4/torture/rpc/remote_pac.c index b32881cc69..25368d239a 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, -- cgit From 13a3971438fb12d60aa0eaf88d22019a5e4f67cd Mon Sep 17 00:00:00 2001 From: Günther Deschner Date: Tue, 23 Sep 2008 09:02:16 +0200 Subject: s4-nbt: use private_data instead of private. Guenther --- source4/torture/nbt/query.c | 4 ++-- source4/torture/nbt/winsbench.c | 12 ++++++------ source4/torture/nbt/winsreplication.c | 6 +++--- 3 files changed, 11 insertions(+), 11 deletions(-) (limited to 'source4/torture') 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; -- cgit From a1a92688ba0a811400b4d12920988c62fa0efdf4 Mon Sep 17 00:00:00 2001 From: Günther Deschner Date: Tue, 23 Sep 2008 08:06:33 +0200 Subject: s4-nbt: use ../libcli/nbt Guenther --- source4/torture/nbt/nbt.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'source4/torture') 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" -- cgit From 70b0c8f79a427a3227ce01bc930870771076bff7 Mon Sep 17 00:00:00 2001 From: Stefan Metzmacher Date: Tue, 23 Sep 2008 02:14:26 +0200 Subject: RPC-PAC: loop in gensec_update() untill the server side is ready metze --- source4/torture/rpc/remote_pac.c | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) (limited to 'source4/torture') diff --git a/source4/torture/rpc/remote_pac.c b/source4/torture/rpc/remote_pac.c index 25368d239a..a4111d1c3e 100644 --- a/source4/torture/rpc/remote_pac.c +++ b/source4/torture/rpc/remote_pac.c @@ -116,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); -- cgit