summaryrefslogtreecommitdiffstats
path: root/source3/rpc_client/cli_pipe.c
diff options
context:
space:
mode:
authorJeremy Allison <jra@samba.org>1998-04-29 19:22:01 +0000
committerJeremy Allison <jra@samba.org>1998-04-29 19:22:01 +0000
commite305c2c9e2e657974d34d1d58a8f9372921fdae2 (patch)
treecf35e6a21e2ba4cdc00539c24cb41b229b55a06b /source3/rpc_client/cli_pipe.c
parent4eb37c104d3a23ecefcefe9038de5d10515078dd (diff)
downloadsamba-e305c2c9e2e657974d34d1d58a8f9372921fdae2.tar.gz
samba-e305c2c9e2e657974d34d1d58a8f9372921fdae2.tar.xz
samba-e305c2c9e2e657974d34d1d58a8f9372921fdae2.zip
clientgen.c: Fixed null session setup bug.
password.c: Stopped cli_nt_logout call (we don't have it correct yet). Added Luke object-orientation fix :-). smb.h: Added clnt_name_slash to cli_state. lib/rpc/client/cli_login.c: Changed global_myname to clnt_name_slash where needed. lib/rpc/client/cli_netlogon.c: Fixed debug messages, don't check creds on error. lib/rpc/client/cli_pipe.c: Fixed debug messages, Added Luke object-orientation fix. lib/rpc/parse/parse_misc.c: Fixed STRING2 linearization bug that was adding 1. Jeremy. (This used to be commit c6c22df20196cb7f0ae84b1a1dd202a87adb8d4e)
Diffstat (limited to 'source3/rpc_client/cli_pipe.c')
-rw-r--r--source3/rpc_client/cli_pipe.c24
1 files changed, 15 insertions, 9 deletions
diff --git a/source3/rpc_client/cli_pipe.c b/source3/rpc_client/cli_pipe.c
index 4058538f21f..3076df3bb77 100644
--- a/source3/rpc_client/cli_pipe.c
+++ b/source3/rpc_client/cli_pipe.c
@@ -124,7 +124,7 @@ static BOOL rpc_check_hdr(prs_struct *rdata, uint8 *pkt_type,
if (!rdata->offset || rdata->offset != 0x10)
{
- DEBUG(5,("cli_pipe: error in rpc header\n"));
+ DEBUG(0,("cli_pipe: error in rpc header\n"));
return False;
}
@@ -199,7 +199,7 @@ BOOL rpc_api_pipe(struct cli_state *cli, uint16 cmd,
pp_ret_params, p_ret_params_len, /* return params, len */
pp_ret_data, p_ret_data_len)) /* return data, len */
{
- DEBUG(5, ("cli_pipe: return critical error\n"));
+ DEBUG(0, ("cli_pipe: return critical error. Error was %s\n", cli_errstr(cli)));
return False;
}
@@ -273,7 +273,7 @@ BOOL rpc_api_pipe(struct cli_state *cli, uint16 cmd,
if (first)
{
- DEBUG(4,("rpc_api_pipe: wierd rpc header received\n"));
+ DEBUG(0,("rpc_api_pipe: wierd rpc header received\n"));
return False;
}
@@ -558,7 +558,7 @@ static BOOL check_bind_response(RPC_HDR_BA *hdr_ba, char *pipe_name, RPC_IFACE *
(memcmp(hdr_ba->transfer.data, transfer->data,
sizeof(transfer->version)) ==0)))
{
- DEBUG(2,("bind_rpc_pipe: transfer syntax differs\n"));
+ DEBUG(0,("bind_rpc_pipe: transfer syntax differs\n"));
return False;
}
@@ -647,8 +647,8 @@ BOOL cli_nt_session_open(struct cli_state *cli, char *pipe_name, BOOL encrypted)
/******************* open the pipe *****************/
if ((fnum = cli_open(cli, pipe_name, O_CREAT|O_RDWR, DENY_NONE)) == -1)
{
- DEBUG(1,("do_session_open: cli_open failed on pipe %s to machine %s. \
-Error was %s.\n", pipe_name, cli->desthost, cli_errstr(cli)));
+ DEBUG(0,("cli_nt_session_open: cli_open failed on pipe %s to machine %s. \
+Error was %s\n", pipe_name, cli->desthost, cli_errstr(cli)));
return False;
}
@@ -657,14 +657,17 @@ Error was %s.\n", pipe_name, cli->desthost, cli_errstr(cli)));
/**************** Set Named Pipe State ***************/
if (!rpc_pipe_set_hnd_state(cli, pipe_name, 0x4300))
{
- DEBUG(1,("do_session_open: pipe hnd state failed.\n"));
+ DEBUG(0,("cli_nt_session_open: pipe hnd state failed. Error was %s\n",
+ cli_errstr(cli)));
+ cli_close(cli, cli->nt_pipe_fnum);
return False;
}
/******************* bind request on pipe *****************/
if (!rpc_pipe_bind(cli, pipe_name, &abstract, &transfer, encrypted))
{
- DEBUG(1,("do_session_open: rpc bind failed.\n"));
+ DEBUG(0,("cli_nt_session_open: rpc bind failed. Error was %s\n", cli_errstr(cli)));
+ cli_close(cli, cli->nt_pipe_fnum);
return False;
}
@@ -675,6 +678,9 @@ Error was %s.\n", pipe_name, cli->desthost, cli_errstr(cli)));
sprintf(cli->srv_name_slash, "\\\\%s", cli->desthost);
strupper(cli->srv_name_slash);
+ sprintf(cli->clnt_name_slash, "\\\\%s", global_myname);
+ strupper(cli->clnt_name_slash);
+
sprintf(cli->mach_acct, "%s$", global_myname);
strupper(cli->mach_acct);
@@ -685,7 +691,7 @@ Error was %s.\n", pipe_name, cli->desthost, cli_errstr(cli)));
close the session
****************************************************************************/
-void nt_session_close(struct cli_state *cli)
+void cli_nt_session_close(struct cli_state *cli)
{
cli_close(cli, cli->nt_pipe_fnum);
}