summaryrefslogtreecommitdiff
path: root/source3/rpcclient
diff options
context:
space:
mode:
authorVolker Lendecke <vl@samba.org>2019-09-27 19:24:18 -0700
committerJeremy Allison <jra@samba.org>2019-10-03 17:59:13 +0000
commitfe41238097f4354f18130c43ea3c5db0293097c7 (patch)
tree3c281192b244f33d6de806aadf248e1dc0d3e5a5 /source3/rpcclient
parent8a094672212eb49291ff6c8c9441a0a6c71c1561 (diff)
downloadsamba-fe41238097f4354f18130c43ea3c5db0293097c7.tar.gz
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
Diffstat (limited to 'source3/rpcclient')
-rw-r--r--source3/rpcclient/rpcclient.c72
1 files changed, 0 insertions, 72 deletions
diff --git a/source3/rpcclient/rpcclient.c b/source3/rpcclient/rpcclient.c
index 0ef41433314..9d4f16531c2 100644
--- a/source3/rpcclient/rpcclient.c
+++ b/source3/rpcclient/rpcclient.c
@@ -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;