mirror of
https://github.com/samba-team/samba.git
synced 2024-12-22 13:34:15 +03:00
s4-torture: fixed a fd/mem leak in the RPC-LSA-SECRETS test
This test left a large number of lsa pipes open, which could trigger the server running out of fds
This commit is contained in:
parent
a1135b28dc
commit
2ff2c421d0
@ -148,6 +148,7 @@ static bool test_secrets(struct torture_context *torture, const void *_data)
|
||||
struct dcerpc_binding *binding;
|
||||
const struct secret_settings *settings =
|
||||
(const struct secret_settings *)_data;
|
||||
NTSTATUS status;
|
||||
|
||||
lp_set_cmdline(torture->lp_ctx, "ntlmssp client:keyexchange", settings->keyexchange?"True":"False");
|
||||
lp_set_cmdline(torture->lp_ctx, "ntlmssp_client:ntlm2", settings->ntlm2?"True":"False");
|
||||
@ -158,24 +159,28 @@ static bool test_secrets(struct torture_context *torture, const void *_data)
|
||||
|
||||
binding->flags |= settings->bindoptions;
|
||||
|
||||
torture_assert_ntstatus_ok(torture,
|
||||
dcerpc_pipe_connect_b(torture, &p, binding,
|
||||
&ndr_table_lsarpc,
|
||||
cmdline_credentials,
|
||||
torture->ev,
|
||||
torture->lp_ctx),
|
||||
"connect");
|
||||
status = dcerpc_pipe_connect_b(torture, &p, binding,
|
||||
&ndr_table_lsarpc,
|
||||
cmdline_credentials,
|
||||
torture->ev,
|
||||
torture->lp_ctx);
|
||||
|
||||
torture_assert_ntstatus_ok(torture, status, "connect");
|
||||
|
||||
if (!test_lsa_OpenPolicy2(p, torture, &handle)) {
|
||||
talloc_free(p);
|
||||
return false;
|
||||
}
|
||||
|
||||
torture_assert(torture, handle, "OpenPolicy2 failed. This test cannot run against this server");
|
||||
|
||||
if (!test_CreateSecret_basic(p, torture, handle)) {
|
||||
talloc_free(p);
|
||||
return false;
|
||||
}
|
||||
|
||||
talloc_free(p);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user