summaryrefslogtreecommitdiff
path: root/source3/rpc_client
diff options
context:
space:
mode:
authorJeremy Allison <jra@samba.org>2002-11-12 23:15:52 +0000
committerJeremy Allison <jra@samba.org>2002-11-12 23:15:52 +0000
commit250c9801197ea1c949bd94c1c891f81ab118b130 (patch)
tree3a0ec79c71a010961d78726e223a70e1bc75c73f /source3/rpc_client
parent477025a6f628fd1a8d3bfacd30726e7a41819e50 (diff)
downloadsamba-250c9801197ea1c949bd94c1c891f81ab118b130.tar.gz
samba-250c9801197ea1c949bd94c1c891f81ab118b130.tar.bz2
samba-250c9801197ea1c949bd94c1c891f81ab118b130.zip
Removed global_myworkgroup, global_myname, global_myscope. Added liberal
dashes of const. This is a rather large check-in, some things may break. It does compile though :-). Jeremy. (This used to be commit 82b8f749a36b42e22186297482aad2abb04fab8a)
Diffstat (limited to 'source3/rpc_client')
-rw-r--r--source3/rpc_client/cli_netlogon.c23
-rw-r--r--source3/rpc_client/cli_pipe.c18
2 files changed, 17 insertions, 24 deletions
diff --git a/source3/rpc_client/cli_netlogon.c b/source3/rpc_client/cli_netlogon.c
index eaee3c26e7..b5ad798755 100644
--- a/source3/rpc_client/cli_netlogon.c
+++ b/source3/rpc_client/cli_netlogon.c
@@ -35,7 +35,6 @@ NTSTATUS cli_net_req_chal(struct cli_state *cli, DOM_CHAL *clnt_chal,
NET_Q_REQ_CHAL q;
NET_R_REQ_CHAL r;
NTSTATUS result = NT_STATUS_UNSUCCESSFUL;
- extern pstring global_myname;
prs_init(&qbuf, MAX_PDU_FRAG_LEN, cli->mem_ctx, MARSHALL);
prs_init(&rbuf, 0, cli->mem_ctx, UNMARSHALL);
@@ -43,10 +42,10 @@ NTSTATUS cli_net_req_chal(struct cli_state *cli, DOM_CHAL *clnt_chal,
/* create and send a MSRPC command with api NET_REQCHAL */
DEBUG(4,("cli_net_req_chal: LSA Request Challenge from %s to %s: %s\n",
- global_myname, cli->desthost, credstr(clnt_chal->data)));
+ global_myname(), cli->desthost, credstr(clnt_chal->data)));
/* store the parameters */
- init_q_req_chal(&q, cli->srv_name_slash, global_myname, clnt_chal);
+ init_q_req_chal(&q, cli->srv_name_slash, global_myname(), clnt_chal);
/* Marshall data and send request */
@@ -92,7 +91,6 @@ NTSTATUS cli_net_auth2(struct cli_state *cli,
NET_Q_AUTH_2 q;
NET_R_AUTH_2 r;
NTSTATUS result = NT_STATUS_UNSUCCESSFUL;
- extern pstring global_myname;
prs_init(&qbuf, MAX_PDU_FRAG_LEN, cli->mem_ctx, MARSHALL);
prs_init(&rbuf, 0, cli->mem_ctx, UNMARSHALL);
@@ -100,12 +98,12 @@ NTSTATUS cli_net_auth2(struct cli_state *cli,
/* create and send a MSRPC command with api NET_AUTH2 */
DEBUG(4,("cli_net_auth2: srv:%s acct:%s sc:%x mc: %s chal %s neg: %x\n",
- cli->srv_name_slash, cli->mach_acct, sec_chan, global_myname,
+ cli->srv_name_slash, cli->mach_acct, sec_chan, global_myname(),
credstr(cli->clnt_cred.challenge.data), neg_flags));
/* store the parameters */
init_q_auth_2(&q, cli->srv_name_slash, cli->mach_acct,
- sec_chan, global_myname, &cli->clnt_cred.challenge,
+ sec_chan, global_myname(), &cli->clnt_cred.challenge,
neg_flags);
/* turn parameters into data stream */
@@ -168,7 +166,6 @@ NTSTATUS cli_net_auth3(struct cli_state *cli,
NET_Q_AUTH_3 q;
NET_R_AUTH_3 r;
NTSTATUS result = NT_STATUS_UNSUCCESSFUL;
- extern pstring global_myname;
prs_init(&qbuf, MAX_PDU_FRAG_LEN, cli->mem_ctx, MARSHALL);
prs_init(&rbuf, 0, cli->mem_ctx, UNMARSHALL);
@@ -176,12 +173,12 @@ NTSTATUS cli_net_auth3(struct cli_state *cli,
/* create and send a MSRPC command with api NET_AUTH2 */
DEBUG(4,("cli_net_auth3: srv:%s acct:%s sc:%x mc: %s chal %s neg: %x\n",
- cli->srv_name_slash, cli->mach_acct, sec_chan, global_myname,
+ cli->srv_name_slash, cli->mach_acct, sec_chan, global_myname(),
credstr(cli->clnt_cred.challenge.data), *neg_flags));
/* store the parameters */
init_q_auth_3(&q, cli->srv_name_slash, cli->mach_acct,
- sec_chan, global_myname, &cli->clnt_cred.challenge,
+ sec_chan, global_myname(), &cli->clnt_cred.challenge,
*neg_flags);
/* turn parameters into data stream */
@@ -500,7 +497,6 @@ NTSTATUS cli_netlogon_sam_logon(struct cli_state *cli, TALLOC_CTX *mem_ctx,
NET_R_SAM_LOGON r;
NTSTATUS result = NT_STATUS_UNSUCCESSFUL;
DOM_CRED clnt_creds, dummy_rtn_creds;
- extern pstring global_myname;
NET_ID_INFO_CTR ctr;
NET_USER_INFO_3 user;
int validation_level = 3;
@@ -562,7 +558,7 @@ NTSTATUS cli_netlogon_sam_logon(struct cli_state *cli, TALLOC_CTX *mem_ctx,
goto done;
}
- init_sam_info(&q.sam_id, cli->srv_name_slash, global_myname,
+ init_sam_info(&q.sam_id, cli->srv_name_slash, global_myname(),
&clnt_creds, &dummy_rtn_creds, logon_type,
&ctr);
@@ -612,7 +608,6 @@ NTSTATUS cli_netlogon_sam_network_logon(struct cli_state *cli, TALLOC_CTX *mem_c
NTSTATUS result = NT_STATUS_UNSUCCESSFUL;
DOM_CRED clnt_creds, dummy_rtn_creds;
NET_ID_INFO_CTR ctr;
- extern pstring global_myname;
int validation_level = 3;
char *workstation_name_slash;
@@ -648,7 +643,7 @@ NTSTATUS cli_netlogon_sam_network_logon(struct cli_state *cli, TALLOC_CTX *mem_c
username, workstation_name_slash, (const uchar*)chal,
lm_response.data, lm_response.length, nt_response.data, nt_response.length);
- init_sam_info(&q.sam_id, cli->srv_name_slash, global_myname,
+ init_sam_info(&q.sam_id, cli->srv_name_slash, global_myname(),
&clnt_creds, &dummy_rtn_creds, NET_LOGON_TYPE,
&ctr);
@@ -683,7 +678,7 @@ LSA Server Password Set.
****************************************************************************/
NTSTATUS cli_net_srv_pwset(struct cli_state *cli, TALLOC_CTX *mem_ctx,
- char* machine_name, uint8 hashed_mach_pwd[16])
+ const char *machine_name, uint8 hashed_mach_pwd[16])
{
prs_struct rbuf;
prs_struct qbuf;
diff --git a/source3/rpc_client/cli_pipe.c b/source3/rpc_client/cli_pipe.c
index f685f38754..90f08148ef 100644
--- a/source3/rpc_client/cli_pipe.c
+++ b/source3/rpc_client/cli_pipe.c
@@ -27,8 +27,6 @@
#define DBGC_CLASS DBGC_RPC_CLI
extern struct pipe_id_info pipe_names[];
-extern fstring global_myworkgroup;
-extern pstring global_myname;
/********************************************************************
Rpc pipe call id.
@@ -546,7 +544,7 @@ static BOOL rpc_api_pipe(struct cli_state *cli, prs_struct *data, prs_struct *rd
static BOOL create_rpc_bind_req(prs_struct *rpc_out, BOOL do_auth, uint32 rpc_call_id,
RPC_IFACE *abstract, RPC_IFACE *transfer,
- char *my_name, char *domain, uint32 neg_flags)
+ const char *my_name, const char *domain, uint32 neg_flags)
{
RPC_HDR hdr;
RPC_HDR_RB hdr_rb;
@@ -640,7 +638,7 @@ static BOOL create_rpc_bind_req(prs_struct *rpc_out, BOOL do_auth, uint32 rpc_ca
********************************************************************/
static BOOL create_rpc_bind_resp(struct pwd_info *pwd,
- char *domain, char *user_name, char *my_name,
+ const char *domain, const char *user_name, const char *my_name,
uint32 ntlmssp_cli_flgs,
uint32 rpc_call_id,
prs_struct *rpc_out)
@@ -1142,7 +1140,7 @@ static BOOL rpc_send_auth_reply(struct cli_state *cli, prs_struct *rdata, uint32
prs_give_memory( &rpc_out, buffer, sizeof(buffer), False);
create_rpc_bind_resp(&cli->pwd, cli->domain,
- cli->user_name, global_myname,
+ cli->user_name, global_myname(),
cli->ntlmssp_cli_flgs, rpc_call_id,
&rpc_out);
@@ -1194,7 +1192,7 @@ static BOOL rpc_send_auth_reply(struct cli_state *cli, prs_struct *rdata, uint32
Do an rpc bind.
****************************************************************************/
-BOOL rpc_pipe_bind(struct cli_state *cli, const int pipe_idx, char *my_name)
+BOOL rpc_pipe_bind(struct cli_state *cli, int pipe_idx, const char *my_name)
{
RPC_IFACE abstract;
RPC_IFACE transfer;
@@ -1225,7 +1223,7 @@ BOOL rpc_pipe_bind(struct cli_state *cli, const int pipe_idx, char *my_name)
/* Marshall the outgoing data. */
create_rpc_bind_req(&rpc_out, do_auth, rpc_call_id,
&abstract, &transfer,
- global_myname, cli->domain, cli->ntlmssp_cli_flgs);
+ global_myname(), cli->domain, cli->ntlmssp_cli_flgs);
/* Initialize the incoming data struct. */
prs_init(&rdata, 0, cli->mem_ctx, UNMARSHALL);
@@ -1320,7 +1318,7 @@ BOOL cli_nt_session_open(struct cli_state *cli, const int pipe_idx)
/******************* bind request on pipe *****************/
- if (!rpc_pipe_bind(cli, pipe_idx, global_myname)) {
+ if (!rpc_pipe_bind(cli, pipe_idx, global_myname())) {
DEBUG(2,("cli_nt_session_open: rpc bind to %s failed\n",
get_pipe_name_from_index(pipe_idx)));
cli_close(cli, cli->nt_pipe_fnum);
@@ -1336,10 +1334,10 @@ BOOL cli_nt_session_open(struct cli_state *cli, const int pipe_idx)
strupper(cli->srv_name_slash);
fstrcpy(cli->clnt_name_slash, "\\\\");
- fstrcat(cli->clnt_name_slash, global_myname);
+ fstrcat(cli->clnt_name_slash, global_myname());
strupper(cli->clnt_name_slash);
- fstrcpy(cli->mach_acct, global_myname);
+ fstrcpy(cli->mach_acct, global_myname());
fstrcat(cli->mach_acct, "$");
strupper(cli->mach_acct);