summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVolker Lendecke <vl@samba.org>2008-04-19 23:03:16 +0200
committerVolker Lendecke <vl@samba.org>2008-04-20 00:14:13 +0200
commit9048cafbeaf82d1916de6538024fd660612dd25f (patch)
treed7d2c803aa474b97273b339f1b578f0e9591bac2
parent4c857010e7113d99028cf8d7fac5e5b95c400fb3 (diff)
downloadsamba-9048cafbeaf82d1916de6538024fd660612dd25f.tar.gz
samba-9048cafbeaf82d1916de6538024fd660612dd25f.tar.bz2
samba-9048cafbeaf82d1916de6538024fd660612dd25f.zip
Move srv_name_slash from cli_state to rpc_pipe_client
(This used to be commit a9061e52e1ff8e31aa480f4a30cda64c9d93214e)
-rw-r--r--source3/include/client.h2
-rw-r--r--source3/libsmb/cliconnect.c2
-rw-r--r--source3/rpc_client/cli_lsarpc.c2
-rw-r--r--source3/rpc_client/cli_pipe.c7
-rw-r--r--source3/rpc_client/cli_samr.c12
-rw-r--r--source3/rpcclient/cmd_srvsvc.c2
-rw-r--r--source3/utils/net_rpc_service.c12
7 files changed, 22 insertions, 17 deletions
diff --git a/source3/include/client.h b/source3/include/client.h
index 02575e4109..af03e2bb60 100644
--- a/source3/include/client.h
+++ b/source3/include/client.h
@@ -67,6 +67,7 @@ struct rpc_pipe_client {
uint16 fnum;
const char *desthost;
+ const char *srv_name_slash;
const char *domain;
const char *user_name;
@@ -123,7 +124,6 @@ struct cli_state {
int privileges;
fstring desthost;
- fstring srv_name_slash;
/* The credentials used to open the cli_state connection. */
fstring domain;
diff --git a/source3/libsmb/cliconnect.c b/source3/libsmb/cliconnect.c
index 949bca747d..7d3d246da5 100644
--- a/source3/libsmb/cliconnect.c
+++ b/source3/libsmb/cliconnect.c
@@ -1492,8 +1492,6 @@ NTSTATUS cli_connect(struct cli_state *cli,
}
fstrcpy(cli->desthost, host);
- fstr_sprintf(cli->srv_name_slash, "\\\\%s", cli->desthost);
- strupper_m(cli->srv_name_slash);
/* allow hostnames of the form NAME#xx and do a netbios lookup */
if ((p = strchr(cli->desthost, '#'))) {
diff --git a/source3/rpc_client/cli_lsarpc.c b/source3/rpc_client/cli_lsarpc.c
index 37387a04dd..a799f9221d 100644
--- a/source3/rpc_client/cli_lsarpc.c
+++ b/source3/rpc_client/cli_lsarpc.c
@@ -108,7 +108,7 @@ NTSTATUS rpccli_lsa_open_policy2(struct rpc_pipe_client *cli,
}
return rpccli_lsa_OpenPolicy2(cli, mem_ctx,
- cli->cli->srv_name_slash,
+ cli->srv_name_slash,
&attr,
des_access,
pol);
diff --git a/source3/rpc_client/cli_pipe.c b/source3/rpc_client/cli_pipe.c
index 6465228f18..3ef3f05cc6 100644
--- a/source3/rpc_client/cli_pipe.c
+++ b/source3/rpc_client/cli_pipe.c
@@ -2234,6 +2234,13 @@ static struct rpc_pipe_client *cli_rpc_pipe_open(struct cli_state *cli, int pipe
return NULL;
}
+ result->srv_name_slash = talloc_asprintf_strupper_m(
+ result, "\\\\%s", result->desthost);
+ if (result->srv_name_slash == 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_samr.c b/source3/rpc_client/cli_samr.c
index fd4fbfc9f4..21fecc4196 100644
--- a/source3/rpc_client/cli_samr.c
+++ b/source3/rpc_client/cli_samr.c
@@ -45,7 +45,7 @@ NTSTATUS rpccli_samr_chgpasswd_user(struct rpc_pipe_client *cli,
DEBUG(10,("rpccli_samr_chgpasswd_user\n"));
- init_lsa_String(&server, cli->cli->srv_name_slash);
+ init_lsa_String(&server, cli->srv_name_slash);
init_lsa_String(&account, username);
/* Calculate the MD4 hash (NT compatible) of the password */
@@ -105,7 +105,7 @@ NTSTATUS rpccli_samr_chng_pswd_auth_crap(struct rpc_pipe_client *cli,
DEBUG(10,("rpccli_samr_chng_pswd_auth_crap\n"));
- init_lsa_String(&server, cli->cli->srv_name_slash);
+ init_lsa_String(&server, cli->srv_name_slash);
init_lsa_String(&account, username);
memcpy(&new_nt_password.data, new_nt_password_blob.data, 516);
@@ -151,7 +151,7 @@ NTSTATUS rpccli_samr_chgpasswd3(struct rpc_pipe_client *cli,
DEBUG(10,("rpccli_samr_chgpasswd_user3\n"));
- init_lsa_String(&server, cli->cli->srv_name_slash);
+ init_lsa_String(&server, cli->srv_name_slash);
init_lsa_String(&account, username);
/* Calculate the MD4 hash (NT compatible) of the password */
@@ -242,7 +242,7 @@ NTSTATUS rpccli_try_samr_connects(struct rpc_pipe_client *cli,
info_in.info1 = info1;
status = rpccli_samr_Connect5(cli, mem_ctx,
- cli->cli->srv_name_slash,
+ cli->srv_name_slash,
access_mask,
1,
&info_in,
@@ -254,7 +254,7 @@ NTSTATUS rpccli_try_samr_connects(struct rpc_pipe_client *cli,
}
status = rpccli_samr_Connect4(cli, mem_ctx,
- cli->cli->srv_name_slash,
+ cli->srv_name_slash,
SAMR_CONNECT_W2K,
access_mask,
connect_pol);
@@ -263,7 +263,7 @@ NTSTATUS rpccli_try_samr_connects(struct rpc_pipe_client *cli,
}
status = rpccli_samr_Connect2(cli, mem_ctx,
- cli->cli->srv_name_slash,
+ cli->srv_name_slash,
access_mask,
connect_pol);
return status;
diff --git a/source3/rpcclient/cmd_srvsvc.c b/source3/rpcclient/cmd_srvsvc.c
index 7709d47e49..9efd4c9792 100644
--- a/source3/rpcclient/cmd_srvsvc.c
+++ b/source3/rpcclient/cmd_srvsvc.c
@@ -525,7 +525,7 @@ static WERROR cmd_srvsvc_net_remote_tod(struct rpc_pipe_client *cli,
}
status = rpccli_srvsvc_NetRemoteTOD(cli, mem_ctx,
- cli->cli->srv_name_slash,
+ cli->srv_name_slash,
&tod,
&result);
if (!NT_STATUS_IS_OK(status)) {
diff --git a/source3/utils/net_rpc_service.c b/source3/utils/net_rpc_service.c
index 1b12bd3114..b886283adc 100644
--- a/source3/utils/net_rpc_service.c
+++ b/source3/utils/net_rpc_service.c
@@ -213,7 +213,7 @@ static NTSTATUS rpc_service_list_internal(const DOM_SID *domain_sid,
}
status = rpccli_svcctl_OpenSCManagerW(pipe_hnd, mem_ctx,
- pipe_hnd->cli->srv_name_slash,
+ pipe_hnd->srv_name_slash,
NULL,
SC_RIGHT_MGR_ENUMERATE_SERVICE,
&hSCM,
@@ -272,7 +272,7 @@ static NTSTATUS rpc_service_status_internal(const DOM_SID *domain_sid,
/* Open the Service Control Manager */
status = rpccli_svcctl_OpenSCManagerW(pipe_hnd, mem_ctx,
- pipe_hnd->cli->srv_name_slash,
+ pipe_hnd->srv_name_slash,
NULL,
SC_RIGHT_MGR_ENUMERATE_SERVICE,
&hSCM,
@@ -384,7 +384,7 @@ static NTSTATUS rpc_service_stop_internal(const DOM_SID *domain_sid,
/* Open the Service Control Manager */
status = rpccli_svcctl_OpenSCManagerW(pipe_hnd, mem_ctx,
- pipe_hnd->cli->srv_name_slash,
+ pipe_hnd->srv_name_slash,
NULL,
SC_RIGHT_MGR_ENUMERATE_SERVICE,
&hSCM,
@@ -427,7 +427,7 @@ static NTSTATUS rpc_service_pause_internal(const DOM_SID *domain_sid,
/* Open the Service Control Manager */
status = rpccli_svcctl_OpenSCManagerW(pipe_hnd, mem_ctx,
- pipe_hnd->cli->srv_name_slash,
+ pipe_hnd->srv_name_slash,
NULL,
SC_RIGHT_MGR_ENUMERATE_SERVICE,
&hSCM,
@@ -470,7 +470,7 @@ static NTSTATUS rpc_service_resume_internal(const DOM_SID *domain_sid,
/* Open the Service Control Manager */
status = rpccli_svcctl_OpenSCManagerW(pipe_hnd, mem_ctx,
- pipe_hnd->cli->srv_name_slash,
+ pipe_hnd->srv_name_slash,
NULL,
SC_RIGHT_MGR_ENUMERATE_SERVICE,
&hSCM,
@@ -511,7 +511,7 @@ static NTSTATUS rpc_service_start_internal(const DOM_SID *domain_sid,
/* Open the Service Control Manager */
status = rpccli_svcctl_OpenSCManagerW(pipe_hnd, mem_ctx,
- pipe_hnd->cli->srv_name_slash,
+ pipe_hnd->srv_name_slash,
NULL,
SC_RIGHT_MGR_ENUMERATE_SERVICE,
&hSCM,