summaryrefslogtreecommitdiff
path: root/source3/utils
diff options
context:
space:
mode:
authorVolker Lendecke <vl@samba.org>2008-04-19 21:56:43 +0200
committerVolker Lendecke <vl@samba.org>2008-04-20 00:13:09 +0200
commit2a2188591b5ed922d09dc723adcf10f8b8f5e5a0 (patch)
treeaa3b8b649ba54fc0bff9898355e861c225b33b49 /source3/utils
parentb46d340fd5d7e88684ac77000e17c1899ff608b2 (diff)
downloadsamba-2a2188591b5ed922d09dc723adcf10f8b8f5e5a0.tar.gz
samba-2a2188591b5ed922d09dc723adcf10f8b8f5e5a0.tar.bz2
samba-2a2188591b5ed922d09dc723adcf10f8b8f5e5a0.zip
Add "desthost" to rpc_pipe_client
This reduces the dependency on cli_state (This used to be commit 783afab9c891dd7bcb78895b2a639b6f3a0edf5b)
Diffstat (limited to 'source3/utils')
-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
6 files changed, 40 insertions, 39 deletions
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,