summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--source3/client/client.c2
-rw-r--r--source3/include/client.h2
-rw-r--r--source3/lib/netapi/cm.c2
-rw-r--r--source3/libads/ldap_printer.c2
-rw-r--r--source3/libnet/libnet_join.c4
-rw-r--r--source3/libsmb/clientgen.c4
-rw-r--r--source3/libsmb/libsmb_dir.c2
-rw-r--r--source3/libsmb/trusts_util.c2
-rw-r--r--source3/rpc_client/cli_netlogon.c4
-rw-r--r--source3/rpc_client/cli_pipe.c40
-rw-r--r--source3/rpc_client/cli_spoolss.c16
-rw-r--r--source3/rpcclient/cmd_lsarpc.c2
-rw-r--r--source3/rpcclient/cmd_netlogon.c30
-rw-r--r--source3/rpcclient/cmd_spoolss.c76
-rw-r--r--source3/rpcclient/cmd_srvsvc.c28
-rw-r--r--source3/rpcclient/cmd_wkssvc.c12
-rw-r--r--source3/utils/net_rpc.c64
-rw-r--r--source3/utils/net_rpc_join.c2
-rw-r--r--source3/utils/net_rpc_printer.c3
-rw-r--r--source3/utils/net_rpc_samsync.c6
-rw-r--r--source3/utils/net_rpc_sh_acct.c2
-rw-r--r--source3/utils/smbtree.c2
-rw-r--r--source3/winbindd/winbindd_ads.c2
-rw-r--r--source3/winbindd/winbindd_cm.c8
24 files changed, 159 insertions, 158 deletions
diff --git a/source3/client/client.c b/source3/client/client.c
index 276ffb93d8..1c9c21e979 100644
--- a/source3/client/client.c
+++ b/source3/client/client.c
@@ -3650,7 +3650,7 @@ static bool browse_host_rpc(bool sort)
info_ctr.ctr.ctr1 = &ctr1;
status = rpccli_srvsvc_NetShareEnumAll(pipe_hnd, frame,
- pipe_hnd->cli->desthost,
+ pipe_hnd->desthost,
&info_ctr,
0xffffffff,
&total_entries,
diff --git a/source3/include/client.h b/source3/include/client.h
index 3c0b65576c..02575e4109 100644
--- a/source3/include/client.h
+++ b/source3/include/client.h
@@ -66,6 +66,8 @@ struct rpc_pipe_client {
const char *pipe_name;
uint16 fnum;
+ const char *desthost;
+
const char *domain;
const char *user_name;
struct pwd_info pwd;
diff --git a/source3/lib/netapi/cm.c b/source3/lib/netapi/cm.c
index 071ebfd4bc..5464237247 100644
--- a/source3/lib/netapi/cm.c
+++ b/source3/lib/netapi/cm.c
@@ -104,7 +104,7 @@ static struct rpc_pipe_client *pipe_cm_find(struct cli_state *cli,
return NULL;
}
- if (strequal(cli->desthost, p->pipe->cli->desthost) &&
+ if (strequal(cli->desthost, p->pipe->desthost) &&
pipe_idx == p->pipe->pipe_idx) {
*status = NT_STATUS_OK;
return p->pipe;
diff --git a/source3/libads/ldap_printer.c b/source3/libads/ldap_printer.c
index 05fbc071d8..e2396ce4cf 100644
--- a/source3/libads/ldap_printer.c
+++ b/source3/libads/ldap_printer.c
@@ -288,7 +288,7 @@ WERROR get_remote_printer_publishing_data(struct rpc_pipe_client *cli,
uint32 i;
POLICY_HND pol;
- asprintf(&servername, "\\\\%s", cli->cli->desthost);
+ asprintf(&servername, "\\\\%s", cli->desthost);
asprintf(&printername, "%s\\%s", servername, printer);
if (!servername || !printername) {
DEBUG(3, ("Insufficient memory\n"));
diff --git a/source3/libnet/libnet_join.c b/source3/libnet/libnet_join.c
index 16a7ea4566..207a3acfa8 100644
--- a/source3/libnet/libnet_join.c
+++ b/source3/libnet/libnet_join.c
@@ -755,7 +755,7 @@ static NTSTATUS libnet_join_joindomain_rpc(TALLOC_CTX *mem_ctx,
}
status = rpccli_samr_Connect2(pipe_hnd, mem_ctx,
- pipe_hnd->cli->desthost,
+ pipe_hnd->desthost,
SEC_RIGHTS_MAXIMUM_ALLOWED,
&sam_pol);
if (!NT_STATUS_IS_OK(status)) {
@@ -1137,7 +1137,7 @@ static NTSTATUS libnet_join_unjoindomain_rpc(TALLOC_CTX *mem_ctx,
}
status = rpccli_samr_Connect2(pipe_hnd, mem_ctx,
- pipe_hnd->cli->desthost,
+ pipe_hnd->desthost,
SEC_RIGHTS_MAXIMUM_ALLOWED,
&sam_pol);
if (!NT_STATUS_IS_OK(status)) {
diff --git a/source3/libsmb/clientgen.c b/source3/libsmb/clientgen.c
index 860cb948ac..ef2c2639cd 100644
--- a/source3/libsmb/clientgen.c
+++ b/source3/libsmb/clientgen.c
@@ -638,7 +638,7 @@ bool cli_rpc_pipe_close(struct rpc_pipe_client *cli)
"to machine %s. Error was %s\n",
cli->pipe_name,
(int) cli->fnum,
- cli->cli->desthost,
+ cli->desthost,
cli_errstr(cli->cli)));
}
@@ -647,7 +647,7 @@ bool cli_rpc_pipe_close(struct rpc_pipe_client *cli)
}
DEBUG(10,("cli_rpc_pipe_close: closed pipe %s to machine %s\n",
- cli->pipe_name, cli->cli->desthost ));
+ cli->pipe_name, cli->desthost ));
DLIST_REMOVE(cli->cli->pipe_list, cli);
talloc_destroy(cli);
diff --git a/source3/libsmb/libsmb_dir.c b/source3/libsmb/libsmb_dir.c
index f836989004..612a8772c0 100644
--- a/source3/libsmb/libsmb_dir.c
+++ b/source3/libsmb/libsmb_dir.c
@@ -287,7 +287,7 @@ net_share_enum_rpc(struct cli_state *cli,
/* Issue the NetShareEnum RPC call and retrieve the response */
nt_status = rpccli_srvsvc_NetShareEnumAll(pipe_hnd, talloc_tos(),
- pipe_hnd->cli->desthost,
+ pipe_hnd->desthost,
&info_ctr,
preferred_len,
&total_entries,
diff --git a/source3/libsmb/trusts_util.c b/source3/libsmb/trusts_util.c
index c3f5f2538a..20ac0143fd 100644
--- a/source3/libsmb/trusts_util.c
+++ b/source3/libsmb/trusts_util.c
@@ -43,7 +43,7 @@ static NTSTATUS just_change_the_password(struct rpc_pipe_client *cli, TALLOC_CTX
uint32_t neg_flags = NETLOGON_NEG_AUTH2_ADS_FLAGS;
result = rpccli_netlogon_setup_creds(cli,
- cli->cli->desthost, /* server name */
+ cli->desthost, /* server name */
lp_workgroup(), /* domain */
global_myname(), /* client name */
global_myname(), /* machine account name */
diff --git a/source3/rpc_client/cli_netlogon.c b/source3/rpc_client/cli_netlogon.c
index 478a855882..bf1e161957 100644
--- a/source3/rpc_client/cli_netlogon.c
+++ b/source3/rpc_client/cli_netlogon.c
@@ -212,13 +212,13 @@ NTSTATUS rpccli_netlogon_setup_creds(struct rpc_pipe_client *cli,
*/
DEBUG(0,("rpccli_netlogon_setup_creds: server %s "
"replied with bad credential\n",
- cli->cli->desthost ));
+ cli->desthost ));
return NT_STATUS_ACCESS_DENIED;
}
DEBUG(5,("rpccli_netlogon_setup_creds: server %s credential "
"chain established.\n",
- cli->cli->desthost ));
+ cli->desthost ));
return NT_STATUS_OK;
}
diff --git a/source3/rpc_client/cli_pipe.c b/source3/rpc_client/cli_pipe.c
index a94da8b79b..6465228f18 100644
--- a/source3/rpc_client/cli_pipe.c
+++ b/source3/rpc_client/cli_pipe.c
@@ -279,7 +279,7 @@ static NTSTATUS cli_pipe_verify_ntlmssp(struct rpc_pipe_client *cli, RPC_HDR *pr
DEBUG(0,("cli_pipe_verify_ntlmssp: failed to unseal "
"packet from remote machine %s on pipe %s "
"fnum 0x%x. Error was %s.\n",
- cli->cli->desthost,
+ cli->desthost,
cli->pipe_name,
(unsigned int)cli->fnum,
nt_errstr(status) ));
@@ -297,7 +297,7 @@ static NTSTATUS cli_pipe_verify_ntlmssp(struct rpc_pipe_client *cli, RPC_HDR *pr
DEBUG(0,("cli_pipe_verify_ntlmssp: check signing failed on "
"packet from remote machine %s on pipe %s "
"fnum 0x%x. Error was %s.\n",
- cli->cli->desthost,
+ cli->desthost,
cli->pipe_name,
(unsigned int)cli->fnum,
nt_errstr(status) ));
@@ -400,7 +400,7 @@ static NTSTATUS cli_pipe_verify_schannel(struct rpc_pipe_client *cli, RPC_HDR *p
DEBUG(3,("cli_pipe_verify_schannel: failed to decode PDU "
"Connection to remote machine %s "
"pipe %s fnum 0x%x.\n",
- cli->cli->desthost,
+ cli->desthost,
cli->pipe_name,
(unsigned int)cli->fnum ));
return NT_STATUS_INVALID_PARAMETER;
@@ -461,7 +461,7 @@ static NTSTATUS cli_pipe_validate_rpc_response(struct rpc_pipe_client *cli, RPC_
if (prhdr->auth_len) {
DEBUG(3, ("cli_pipe_validate_rpc_response: Connection to remote machine %s "
"pipe %s fnum 0x%x - got non-zero auth len %u.\n",
- cli->cli->desthost,
+ cli->desthost,
cli->pipe_name,
(unsigned int)cli->fnum,
(unsigned int)prhdr->auth_len ));
@@ -489,7 +489,7 @@ static NTSTATUS cli_pipe_validate_rpc_response(struct rpc_pipe_client *cli, RPC_
default:
DEBUG(3, ("cli_pipe_validate_rpc_response: Connection to remote machine %s "
"pipe %s fnum %x - unknown internal auth type %u.\n",
- cli->cli->desthost,
+ cli->desthost,
cli->pipe_name,
(unsigned int)cli->fnum,
cli->auth.auth_type ));
@@ -595,7 +595,7 @@ static NTSTATUS cli_pipe_validate_current_pdu(struct rpc_pipe_client *cli, RPC_H
case RPC_BINDNACK:
DEBUG(1, ("cli_pipe_validate_current_pdu: Bind NACK received from remote machine %s "
"pipe %s fnum 0x%x!\n",
- cli->cli->desthost,
+ cli->desthost,
cli->pipe_name,
(unsigned int)cli->fnum));
/* Use this for now... */
@@ -619,7 +619,7 @@ static NTSTATUS cli_pipe_validate_current_pdu(struct rpc_pipe_client *cli, RPC_H
DEBUG(1, ("cli_pipe_validate_current_pdu: RPC fault code %s received from remote machine %s "
"pipe %s fnum 0x%x!\n",
dcerpc_errstr(NT_STATUS_V(fault_resp.status)),
- cli->cli->desthost,
+ cli->desthost,
cli->pipe_name,
(unsigned int)cli->fnum));
if (NT_STATUS_IS_OK(fault_resp.status)) {
@@ -634,7 +634,7 @@ static NTSTATUS cli_pipe_validate_current_pdu(struct rpc_pipe_client *cli, RPC_H
DEBUG(0, ("cli_pipe_validate_current_pdu: unknown packet type %u received "
"from remote machine %s pipe %s fnum 0x%x!\n",
(unsigned int)prhdr->pkt_type,
- cli->cli->desthost,
+ cli->desthost,
cli->pipe_name,
(unsigned int)cli->fnum));
return NT_STATUS_INVALID_INFO_CLASS;
@@ -644,7 +644,7 @@ static NTSTATUS cli_pipe_validate_current_pdu(struct rpc_pipe_client *cli, RPC_H
DEBUG(3, ("cli_pipe_validate_current_pdu: Connection to remote machine %s "
"pipe %s fnum %x got an unexpected RPC packet "
"type - %u, not %u\n",
- cli->cli->desthost,
+ cli->desthost,
cli->pipe_name,
(unsigned int)cli->fnum,
prhdr->pkt_type,
@@ -764,7 +764,7 @@ static NTSTATUS rpc_api_pipe(struct rpc_pipe_client *cli,
setup[1] = cli->fnum; /* Pipe file handle. */
DEBUG(5,("rpc_api_pipe: Remote machine %s pipe %s fnum 0x%x\n",
- cli->cli->desthost,
+ cli->desthost,
cli->pipe_name,
(unsigned int)cli->fnum ));
@@ -783,7 +783,7 @@ static NTSTATUS rpc_api_pipe(struct rpc_pipe_client *cli,
{
DEBUG(0, ("rpc_api_pipe: Remote machine %s pipe %s fnum 0x%x "
"returned critical error. Error was %s\n",
- cli->cli->desthost,
+ cli->desthost,
cli->pipe_name,
(unsigned int)cli->fnum,
cli_errstr(cli->cli)));
@@ -800,7 +800,7 @@ static NTSTATUS rpc_api_pipe(struct rpc_pipe_client *cli,
if (prdata == NULL) {
DEBUG(3,("rpc_api_pipe: Remote machine %s pipe %s "
"fnum 0x%x failed to return data.\n",
- cli->cli->desthost,
+ cli->desthost,
cli->pipe_name,
(unsigned int)cli->fnum));
/* Yes - some calls can truely return no data... */
@@ -850,7 +850,7 @@ static NTSTATUS rpc_api_pipe(struct rpc_pipe_client *cli,
/* Set the data type correctly for big-endian data on the first packet. */
DEBUG(10,("rpc_api_pipe: On machine %s pipe %s fnum 0x%x "
"PDU data format is big-endian.\n",
- cli->cli->desthost,
+ cli->desthost,
cli->pipe_name,
(unsigned int)cli->fnum));
@@ -887,7 +887,7 @@ static NTSTATUS rpc_api_pipe(struct rpc_pipe_client *cli,
}
DEBUG(10,("rpc_api_pipe: Remote machine %s pipe %s fnum 0x%x returned %u bytes.\n",
- cli->cli->desthost,
+ cli->desthost,
cli->pipe_name,
(unsigned int)cli->fnum,
(unsigned int)prs_data_size(rbuf) ));
@@ -1840,7 +1840,7 @@ static NTSTATUS rpc_finish_auth3_bind(struct rpc_pipe_client *cli,
DEBUG(5,("rpc_send_auth_auth3: Remote machine %s pipe %s "
"fnum 0x%x sent auth3 response ok.\n",
- cli->cli->desthost,
+ cli->desthost,
cli->pipe_name,
(unsigned int)cli->fnum));
@@ -2018,7 +2018,7 @@ static NTSTATUS rpc_finish_spnego_ntlmssp_bind(struct rpc_pipe_client *cli,
DEBUG(5,("rpc_finish_spnego_ntlmssp_bind: alter context request to "
"remote machine %s pipe %s fnum 0x%x.\n",
- cli->cli->desthost,
+ cli->desthost,
cli->pipe_name,
(unsigned int)cli->fnum));
@@ -2081,7 +2081,7 @@ static NTSTATUS rpc_pipe_bind(struct rpc_pipe_client *cli,
DEBUG(3,("rpc_pipe_bind: Remote machine %s pipe %s "
"fnum 0x%x bind request returned ok.\n",
- cli->cli->desthost,
+ cli->desthost,
cli->pipe_name,
(unsigned int)cli->fnum));
@@ -2228,6 +2228,12 @@ static struct rpc_pipe_client *cli_rpc_pipe_open(struct cli_state *cli, int pipe
result->auth.auth_type = PIPE_AUTH_TYPE_NONE;
result->auth.auth_level = PIPE_AUTH_LEVEL_NONE;
+ result->desthost = talloc_strdup(result, cli->desthost);
+ if (result->desthost == NULL) {
+ TALLOC_FREE(result);
+ return NULL;
+ }
+
if (pipe_idx == PI_NETLOGON) {
/* Set up a netlogon credential chain for a netlogon pipe. */
result->dc = TALLOC_ZERO_P(result, struct dcinfo);
diff --git a/source3/rpc_client/cli_spoolss.c b/source3/rpc_client/cli_spoolss.c
index bbb29511ba..823af6fb4f 100644
--- a/source3/rpc_client/cli_spoolss.c
+++ b/source3/rpc_client/cli_spoolss.c
@@ -597,7 +597,7 @@ WERROR rpccli_spoolss_enum_ports(struct rpc_pipe_client *cli, TALLOC_CTX *mem_ct
ZERO_STRUCT(in);
ZERO_STRUCT(out);
- slprintf(server, sizeof(fstring)-1, "\\\\%s", cli->cli->desthost);
+ slprintf(server, sizeof(fstring)-1, "\\\\%s", cli->desthost);
strupper_m(server);
offered = 0;
@@ -777,7 +777,7 @@ WERROR rpccli_spoolss_getprinterdriver(struct rpc_pipe_client *cli,
ZERO_STRUCT(in);
ZERO_STRUCT(out);
- fstrcpy(server, cli->cli->desthost);
+ fstrcpy(server, cli->desthost);
strupper_m(server);
offered = 0;
@@ -855,7 +855,7 @@ WERROR rpccli_spoolss_enumprinterdrivers (struct rpc_pipe_client *cli,
ZERO_STRUCT(in);
ZERO_STRUCT(out);
- slprintf(server, sizeof(fstring)-1, "\\\\%s", cli->cli->desthost);
+ slprintf(server, sizeof(fstring)-1, "\\\\%s", cli->desthost);
strupper_m(server);
offered = 0;
@@ -938,7 +938,7 @@ WERROR rpccli_spoolss_getprinterdriverdir (struct rpc_pipe_client *cli,
ZERO_STRUCT(in);
ZERO_STRUCT(out);
- slprintf(server, sizeof(fstring)-1, "\\\\%s", cli->cli->desthost);
+ slprintf(server, sizeof(fstring)-1, "\\\\%s", cli->desthost);
strupper_m(server);
offered = 0;
@@ -996,7 +996,7 @@ WERROR rpccli_spoolss_addprinterdriver (struct rpc_pipe_client *cli,
ZERO_STRUCT(in);
ZERO_STRUCT(out);
- slprintf(server, sizeof(fstring)-1, "\\\\%s", cli->cli->desthost);
+ slprintf(server, sizeof(fstring)-1, "\\\\%s", cli->desthost);
strupper_m(server);
make_spoolss_q_addprinterdriver( mem_ctx, &in, server, level, ctr );
@@ -1026,7 +1026,7 @@ WERROR rpccli_spoolss_addprinterex (struct rpc_pipe_client *cli, TALLOC_CTX *mem
ZERO_STRUCT(out);
slprintf(client, sizeof(fstring)-1, "\\\\%s", global_myname());
- slprintf(server, sizeof(fstring)-1, "\\\\%s", cli->cli->desthost);
+ slprintf(server, sizeof(fstring)-1, "\\\\%s", cli->desthost);
strupper_m(client);
strupper_m(server);
@@ -1061,7 +1061,7 @@ WERROR rpccli_spoolss_deleteprinterdriverex(struct rpc_pipe_client *cli,
ZERO_STRUCT(in);
ZERO_STRUCT(out);
- slprintf(server, sizeof(fstring)-1, "\\\\%s", cli->cli->desthost);
+ slprintf(server, sizeof(fstring)-1, "\\\\%s", cli->desthost);
strupper_m(server);
make_spoolss_q_deleteprinterdriverex( mem_ctx, &in, server, arch, driver, version );
@@ -1091,7 +1091,7 @@ WERROR rpccli_spoolss_deleteprinterdriver (struct rpc_pipe_client *cli,
ZERO_STRUCT(in);
ZERO_STRUCT(out);
- slprintf(server, sizeof(fstring)-1, "\\\\%s", cli->cli->desthost);
+ slprintf(server, sizeof(fstring)-1, "\\\\%s", cli->desthost);
strupper_m(server);
make_spoolss_q_deleteprinterdriver( mem_ctx, &in, server, arch, driver );
diff --git a/source3/rpcclient/cmd_lsarpc.c b/source3/rpcclient/cmd_lsarpc.c
index 0d530ceaf2..88e49546b1 100644
--- a/source3/rpcclient/cmd_lsarpc.c
+++ b/source3/rpcclient/cmd_lsarpc.c
@@ -1137,7 +1137,7 @@ static NTSTATUS cmd_lsa_get_username(struct rpc_pipe_client *cli,
{
POLICY_HND pol;
NTSTATUS result = NT_STATUS_UNSUCCESSFUL;
- const char *servername = cli->cli->desthost;
+ const char *servername = cli->desthost;
struct lsa_String *account_name = NULL;
struct lsa_String *authority_name = NULL;
diff --git a/source3/rpcclient/cmd_netlogon.c b/source3/rpcclient/cmd_netlogon.c
index 95d79b5825..a30dd740e2 100644
--- a/source3/rpcclient/cmd_netlogon.c
+++ b/source3/rpcclient/cmd_netlogon.c
@@ -28,7 +28,7 @@ static WERROR cmd_netlogon_logon_ctrl2(struct rpc_pipe_client *cli,
{
NTSTATUS status = NT_STATUS_UNSUCCESSFUL;
WERROR werr;
- const char *logon_server = cli->cli->desthost;
+ const char *logon_server = cli->desthost;
enum netr_LogonControlCode function_code = NETLOGON_CONTROL_REDISCOVER;
uint32_t level = 1;
union netr_CONTROL_DATA_INFORMATION data;
@@ -104,7 +104,7 @@ static WERROR cmd_netlogon_getanydcname(struct rpc_pipe_client *cli,
old_timeout = cli_set_timeout(cli->cli, MAX(cli->cli->timeout,30000)); /* 30 seconds. */
status = rpccli_netr_GetAnyDCName(cli, mem_ctx,
- cli->cli->desthost,
+ cli->desthost,
argv[1],
&dcname,
&werr);
@@ -143,7 +143,7 @@ static WERROR cmd_netlogon_getdcname(struct rpc_pipe_client *cli,
old_timeout = cli_set_timeout(cli->cli, MAX(cli->cli->timeout,30000)); /* 30 seconds. */
status = rpccli_netr_GetDcName(cli, mem_ctx,
- cli->cli->desthost,
+ cli->desthost,
argv[1],
&dcname,
&werr);
@@ -171,7 +171,7 @@ static WERROR cmd_netlogon_dsr_getdcname(struct rpc_pipe_client *cli,
NTSTATUS result;
WERROR werr = WERR_OK;
uint32 flags = DS_RETURN_DNS_NAME;
- const char *server_name = cli->cli->desthost;
+ const char *server_name = cli->desthost;
const char *domain_name;
struct GUID domain_guid = GUID_zero();
struct GUID site_guid = GUID_zero();
@@ -231,7 +231,7 @@ static WERROR cmd_netlogon_dsr_getdcnameex(struct rpc_pipe_client *cli,
WERROR result;
NTSTATUS status;
uint32_t flags = DS_RETURN_DNS_NAME;
- const char *server_name = cli->cli->desthost;
+ const char *server_name = cli->desthost;
const char *domain_name;
const char *site_name = NULL;
struct GUID domain_guid = GUID_zero();
@@ -290,7 +290,7 @@ static WERROR cmd_netlogon_dsr_getdcnameex2(struct rpc_pipe_client *cli,
WERROR result;
NTSTATUS status;
uint32_t flags = DS_RETURN_DNS_NAME;
- const char *server_name = cli->cli->desthost;
+ const char *server_name = cli->desthost;
const char *domain_name = NULL;
const char *client_account = NULL;
uint32_t mask = 0;
@@ -396,7 +396,7 @@ static WERROR cmd_netlogon_logon_ctrl(struct rpc_pipe_client *cli,
{
NTSTATUS status = NT_STATUS_UNSUCCESSFUL;
WERROR werr;
- const char *logon_server = cli->cli->desthost;
+ const char *logon_server = cli->desthost;
enum netr_LogonControlCode function_code = 1;
uint32_t level = 1;
union netr_CONTROL_QUERY_INFORMATION info;
@@ -560,7 +560,7 @@ static NTSTATUS cmd_netlogon_sam_sync(struct rpc_pipe_client *cli,
const char **argv)
{
NTSTATUS result = NT_STATUS_UNSUCCESSFUL;
- const char *logon_server = cli->cli->desthost;
+ const char *logon_server = cli->desthost;
const char *computername = global_myname();
struct netr_Authenticator credential;
struct netr_Authenticator return_authenticator;
@@ -625,7 +625,7 @@ static NTSTATUS cmd_netlogon_sam_deltas(struct rpc_pipe_client *cli,
{
NTSTATUS result = NT_STATUS_UNSUCCESSFUL;
uint32_t tmp;
- const char *logon_server = cli->cli->desthost;
+ const char *logon_server = cli->desthost;
const char *computername = global_myname();
struct netr_Authenticator credential;
struct netr_Authenticator return_authenticator;
@@ -759,7 +759,7 @@ static WERROR cmd_netlogon_gettrustrid(struct rpc_pipe_client *cli,
{
NTSTATUS status = NT_STATUS_UNSUCCESSFUL;
WERROR werr = WERR_GENERAL_FAILURE;
- const char *server_name = cli->cli->desthost;
+ const char *server_name = cli->desthost;
const char *domain_name = lp_workgroup();
uint32_t rid = 0;
@@ -799,7 +799,7 @@ static WERROR cmd_netlogon_dsr_enumtrustdom(struct rpc_pipe_client *cli,
{
NTSTATUS status = NT_STATUS_UNSUCCESSFUL;
WERROR werr = WERR_GENERAL_FAILURE;
- const char *server_name = cli->cli->desthost;
+ const char *server_name = cli->desthost;
uint32_t trust_flags = NETR_TRUST_FLAG_IN_FOREST;
struct netr_DomainTrustList trusts;
@@ -847,7 +847,7 @@ static WERROR cmd_netlogon_deregisterdnsrecords(struct rpc_pipe_client *cli,
{
NTSTATUS status = NT_STATUS_UNSUCCESSFUL;
WERROR werr = WERR_GENERAL_FAILURE;
- const char *server_name = cli->cli->desthost;
+ const char *server_name = cli->desthost;
const char *domain = lp_workgroup();
const char *dns_host = NULL;
@@ -893,7 +893,7 @@ static WERROR cmd_netlogon_dsr_getforesttrustinfo(struct rpc_pipe_client *cli,
{
NTSTATUS status = NT_STATUS_UNSUCCESSFUL;
WERROR werr = WERR_GENERAL_FAILURE;
- const char *server_name = cli->cli->desthost;
+ const char *server_name = cli->desthost;
const char *trusted_domain_name = NULL;
struct lsa_ForestTrustInformation *info = NULL;
uint32_t flags = 0;
@@ -939,7 +939,7 @@ static WERROR cmd_netlogon_enumtrusteddomains(struct rpc_pipe_client *cli,
{
NTSTATUS status = NT_STATUS_UNSUCCESSFUL;
WERROR werr = WERR_GENERAL_FAILURE;
- const char *server_name = cli->cli->desthost;
+ const char *server_name = cli->desthost;
struct netr_Blob blob;
@@ -974,7 +974,7 @@ static WERROR cmd_netlogon_enumtrusteddomainsex(struct rpc_pipe_client *cli,
{
NTSTATUS status = NT_STATUS_UNSUCCESSFUL;
WERROR werr = WERR_GENERAL_FAILURE;
- const char *server_name = cli->cli->desthost;
+ const char *server_name = cli->desthost;
struct netr_DomainTrustList list;
if (argc < 1 || argc > 3) {
diff --git a/source3/rpcclient/cmd_spoolss.c b/source3/rpcclient/cmd_spoolss.c
index 7530ab1911..eb42836b6c 100644
--- a/source3/rpcclient/cmd_spoolss.c
+++ b/source3/rpcclient/cmd_spoolss.c
@@ -109,7 +109,7 @@ static WERROR cmd_spoolss_open_printer_ex(struct rpc_pipe_client *cli,
if (!cli)
return WERR_GENERAL_FAILURE;
- slprintf(servername, sizeof(servername)-1, "\\\\%s", cli->cli->desthost);
+ slprintf(servername, sizeof(servername)-1, "\\\\%s", cli->desthost);
strupper_m(servername);
fstrcpy(user, cli->user_name);
fstrcpy(printername, argv[1]);
@@ -317,7 +317,7 @@ static WERROR cmd_spoolss_enum_printers(struct rpc_pipe_client *cli,
if (argc == 3)
fstrcpy(name, argv[2]);
else {
- slprintf(name, sizeof(name)-1, "\\\\%s", cli->cli->desthost);
+ slprintf(name, sizeof(name)-1, "\\\\%s", cli->desthost);
strupper_m(name);
}
@@ -488,7 +488,7 @@ static WERROR cmd_spoolss_setprinter(struct rpc_pipe_client *cli,
fstrcpy(comment, argv[2]);
}
- slprintf(servername, sizeof(servername)-1, "\\\\%s", cli->cli->desthost);
+ slprintf(servername, sizeof(servername)-1, "\\\\%s", cli->desthost);
strupper_m(servername);
slprintf(printername, sizeof(servername)-1, "%s\\%s", servername, argv[1]);
fstrcpy(user, cli->user_name);
@@ -554,7 +554,7 @@ static WERROR cmd_spoolss_setprintername(struct rpc_pipe_client *cli,
fstrcpy(new_printername, argv[2]);
}
- slprintf(servername, sizeof(servername)-1, "\\\\%s", cli->cli->desthost);
+ slprintf(servername, sizeof(servername)-1, "\\\\%s", cli->desthost);
strupper_m(servername);
slprintf(printername, sizeof(printername)-1, "%s\\%s", servername, argv[1]);
fstrcpy(user, cli->user_name);
@@ -617,7 +617,7 @@ static WERROR cmd_spoolss_getprinter(struct rpc_pipe_client *cli,
info_level = atoi(argv[2]);
}
- slprintf(servername, sizeof(servername)-1, "\\\\%s", cli->cli->desthost);
+ slprintf(servername, sizeof(servername)-1, "\\\\%s", cli->desthost);
strupper_m(servername);
slprintf(printername, sizeof(printername)-1, "%s\\%s", servername, argv[1]);
fstrcpy(user, cli->user_name);
@@ -756,7 +756,7 @@ static WERROR cmd_spoolss_getprinterdata(struct rpc_pipe_client *cli,
/* Open a printer handle */
- slprintf(servername, sizeof(servername)-1, "\\\\%s", cli->cli->desthost);
+ slprintf(servername, sizeof(servername)-1, "\\\\%s", cli->desthost);
strupper_m(servername);
if (strncmp(argv[1], ".", sizeof(".")) == 0)
fstrcpy(printername, servername);
@@ -823,7 +823,7 @@ static WERROR cmd_spoolss_getprinterdataex(struct rpc_pipe_client *cli,
/* Open a printer handle */
- slprintf(servername, sizeof(servername)-1, "\\\\%s", cli->cli->desthost);
+ slprintf(servername, sizeof(servername)-1, "\\\\%s", cli->desthost);
strupper_m(servername);
if (strncmp(argv[1], ".", sizeof(".")) == 0)
fstrcpy(printername, servername);
@@ -999,7 +999,7 @@ static WERROR cmd_spoolss_getdriver(struct rpc_pipe_client *cli,
}
/* get the arguments need to open the printer handle */
- slprintf(servername, sizeof(servername)-1, "\\\\%s", cli->cli->desthost);
+ slprintf(servername, sizeof(servername)-1, "\\\\%s", cli->desthost);
strupper_m(servername);
fstrcpy(user, cli->user_name);
slprintf(printername, sizeof(servername)-1, "%s\\%s", servername, argv[1]);
@@ -1382,7 +1382,7 @@ static WERROR cmd_spoolss_addprinterex(struct rpc_pipe_client *cli,
return WERR_OK;
}
- slprintf(servername, sizeof(servername)-1, "\\\\%s", cli->cli->desthost);
+ slprintf(servername, sizeof(servername)-1, "\\\\%s", cli->desthost);
strupper_m(servername);
/* Fill in the DRIVER_INFO_2 struct */
@@ -1444,7 +1444,7 @@ static WERROR cmd_spoolss_setdriver(struct rpc_pipe_client *cli,
return WERR_OK;
}
- slprintf(servername, sizeof(servername)-1, "\\\\%s", cli->cli->desthost);
+ slprintf(servername, sizeof(servername)-1, "\\\\%s", cli->desthost);
strupper_m(servername);
slprintf(printername, sizeof(printername)-1, "%s\\%s", servername, argv[1]);
fstrcpy(user, cli->user_name);
@@ -1570,7 +1570,7 @@ static WERROR cmd_spoolss_deletedriver(struct rpc_pipe_client *cli,
return WERR_OK;
}
- slprintf(servername, sizeof(servername)-1, "\\\\%s", cli->cli->desthost);
+ slprintf(servername, sizeof(servername)-1, "\\\\%s", cli->desthost);
strupper_m(servername);
/* delete the driver for all architectures */
@@ -1611,7 +1611,7 @@ static WERROR cmd_spoolss_getprintprocdir(struct rpc_pipe_client *cli,
return WERR_OK;
}
- if (asprintf(&servername, "\\\\%s", cli->cli->desthost) < 0)
+ if (asprintf(&servername, "\\\\%s", cli->desthost) < 0)
return WERR_NOMEM;
strupper_m(servername);
@@ -1654,7 +1654,7 @@ static WERROR cmd_spoolss_addform(struct rpc_pipe_client *cli, TALLOC_CTX *mem_c
/* Get a printer handle */
- asprintf(&servername, "\\\\%s", cli->cli->desthost);
+ asprintf(&servername, "\\\\%s", cli->desthost);
strupper_m(servername);
asprintf(&printername, "%s\\%s", servername, argv[1]);
@@ -1714,7 +1714,7 @@ static WERROR cmd_spoolss_setform(struct rpc_pipe_client *cli, TALLOC_CTX *mem_c
/* Get a printer handle */
- asprintf(&servername, "\\\\%s", cli->cli->desthost);
+ asprintf(&servername, "\\\\%s", cli->desthost);
strupper_m(servername);
asprintf(&printername, "%s\\%s", servername, argv[1]);
@@ -1811,7 +1811,7 @@ static WERROR cmd_spoolss_getform(struct rpc_pipe_client *cli, TALLOC_CTX *mem_c
/* Get a printer handle */
- asprintf(&servername, "\\\\%s", cli->cli->desthost);
+ asprintf(&servername, "\\\\%s", cli->desthost);
strupper_m(servername);
asprintf(&printername, "%s\\%s", servername, argv[1]);
@@ -1864,7 +1864,7 @@ static WERROR cmd_spoolss_deleteform(struct rpc_pipe_client *cli,
/* Get a printer handle */
- asprintf(&servername, "\\\\%s", cli->cli->desthost);
+ asprintf(&servername, "\\\\%s", cli->desthost);
strupper_m(servername);
asprintf(&printername, "%s\\%s", servername, argv[1]);
@@ -1914,7 +1914,7 @@ static WERROR cmd_spoolss_enum_forms(struct rpc_pipe_client *cli,
/* Get a printer handle */
- asprintf(&servername, "\\\\%s", cli->cli->desthost);
+ asprintf(&servername, "\\\\%s", cli->desthost);
strupper_m(servername);
asprintf(&printername, "%s\\%s", servername, argv[1]);
@@ -1977,7 +1977,7 @@ static WERROR cmd_spoolss_setprinterdata(struct rpc_pipe_client *cli,
goto done;
}
- slprintf(servername, sizeof(servername)-1, "\\\\%s", cli->cli->desthost);
+ slprintf(servername, sizeof(servername)-1, "\\\\%s", cli->desthost);
strupper_m(servername);
slprintf(printername, sizeof(servername)-1, "%s\\%s", servername, argv[1]);
fstrcpy(user, cli->user_name);
@@ -2187,12 +2187,10 @@ static WERROR cmd_spoolss_enum_jobs(struct rpc_pipe_client *cli,
/* Open printer handle */
- slprintf(servername, sizeof(servername)-1, "\\\\%s", cli->cli->desthost);
+ slprintf(servername, sizeof(servername)-1, "\\\\%s", cli->desthost);
strupper_m(servername);
fstrcpy(user, cli->user_name);
- printername = talloc_asprintf(mem_ctx,
- "\\\\%s\\",
- cli->cli->desthost);
+ printername = talloc_asprintf(mem_ctx, "\\\\%s\\", cli->desthost);
if (!printername) {
return WERR_NOMEM;
}
@@ -2261,12 +2259,10 @@ static WERROR cmd_spoolss_enum_data( struct rpc_pipe_client *cli,
/* Open printer handle */
- slprintf(servername, sizeof(servername)-1, "\\\\%s", cli->cli->desthost);
+ slprintf(servername, sizeof(servername)-1, "\\\\%s", cli->desthost);
strupper_m(servername);
fstrcpy(user, cli->user_name);
- printername = talloc_asprintf(mem_ctx,
- "\\\\%s\\",
- cli->cli->desthost);
+ printername = talloc_asprintf(mem_ctx, "\\\\%s\\", cli->desthost);
if (!printername) {
return WERR_NOMEM;
}
@@ -2333,13 +2329,11 @@ static WERROR cmd_spoolss_enum_data_ex( struct rpc_pipe_client *cli,
/* Open printer handle */
- slprintf(servername, sizeof(servername)-1, "\\\\%s", cli->cli->desthost);
+ slprintf(servername, sizeof(servername)-1, "\\\\%s", cli->desthost);
strupper_m(servername);
fstrcpy(user, cli->user_name);
- printername = talloc_asprintf(mem_ctx,
- "\\\\%s\\",
- cli->cli->desthost);
+ printername = talloc_asprintf(mem_ctx, "\\\\%s\\", cli->desthost);
if (!printername) {
return WERR_NOMEM;
}
@@ -2408,13 +2402,11 @@ static WERROR cmd_spoolss_enum_printerkey( struct rpc_pipe_client *cli,
/* Open printer handle */
- slprintf(servername, sizeof(servername)-1, "\\\\%s", cli->cli->desthost);
+ slprintf(servername, sizeof(servername)-1, "\\\\%s", cli->desthost);
strupper_m(servername);
fstrcpy(user, cli->user_name);
- printername = talloc_asprintf(mem_ctx,
- "\\\\%s\\",
- cli->cli->desthost);
+ printername = talloc_asprintf(mem_ctx, "\\\\%s\\", cli->desthost);
if (!printername) {
return WERR_NOMEM;
}
@@ -2484,11 +2476,11 @@ static WERROR cmd_spoolss_rffpcnex(struct rpc_pipe_client *cli,
/* Open printer */
- slprintf(servername, sizeof(servername) - 1, "\\\\%s", cli->cli->desthost);
+ slprintf(servername, sizeof(servername) - 1, "\\\\%s", cli->desthost);
strupper_m(servername);
- slprintf(printername, sizeof(printername) - 1, "\\\\%s\\%s", cli->cli->desthost,
- argv[1]);
+ slprintf(printername, sizeof(printername) - 1, "\\\\%s\\%s",
+ cli->desthost, argv[1]);
strupper_m(printername);
result = rpccli_spoolss_open_printer_ex(
@@ -2558,7 +2550,7 @@ static bool compare_printer( struct rpc_pipe_client *cli1, POLICY_HND *hnd1,
WERROR werror;
TALLOC_CTX *mem_ctx = talloc_init("compare_printer");
- printf("Retrieving printer propertiesfor %s...", cli1->cli->desthost);
+ printf("Retrieving printer propertiesfor %s...", cli1->desthost);
werror = rpccli_spoolss_getprinter( cli1, mem_ctx, hnd1, 2, &ctr1);
if ( !W_ERROR_IS_OK(werror) ) {
printf("failed (%s)\n", dos_errstr(werror));
@@ -2567,7 +2559,7 @@ static bool compare_printer( struct rpc_pipe_client *cli1, POLICY_HND *hnd1,
}
printf("ok\n");
- printf("Retrieving printer properties for %s...", cli2->cli->desthost);
+ printf("Retrieving printer properties for %s...", cli2->desthost);
werror = rpccli_spoolss_getprinter( cli2, mem_ctx, hnd2, 2, &ctr2);
if ( !W_ERROR_IS_OK(werror) ) {
printf("failed (%s)\n", dos_errstr(werror));
@@ -2594,7 +2586,7 @@ static bool compare_printer_secdesc( struct rpc_pipe_client *cli1, POLICY_HND *h
bool result = True;
- printf("Retreiving printer security for %s...", cli1->cli->desthost);
+ printf("Retrieving printer security for %s...", cli1->desthost);
werror = rpccli_spoolss_getprinter( cli1, mem_ctx, hnd1, 3, &ctr1);
if ( !W_ERROR_IS_OK(werror) ) {
printf("failed (%s)\n", dos_errstr(werror));
@@ -2603,7 +2595,7 @@ static bool compare_printer_secdesc( struct rpc_pipe_client *cli1, POLICY_HND *h
}
printf("ok\n");
- printf("Retrieving printer security for %s...", cli2->cli->desthost);
+ printf("Retrieving printer security for %s...", cli2->desthost);
werror = rpccli_spoolss_getprinter( cli2, mem_ctx, hnd2, 3, &ctr2);
if ( !W_ERROR_IS_OK(werror) ) {
printf("failed (%s)\n", dos_errstr(werror));
@@ -2667,7 +2659,7 @@ static WERROR cmd_spoolss_printercmp(struct rpc_pipe_client *cli,
fstrcpy( printername, argv[1] );
- fstrcpy( servername1, cli->cli->desthost );
+ fstrcpy( servername1, cli->desthost );
fstrcpy( servername2, argv[2] );
strupper_m( servername1 );
strupper_m( servername2 );
diff --git a/source3/rpcclient/cmd_srvsvc.c b/source3/rpcclient/cmd_srvsvc.c
index 070fb36e30..7709d47e49 100644
--- a/source3/rpcclient/cmd_srvsvc.c
+++ b/source3/rpcclient/cmd_srvsvc.c
@@ -183,7 +183,7 @@ static WERROR cmd_srvsvc_srv_query_info(struct rpc_pipe_client *cli,
info_level = atoi(argv[1]);
server_name = talloc_asprintf_strupper_m(mem_ctx, "\\\\%s",
- cli->cli->desthost);
+ cli->desthost);
W_ERROR_HAVE_NO_MEMORY(server_name);
status = rpccli_srvsvc_NetSrvGetInfo(cli, mem_ctx,
@@ -336,7 +336,7 @@ static WERROR cmd_srvsvc_net_share_enum_int(struct rpc_pipe_client *cli,
switch (opcode) {
case NDR_SRVSVC_NETSHAREENUM:
status = rpccli_srvsvc_NetShareEnum(cli, mem_ctx,
- cli->cli->desthost,
+ cli->desthost,
&info_ctr,
preferred_len,
&totalentries,
@@ -345,7 +345,7 @@ static WERROR cmd_srvsvc_net_share_enum_int(struct rpc_pipe_client *cli,
break;
case NDR_SRVSVC_NETSHAREENUMALL:
status = rpccli_srvsvc_NetShareEnumAll(cli, mem_ctx,
- cli->cli->desthost,
+ cli->desthost,
&info_ctr,
preferred_len,
&totalentries,
@@ -420,7 +420,7 @@ static WERROR cmd_srvsvc_net_share_get_info(struct rpc_pipe_client *cli,
info_level = atoi(argv[2]);
status = rpccli_srvsvc_NetShareGetInfo(cli, mem_ctx,
- cli->cli->desthost,
+ cli->desthost,
argv[1],
info_level,
&info,
@@ -468,7 +468,7 @@ static WERROR cmd_srvsvc_net_share_set_info(struct rpc_pipe_client *cli,
/* retrieve share info */
status = rpccli_srvsvc_NetShareGetInfo(cli, mem_ctx,
- cli->cli->desthost,
+ cli->desthost,
argv[1],
info_level,
&info_get,
@@ -482,7 +482,7 @@ static WERROR cmd_srvsvc_net_share_set_info(struct rpc_pipe_client *cli,
/* set share info */
status = rpccli_srvsvc_NetShareSetInfo(cli, mem_ctx,
- cli->cli->desthost,
+ cli->desthost,
argv[1],
info_level,
&info_get,
@@ -495,7 +495,7 @@ static WERROR cmd_srvsvc_net_share_set_info(struct rpc_pipe_client *cli,
/* re-retrieve share info and display */
status = rpccli_srvsvc_NetShareGetInfo(cli, mem_ctx,
- cli->cli->desthost,
+ cli->desthost,
argv[1],
info_level,
&info_get,
@@ -568,7 +568,7 @@ static WERROR cmd_srvsvc_net_file_enum(struct rpc_pipe_client *cli,
info_ctr.ctr.ctr3 = &ctr3;
status = rpccli_srvsvc_NetFileEnum(cli, mem_ctx,
- cli->cli->desthost,
+ cli->desthost,
NULL,
NULL,
&info_ctr,
@@ -603,7 +603,7 @@ static WERROR cmd_srvsvc_net_name_validate(struct rpc_pipe_client *cli,
}
status = rpccli_srvsvc_NetNameValidate(cli, mem_ctx,
- cli->cli->desthost,
+ cli->desthost,
argv[1],
name_type,
flags,
@@ -630,7 +630,7 @@ static WERROR cmd_srvsvc_net_file_get_sec(struct rpc_pipe_client *cli,
}
status = rpccli_srvsvc_NetGetFileSecurity(cli, mem_ctx,
- cli->cli->desthost,
+ cli->desthost,
argv[1],
argv[2],
SECINFO_DACL,
@@ -660,7 +660,7 @@ static WERROR cmd_srvsvc_net_sess_del(struct rpc_pipe_client *cli,
}
status = rpccli_srvsvc_NetSessDel(cli, mem_ctx,
- cli->cli->desthost,
+ cli->desthost,
argv[1],
argv[2],
&result);
@@ -744,7 +744,7 @@ static WERROR cmd_srvsvc_net_sess_enum(struct rpc_pipe_client *cli,
}
status = rpccli_srvsvc_NetSessEnum(cli, mem_ctx,
- cli->cli->desthost,
+ cli->desthost,
client,
user,
&info_ctr,
@@ -788,7 +788,7 @@ static WERROR cmd_srvsvc_net_disk_enum(struct rpc_pipe_client *cli,
ZERO_STRUCT(info);
status = rpccli_srvsvc_NetDiskEnum(cli, mem_ctx,
- cli->cli->desthost,
+ cli->desthost,
level,
&info,
0xffffffff,
@@ -855,7 +855,7 @@ static WERROR cmd_srvsvc_net_conn_enum(struct rpc_pipe_client *cli,
}
status = rpccli_srvsvc_NetConnEnum(cli, mem_ctx,
- cli->cli->desthost,
+ cli->desthost,
path,
&info_ctr,
0xffffffff,
diff --git a/source3/rpcclient/cmd_wkssvc.c b/source3/rpcclient/cmd_wkssvc.c
index 68f408cf48..fbf483bd2b 100644
--- a/source3/rpcclient/cmd_wkssvc.c
+++ b/source3/rpcclient/cmd_wkssvc.c
@@ -41,7 +41,7 @@ static WERROR cmd_wkssvc_wkstagetinfo(struct rpc_pipe_client *cli,
level = atoi(argv[1]);
}
- server_name = cli->cli->desthost;
+ server_name = cli->desthost;
status = rpccli_wkssvc_NetWkstaGetInfo(cli, mem_ctx,
server_name,
@@ -66,7 +66,7 @@ static WERROR cmd_wkssvc_getjoininformation(struct rpc_pipe_client *cli,
NTSTATUS status;
WERROR werr;
- server_name = cli->cli->desthost;
+ server_name = cli->desthost;
name_buffer = "";
status = rpccli_wkssvc_NetrGetJoinInformation(cli, mem_ctx,
@@ -90,9 +90,9 @@ static WERROR cmd_wkssvc_messagebuffersend(struct rpc_pipe_client *cli,
int argc,
const char **argv)
{
- const char *server_name = cli->cli->desthost;
- const char *message_name = cli->cli->desthost;
- const char *message_sender_name = cli->cli->desthost;
+ const char *server_name = cli->desthost;
+ const char *message_name = cli->desthost;
+ const char *message_sender_name = cli->desthost;
smb_ucs2_t *message_buffer = NULL;
size_t message_size = 0;
const char *message = "my message";
@@ -135,7 +135,7 @@ static WERROR cmd_wkssvc_enumeratecomputernames(struct rpc_pipe_client *cli,
struct wkssvc_ComputerNamesCtr *ctr = NULL;
WERROR werr;
- server_name = cli->cli->desthost;
+ server_name = cli->desthost;
if (argc >= 2) {
name_type = atoi(argv[1]);
diff --git a/source3/utils/net_rpc.c b/source3/utils/net_rpc.c
index 93947791f3..330317b0fd 100644
--- a/source3/utils/net_rpc.c
+++ b/source3/utils/net_rpc.c
@@ -451,7 +451,7 @@ NTSTATUS rpc_info_internals(const DOM_SID *domain_sid,
/* Get sam policy handle */
result = rpccli_samr_Connect2(pipe_hnd, mem_ctx,
- pipe_hnd->cli->desthost,
+ pipe_hnd->desthost,
MAXIMUM_ALLOWED_ACCESS,
&connect_pol);
if (!NT_STATUS_IS_OK(result)) {
@@ -654,7 +654,7 @@ static NTSTATUS rpc_user_rename_internals(const DOM_SID *domain_sid,
/* Get sam policy handle */
result = rpccli_samr_Connect2(pipe_hnd, mem_ctx,
- pipe_hnd->cli->desthost,
+ pipe_hnd->desthost,
MAXIMUM_ALLOWED_ACCESS,
&connect_pol);
@@ -829,7 +829,7 @@ static NTSTATUS rpc_user_password_internals(const DOM_SID *domain_sid,
/* Get sam policy and domain handles */
result = rpccli_samr_Connect2(pipe_hnd, mem_ctx,
- pipe_hnd->cli->desthost,
+ pipe_hnd->desthost,
MAXIMUM_ALLOWED_ACCESS,
&connect_pol);
@@ -960,7 +960,7 @@ static NTSTATUS rpc_user_info_internals(const DOM_SID *domain_sid,
/* Get sam policy handle */
result = rpccli_samr_Connect2(pipe_hnd, mem_ctx,
- pipe_hnd->cli->desthost,
+ pipe_hnd->desthost,
MAXIMUM_ALLOWED_ACCESS,
&connect_pol);
if (!NT_STATUS_IS_OK(result)) goto done;
@@ -1078,7 +1078,7 @@ static NTSTATUS rpc_user_list_internals(const DOM_SID *domain_sid,
/* Get sam policy handle */
result = rpccli_samr_Connect2(pipe_hnd, mem_ctx,
- pipe_hnd->cli->desthost,
+ pipe_hnd->desthost,
MAXIMUM_ALLOWED_ACCESS,
&connect_pol);
if (!NT_STATUS_IS_OK(result)) {
@@ -1243,7 +1243,7 @@ static NTSTATUS rpc_sh_handle_user(TALLOC_CTX *mem_ctx,
}
result = rpccli_samr_Connect2(pipe_hnd, mem_ctx,
- pipe_hnd->cli->desthost,
+ pipe_hnd->desthost,
MAXIMUM_ALLOWED_ACCESS,
&connect_pol);
if (!NT_STATUS_IS_OK(result)) {
@@ -1611,7 +1611,7 @@ static NTSTATUS rpc_group_delete_internals(const DOM_SID *domain_sid,
}
result = rpccli_samr_Connect2(pipe_hnd, mem_ctx,
- pipe_hnd->cli->desthost,
+ pipe_hnd->desthost,
MAXIMUM_ALLOWED_ACCESS,
&connect_pol);
@@ -1809,7 +1809,7 @@ static NTSTATUS rpc_group_add_internals(const DOM_SID *domain_sid,
/* Get sam policy handle */
result = rpccli_samr_Connect2(pipe_hnd, mem_ctx,
- pipe_hnd->cli->desthost,
+ pipe_hnd->desthost,
MAXIMUM_ALLOWED_ACCESS,
&connect_pol);
if (!NT_STATUS_IS_OK(result)) goto done;
@@ -1879,7 +1879,7 @@ static NTSTATUS rpc_alias_add_internals(const DOM_SID *domain_sid,
/* Get sam policy handle */
result = rpccli_samr_Connect2(pipe_hnd, mem_ctx,
- pipe_hnd->cli->desthost,
+ pipe_hnd->desthost,
MAXIMUM_ALLOWED_ACCESS,
&connect_pol);
if (!NT_STATUS_IS_OK(result)) goto done;
@@ -2015,7 +2015,7 @@ static NTSTATUS rpc_add_groupmem(struct rpc_pipe_client *pipe_hnd,
/* Get sam policy handle */
result = rpccli_samr_Connect2(pipe_hnd, mem_ctx,
- pipe_hnd->cli->desthost,
+ pipe_hnd->desthost,
MAXIMUM_ALLOWED_ACCESS,
&connect_pol);
if (!NT_STATUS_IS_OK(result)) {
@@ -2097,7 +2097,7 @@ static NTSTATUS rpc_add_aliasmem(struct rpc_pipe_client *pipe_hnd,
/* Get sam policy handle */
result = rpccli_samr_Connect2(pipe_hnd, mem_ctx,
- pipe_hnd->cli->desthost,
+ pipe_hnd->desthost,
MAXIMUM_ALLOWED_ACCESS,
&connect_pol);
if (!NT_STATUS_IS_OK(result)) {
@@ -2216,7 +2216,7 @@ static NTSTATUS rpc_del_groupmem(struct rpc_pipe_client *pipe_hnd,
/* Get sam policy handle */
result = rpccli_samr_Connect2(pipe_hnd, mem_ctx,
- pipe_hnd->cli->desthost,
+ pipe_hnd->desthost,
MAXIMUM_ALLOWED_ACCESS,
&connect_pol);
if (!NT_STATUS_IS_OK(result))
@@ -2292,7 +2292,7 @@ static NTSTATUS rpc_del_aliasmem(struct rpc_pipe_client *pipe_hnd,
/* Get sam policy handle */
result = rpccli_samr_Connect2(pipe_hnd, mem_ctx,
- pipe_hnd->cli->desthost,
+ pipe_hnd->desthost,
MAXIMUM_ALLOWED_ACCESS,
&connect_pol);
if (!NT_STATUS_IS_OK(result)) {
@@ -2439,7 +2439,7 @@ static NTSTATUS rpc_group_list_internals(const DOM_SID *domain_sid,
/* Get sam policy handle */
result = rpccli_samr_Connect2(pipe_hnd, mem_ctx,
- pipe_hnd->cli->desthost,
+ pipe_hnd->desthost,
MAXIMUM_ALLOWED_ACCESS,
&connect_pol);
if (!NT_STATUS_IS_OK(result)) {
@@ -2810,7 +2810,7 @@ static NTSTATUS rpc_group_members_internals(const DOM_SID *domain_sid,
/* Get sam policy handle */
result = rpccli_samr_Connect2(pipe_hnd, mem_ctx,
- pipe_hnd->cli->desthost,
+ pipe_hnd->desthost,
MAXIMUM_ALLOWED_ACCESS,
&connect_pol);
@@ -2923,7 +2923,7 @@ static NTSTATUS rpc_group_rename_internals(const DOM_SID *domain_sid,
/* Get sam policy handle */
result = rpccli_samr_Connect2(pipe_hnd, mem_ctx,
- pipe_hnd->cli->desthost,
+ pipe_hnd->desthost,
MAXIMUM_ALLOWED_ACCESS,
&connect_pol);
@@ -3084,7 +3084,7 @@ static NTSTATUS rpc_share_add_internals(const DOM_SID *domain_sid,
info.info2 = &info2;
status = rpccli_srvsvc_NetShareAdd(pipe_hnd, mem_ctx,
- pipe_hnd->cli->desthost,
+ pipe_hnd->desthost,
level,
&info,
&parm_error,
@@ -3129,7 +3129,7 @@ static NTSTATUS rpc_share_del_internals(const DOM_SID *domain_sid,
WERROR result;
return rpccli_srvsvc_NetShareDel(pipe_hnd, mem_ctx,
- pipe_hnd->cli->desthost,
+ pipe_hnd->desthost,
argv[0],
0,
&result);
@@ -3195,7 +3195,7 @@ static WERROR get_share_info(struct rpc_pipe_client *pipe_hnd,
info_ctr->level = level;
status = rpccli_srvsvc_NetShareEnumAll(pipe_hnd, mem_ctx,
- pipe_hnd->cli->desthost,
+ pipe_hnd->desthost,
info_ctr,
preferred_len,
&total_entries,
@@ -3206,7 +3206,7 @@ static WERROR get_share_info(struct rpc_pipe_client *pipe_hnd,
/* request just one share */
status = rpccli_srvsvc_NetShareGetInfo(pipe_hnd, mem_ctx,
- pipe_hnd->cli->desthost,
+ pipe_hnd->desthost,
argv[0],
level,
&info,
@@ -3425,7 +3425,7 @@ static NTSTATUS rpc_share_migrate_shares_internals(const DOM_SID *domain_sid,
info.info502 = &info502;
nt_status = rpccli_srvsvc_NetShareAdd(srvsvc_pipe, mem_ctx,
- srvsvc_pipe->cli->desthost,
+ srvsvc_pipe->desthost,
502,
&info,
&parm_error,
@@ -3848,7 +3848,7 @@ static NTSTATUS rpc_share_migrate_security_internals(const DOM_SID *domain_sid,
/* finally modify the share on the dst server */
nt_status = rpccli_srvsvc_NetShareSetInfo(srvsvc_pipe, mem_ctx,
- srvsvc_pipe->cli->desthost,
+ srvsvc_pipe->desthost,
info502.name,
level,
&info,
@@ -4141,7 +4141,7 @@ static NTSTATUS rpc_aliaslist_internals(const DOM_SID *domain_sid,
POLICY_HND connect_pol;
result = rpccli_samr_Connect2(pipe_hnd, mem_ctx,
- pipe_hnd->cli->desthost,
+ pipe_hnd->desthost,
MAXIMUM_ALLOWED_ACCESS,
&connect_pol);
@@ -4488,7 +4488,7 @@ static void show_userlist(struct rpc_pipe_client *pipe_hnd,
uint16 cnum;
status = rpccli_srvsvc_NetShareGetInfo(pipe_hnd, mem_ctx,
- pipe_hnd->cli->desthost,
+ pipe_hnd->desthost,
netname,
502,
&info,
@@ -4807,7 +4807,7 @@ static NTSTATUS rpc_sh_share_add(TALLOC_CTX *mem_ctx,
info.info2 = &info2;
status = rpccli_srvsvc_NetShareAdd(pipe_hnd, mem_ctx,
- pipe_hnd->cli->desthost,
+ pipe_hnd->desthost,
2,
&info,
&parm_err,
@@ -4830,7 +4830,7 @@ static NTSTATUS rpc_sh_share_delete(TALLOC_CTX *mem_ctx,
}
status = rpccli_srvsvc_NetShareDel(pipe_hnd, mem_ctx,
- pipe_hnd->cli->desthost,
+ pipe_hnd->desthost,
argv[0],
0,
&result);
@@ -4853,7 +4853,7 @@ static NTSTATUS rpc_sh_share_info(TALLOC_CTX *mem_ctx,
}
status = rpccli_srvsvc_NetShareGetInfo(pipe_hnd, mem_ctx,
- pipe_hnd->cli->desthost,
+ pipe_hnd->desthost,
argv[0],
2,
&info,
@@ -4925,7 +4925,7 @@ static NTSTATUS rpc_file_close_internals(const DOM_SID *domain_sid,
const char **argv)
{
return rpccli_srvsvc_NetFileClose(pipe_hnd, mem_ctx,
- pipe_hnd->cli->desthost,
+ pipe_hnd->desthost,
atoi(argv[0]), NULL);
}
@@ -5006,7 +5006,7 @@ static NTSTATUS rpc_file_list_internals(const DOM_SID *domain_sid,
info_ctr.ctr.ctr3 = &ctr3;
status = rpccli_srvsvc_NetFileEnum(pipe_hnd, mem_ctx,
- pipe_hnd->cli->desthost,
+ pipe_hnd->desthost,
NULL,
username,
&info_ctr,
@@ -5371,7 +5371,7 @@ static NTSTATUS rpc_trustdom_add_internals(const DOM_SID *domain_sid,
/* Get samr policy handle */
result = rpccli_samr_Connect2(pipe_hnd, mem_ctx,
- pipe_hnd->cli->desthost,
+ pipe_hnd->desthost,
MAXIMUM_ALLOWED_ACCESS,
&connect_pol);
if (!NT_STATUS_IS_OK(result)) {
@@ -5527,7 +5527,7 @@ static NTSTATUS rpc_trustdom_del_internals(const DOM_SID *domain_sid,
/* Get samr policy handle */
result = rpccli_samr_Connect2(pipe_hnd, mem_ctx,
- pipe_hnd->cli->desthost,
+ pipe_hnd->desthost,
MAXIMUM_ALLOWED_ACCESS,
&connect_pol);
if (!NT_STATUS_IS_OK(result)) {
@@ -6269,7 +6269,7 @@ static int rpc_trustdom_list(int argc, const char **argv)
/* SamrConnect2 */
nt_status = rpccli_samr_Connect2(pipe_hnd, mem_ctx,
- pipe_hnd->cli->desthost,
+ pipe_hnd->desthost,
SA_RIGHT_SAM_OPEN_DOMAIN,
&connect_hnd);
if (!NT_STATUS_IS_OK(nt_status)) {
diff --git a/source3/utils/net_rpc_join.c b/source3/utils/net_rpc_join.c
index ea3bb10c22..b868ea824f 100644
--- a/source3/utils/net_rpc_join.c
+++ b/source3/utils/net_rpc_join.c
@@ -238,7 +238,7 @@ int net_rpc_join_newstyle(int argc, const char **argv)
}
CHECK_RPC_ERR(rpccli_samr_Connect2(pipe_hnd, mem_ctx,
- pipe_hnd->cli->desthost,
+ pipe_hnd->desthost,
SEC_RIGHTS_MAXIMUM_ALLOWED,
&sam_pol),
"could not connect to SAM database");
diff --git a/source3/utils/net_rpc_printer.c b/source3/utils/net_rpc_printer.c
index bcfb37713c..80140792a3 100644
--- a/source3/utils/net_rpc_printer.c
+++ b/source3/utils/net_rpc_printer.c
@@ -721,7 +721,8 @@ static bool net_spoolss_open_printer_ex(struct rpc_pipe_client *pipe_hnd,
WERROR result;
fstring servername, printername2;
- slprintf(servername, sizeof(servername)-1, "\\\\%s", pipe_hnd->cli->desthost);
+ slprintf(servername, sizeof(servername)-1, "\\\\%s",
+ pipe_hnd->desthost);
fstrcpy(printername2, servername);
fstrcat(printername2, "\\");
diff --git a/source3/utils/net_rpc_samsync.c b/source3/utils/net_rpc_samsync.c
index 06cde2a3fd..6ea0a2dcfc 100644
--- a/source3/utils/net_rpc_samsync.c
+++ b/source3/utils/net_rpc_samsync.c
@@ -330,7 +330,7 @@ static void dump_database(struct rpc_pipe_client *pipe_hnd,
NTSTATUS result;
int i;
TALLOC_CTX *mem_ctx;
- const char *logon_server = pipe_hnd->cli->desthost;
+ const char *logon_server = pipe_hnd->desthost;
const char *computername = global_myname();
struct netr_Authenticator credential;
struct netr_Authenticator return_authenticator;
@@ -1190,7 +1190,7 @@ static NTSTATUS fetch_database(struct rpc_pipe_client *pipe_hnd, uint32 db_type,
NTSTATUS result;
int i;
TALLOC_CTX *mem_ctx;
- const char *logon_server = pipe_hnd->cli->desthost;
+ const char *logon_server = pipe_hnd->desthost;
const char *computername = global_myname();
struct netr_Authenticator credential;
struct netr_Authenticator return_authenticator;
@@ -2011,7 +2011,7 @@ static NTSTATUS fetch_database_to_ldif(struct rpc_pipe_client *pipe_hnd,
uint32 num_deltas;
FILE *add_file = NULL, *mod_file = NULL, *ldif_file = NULL;
int num_alloced = 0, g_index = 0, a_index = 0;
- const char *logon_server = pipe_hnd->cli->desthost;
+ const char *logon_server = pipe_hnd->desthost;
const char *computername = global_myname();
struct netr_Authenticator credential;
struct netr_Authenticator return_authenticator;
diff --git a/source3/utils/net_rpc_sh_acct.c b/source3/utils/net_rpc_sh_acct.c
index 57640ca3a8..00a7967f07 100644
--- a/source3/utils/net_rpc_sh_acct.c
+++ b/source3/utils/net_rpc_sh_acct.c
@@ -49,7 +49,7 @@ static NTSTATUS rpc_sh_acct_do(TALLOC_CTX *mem_ctx,
/* Get sam policy handle */
result = rpccli_samr_Connect2(pipe_hnd, mem_ctx,
- pipe_hnd->cli->desthost,
+ pipe_hnd->desthost,
MAXIMUM_ALLOWED_ACCESS,
&connect_pol);
if (!NT_STATUS_IS_OK(result)) {
diff --git a/source3/utils/smbtree.c b/source3/utils/smbtree.c
index 48eae5ac5c..d2dd1b49d3 100644
--- a/source3/utils/smbtree.c
+++ b/source3/utils/smbtree.c
@@ -179,7 +179,7 @@ static bool get_rpc_shares(struct cli_state *cli,
info_ctr.ctr.ctr1 = &ctr1;
status = rpccli_srvsvc_NetShareEnumAll(pipe_hnd, mem_ctx,
- pipe_hnd->cli->desthost,
+ pipe_hnd->desthost,
&info_ctr,
0xffffffff,
&total_entries,
diff --git a/source3/winbindd/winbindd_ads.c b/source3/winbindd/winbindd_ads.c
index ae8ad9dd1a..8be6a47998 100644
--- a/source3/winbindd/winbindd_ads.c
+++ b/source3/winbindd/winbindd_ads.c
@@ -1195,7 +1195,7 @@ static NTSTATUS trusted_domains(struct winbindd_domain *domain,
}
result = rpccli_netr_DsrEnumerateDomainTrusts(cli, mem_ctx,
- cli->cli->desthost,
+ cli->desthost,
flags,
&trusts,
NULL);
diff --git a/source3/winbindd/winbindd_cm.c b/source3/winbindd/winbindd_cm.c
index fc1a9cae93..71d2c029ee 100644
--- a/source3/winbindd/winbindd_cm.c
+++ b/source3/winbindd/winbindd_cm.c
@@ -1609,7 +1609,7 @@ static bool set_dc_type_and_flags_trustinfo( struct winbindd_domain *domain )
}
result = rpccli_netr_DsrEnumerateDomainTrusts(cli, mem_ctx,
- cli->cli->desthost,
+ cli->desthost,
flags,
&trusts,
NULL);
@@ -1962,7 +1962,7 @@ NTSTATUS cm_connect_sam(struct winbindd_domain *domain, TALLOC_CTX *mem_ctx,
domain_name, machine_account));
result = rpccli_samr_Connect2(conn->samr_pipe, mem_ctx,
- conn->samr_pipe->cli->desthost,
+ conn->samr_pipe->desthost,
SEC_RIGHTS_MAXIMUM_ALLOWED,
&conn->sam_connect_handle);
if (NT_STATUS_IS_OK(result)) {
@@ -1997,7 +1997,7 @@ NTSTATUS cm_connect_sam(struct winbindd_domain *domain, TALLOC_CTX *mem_ctx,
"schannel.\n", domain->name ));
result = rpccli_samr_Connect2(conn->samr_pipe, mem_ctx,
- conn->samr_pipe->cli->desthost,
+ conn->samr_pipe->desthost,
SEC_RIGHTS_MAXIMUM_ALLOWED,
&conn->sam_connect_handle);
if (NT_STATUS_IS_OK(result)) {
@@ -2020,7 +2020,7 @@ NTSTATUS cm_connect_sam(struct winbindd_domain *domain, TALLOC_CTX *mem_ctx,
}
result = rpccli_samr_Connect2(conn->samr_pipe, mem_ctx,
- conn->samr_pipe->cli->desthost,
+ conn->samr_pipe->desthost,
SEC_RIGHTS_MAXIMUM_ALLOWED,
&conn->sam_connect_handle);
if (!NT_STATUS_IS_OK(result)) {