summaryrefslogtreecommitdiff
path: root/source3/rpc_client
diff options
context:
space:
mode:
authorLuke Leighton <lkcl@samba.org>1998-10-09 19:34:57 +0000
committerLuke Leighton <lkcl@samba.org>1998-10-09 19:34:57 +0000
commit4e004a0b5e7521a361444f6d67a3c2910c5688c2 (patch)
treeadf7366300306ca62e405ad45441f3e0036a34f9 /source3/rpc_client
parent755986764f5a6b0ec25c7f20fde0a80eb4d121ba (diff)
downloadsamba-4e004a0b5e7521a361444f6d67a3c2910c5688c2.tar.gz
samba-4e004a0b5e7521a361444f6d67a3c2910c5688c2.tar.bz2
samba-4e004a0b5e7521a361444f6d67a3c2910c5688c2.zip
basic client-side ntcreateX function (hard-wired values except filename)
(This used to be commit caeb99201a1471bd709b4e8f07c57e5caabf0795)
Diffstat (limited to 'source3/rpc_client')
-rw-r--r--source3/rpc_client/cli_pipe.c39
1 files changed, 27 insertions, 12 deletions
diff --git a/source3/rpc_client/cli_pipe.c b/source3/rpc_client/cli_pipe.c
index 761f23f885..0b9a4e95e5 100644
--- a/source3/rpc_client/cli_pipe.c
+++ b/source3/rpc_client/cli_pipe.c
@@ -863,22 +863,37 @@ BOOL cli_nt_session_open(struct cli_state *cli, char *pipe_name, BOOL encrypted)
int fnum;
/******************* open the pipe *****************/
- if ((fnum = cli_open(cli, pipe_name, O_CREAT|O_RDWR, DENY_NONE)) == -1)
+ if (IS_BITS_SET_ALL(cli->capabilities, CAP_NT_SMBS))
{
- 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;
+ if ((fnum = cli_nt_create(cli, &(pipe_name[5]))) == -1)
+ {
+ DEBUG(0,("cli_nt_session_open: cli_nt_create failed on pipe %s to machine %s. Error was %s\n",
+ &(pipe_name[5]), cli->desthost, cli_errstr(cli)));
+ return False;
+ }
+
+ cli->nt_pipe_fnum = (uint16)fnum;
}
+ else
+ {
+ if ((fnum = cli_open(cli, pipe_name, O_CREAT|O_RDWR, DENY_NONE)) == -1)
+ {
+ 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;
+ }
- cli->nt_pipe_fnum = (uint16)fnum;
+ cli->nt_pipe_fnum = (uint16)fnum;
+
+ /**************** Set Named Pipe State ***************/
+ if (!rpc_pipe_set_hnd_state(cli, pipe_name, 0x4300))
+ {
+ 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;
+ }
- /**************** Set Named Pipe State ***************/
- if (!rpc_pipe_set_hnd_state(cli, pipe_name, 0x4300))
- {
- 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 *****************/