mirror of
https://github.com/samba-team/samba.git
synced 2024-12-23 17:34:34 +03:00
rpcclient: Remove unused global domain sid
For the auth_log tests using rpcclient this means one message less Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org> Autobuild-User(master): Jeremy Allison <jra@samba.org> Autobuild-Date(master): Thu Oct 3 17:59:13 UTC 2019 on sn-devel-184
This commit is contained in:
parent
8a09467221
commit
fe41238097
@ -1129,7 +1129,7 @@ class AuthLogTests(samba.tests.auth_log_base.AuthLogTestBase):
|
||||
messages = self.remove_netlogon_messages(messages)
|
||||
received = len(messages)
|
||||
self.assertIs(True,
|
||||
(received == 5 or received == 6),
|
||||
(received == 4 or received == 5),
|
||||
"Did not receive the expected number of messages")
|
||||
|
||||
def test_samlogon_interactive_bad_password(self):
|
||||
@ -1162,7 +1162,7 @@ class AuthLogTests(samba.tests.auth_log_base.AuthLogTestBase):
|
||||
messages = self.remove_netlogon_messages(messages)
|
||||
received = len(messages)
|
||||
self.assertIs(True,
|
||||
(received == 5 or received == 6),
|
||||
(received == 4 or received == 5),
|
||||
"Did not receive the expected number of messages")
|
||||
|
||||
def test_samlogon_interactive_bad_user(self):
|
||||
@ -1195,7 +1195,7 @@ class AuthLogTests(samba.tests.auth_log_base.AuthLogTestBase):
|
||||
messages = self.remove_netlogon_messages(messages)
|
||||
received = len(messages)
|
||||
self.assertIs(True,
|
||||
(received == 5 or received == 6),
|
||||
(received == 4 or received == 5),
|
||||
"Did not receive the expected number of messages")
|
||||
|
||||
def test_samlogon_network(self):
|
||||
@ -1226,7 +1226,7 @@ class AuthLogTests(samba.tests.auth_log_base.AuthLogTestBase):
|
||||
messages = self.remove_netlogon_messages(messages)
|
||||
received = len(messages)
|
||||
self.assertIs(True,
|
||||
(received == 5 or received == 6),
|
||||
(received == 4 or received == 5),
|
||||
"Did not receive the expected number of messages")
|
||||
|
||||
def test_samlogon_network_bad_password(self):
|
||||
@ -1258,7 +1258,7 @@ class AuthLogTests(samba.tests.auth_log_base.AuthLogTestBase):
|
||||
messages = self.remove_netlogon_messages(messages)
|
||||
received = len(messages)
|
||||
self.assertIs(True,
|
||||
(received == 5 or received == 6),
|
||||
(received == 4 or received == 5),
|
||||
"Did not receive the expected number of messages")
|
||||
|
||||
def test_samlogon_network_bad_user(self):
|
||||
@ -1290,7 +1290,7 @@ class AuthLogTests(samba.tests.auth_log_base.AuthLogTestBase):
|
||||
messages = self.remove_netlogon_messages(messages)
|
||||
received = len(messages)
|
||||
self.assertIs(True,
|
||||
(received == 5 or received == 6),
|
||||
(received == 4 or received == 5),
|
||||
"Did not receive the expected number of messages")
|
||||
|
||||
def test_samlogon_network_mschap(self):
|
||||
@ -1323,7 +1323,7 @@ class AuthLogTests(samba.tests.auth_log_base.AuthLogTestBase):
|
||||
messages = self.remove_netlogon_messages(messages)
|
||||
received = len(messages)
|
||||
self.assertIs(True,
|
||||
(received == 5 or received == 6),
|
||||
(received == 4 or received == 5),
|
||||
"Did not receive the expected number of messages")
|
||||
|
||||
def test_samlogon_network_mschap_bad_password(self):
|
||||
@ -1357,7 +1357,7 @@ class AuthLogTests(samba.tests.auth_log_base.AuthLogTestBase):
|
||||
messages = self.remove_netlogon_messages(messages)
|
||||
received = len(messages)
|
||||
self.assertIs(True,
|
||||
(received == 5 or received == 6),
|
||||
(received == 4 or received == 5),
|
||||
"Did not receive the expected number of messages")
|
||||
|
||||
def test_samlogon_network_mschap_bad_user(self):
|
||||
@ -1391,7 +1391,7 @@ class AuthLogTests(samba.tests.auth_log_base.AuthLogTestBase):
|
||||
messages = self.remove_netlogon_messages(messages)
|
||||
received = len(messages)
|
||||
self.assertIs(True,
|
||||
(received == 5 or received == 6),
|
||||
(received == 4 or received == 5),
|
||||
"Did not receive the expected number of messages")
|
||||
|
||||
def test_samlogon_schannel_seal(self):
|
||||
@ -1422,7 +1422,7 @@ class AuthLogTests(samba.tests.auth_log_base.AuthLogTestBase):
|
||||
messages = self.remove_netlogon_messages(messages)
|
||||
received = len(messages)
|
||||
self.assertIs(True,
|
||||
(received == 5 or received == 6),
|
||||
(received == 4 or received == 5),
|
||||
"Did not receive the expected number of messages")
|
||||
|
||||
# Check the second to last message it should be an Authorization
|
||||
@ -1465,7 +1465,7 @@ class AuthLogTests(samba.tests.auth_log_base.AuthLogTestBase):
|
||||
messages = self.remove_netlogon_messages(messages)
|
||||
received = len(messages)
|
||||
self.assertIs(True,
|
||||
(received == 5 or received == 6),
|
||||
(received == 4 or received == 5),
|
||||
"Did not receive the expected number of messages")
|
||||
|
||||
# Check the second to last message it should be an Authorization
|
||||
|
@ -44,8 +44,6 @@ enum pipe_auth_type_spnego {
|
||||
PIPE_AUTH_TYPE_SPNEGO_KRB5
|
||||
};
|
||||
|
||||
struct dom_sid domain_sid;
|
||||
|
||||
static enum dcerpc_AuthType pipe_default_auth_type = DCERPC_AUTH_TYPE_NONE;
|
||||
static enum pipe_auth_type_spnego pipe_default_auth_spnego_type = 0;
|
||||
static enum dcerpc_AuthLevel pipe_default_auth_level = DCERPC_AUTH_LEVEL_NONE;
|
||||
@ -154,74 +152,6 @@ static char *next_command (char **cmdstr)
|
||||
return command;
|
||||
}
|
||||
|
||||
/* Fetch the SID for this computer */
|
||||
|
||||
static void fetch_machine_sid(struct cli_state *cli)
|
||||
{
|
||||
struct policy_handle pol;
|
||||
NTSTATUS result = NT_STATUS_OK, status;
|
||||
static bool got_domain_sid;
|
||||
TALLOC_CTX *mem_ctx;
|
||||
struct rpc_pipe_client *lsapipe = NULL;
|
||||
union lsa_PolicyInformation *info = NULL;
|
||||
struct dcerpc_binding_handle *b;
|
||||
|
||||
if (got_domain_sid) return;
|
||||
|
||||
if (!(mem_ctx=talloc_init("fetch_machine_sid"))) {
|
||||
DEBUG(0,("fetch_machine_sid: talloc_init returned NULL!\n"));
|
||||
goto error;
|
||||
}
|
||||
|
||||
result = cli_rpc_pipe_open_noauth(cli, &ndr_table_lsarpc,
|
||||
&lsapipe);
|
||||
if (!NT_STATUS_IS_OK(result)) {
|
||||
fprintf(stderr, "could not initialise lsa pipe. Error was %s\n", nt_errstr(result) );
|
||||
goto error;
|
||||
}
|
||||
|
||||
b = lsapipe->binding_handle;
|
||||
|
||||
result = rpccli_lsa_open_policy(lsapipe, mem_ctx, True,
|
||||
SEC_FLAG_MAXIMUM_ALLOWED,
|
||||
&pol);
|
||||
if (!NT_STATUS_IS_OK(result)) {
|
||||
goto error;
|
||||
}
|
||||
|
||||
status = dcerpc_lsa_QueryInfoPolicy(b, mem_ctx,
|
||||
&pol,
|
||||
LSA_POLICY_INFO_ACCOUNT_DOMAIN,
|
||||
&info,
|
||||
&result);
|
||||
if (!NT_STATUS_IS_OK(status)) {
|
||||
result = status;
|
||||
goto error;
|
||||
}
|
||||
if (!NT_STATUS_IS_OK(result)) {
|
||||
goto error;
|
||||
}
|
||||
|
||||
got_domain_sid = True;
|
||||
sid_copy(&domain_sid, info->account_domain.sid);
|
||||
|
||||
dcerpc_lsa_Close(b, mem_ctx, &pol, &result);
|
||||
TALLOC_FREE(lsapipe);
|
||||
talloc_destroy(mem_ctx);
|
||||
|
||||
return;
|
||||
|
||||
error:
|
||||
|
||||
if (lsapipe) {
|
||||
TALLOC_FREE(lsapipe);
|
||||
}
|
||||
|
||||
fprintf(stderr, "could not obtain sid from server\n");
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
/* List the available commands on a given pipe */
|
||||
|
||||
static NTSTATUS cmd_listcommands(struct rpc_pipe_client *cli, TALLOC_CTX *mem_ctx,
|
||||
@ -1330,8 +1260,6 @@ out_free:
|
||||
|
||||
default_transport = dcerpc_binding_get_transport(binding);
|
||||
|
||||
fetch_machine_sid(cli);
|
||||
|
||||
/* Do anything specified with -c */
|
||||
if (cmdstr && cmdstr[0]) {
|
||||
char *cmd;
|
||||
|
Loading…
Reference in New Issue
Block a user