summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrew Tridgell <tridge@samba.org>2001-02-20 12:49:55 +0000
committerAndrew Tridgell <tridge@samba.org>2001-02-20 12:49:55 +0000
commitc28d3f635887c22713221d2df3c7aee5b53dc613 (patch)
tree7c20c0417f3db6125ba0e9bcb04b325a30352797
parent8acf5e04482cb43734fbb786f8d363ee3bfff652 (diff)
downloadsamba-c28d3f635887c22713221d2df3c7aee5b53dc613.tar.gz
samba-c28d3f635887c22713221d2df3c7aee5b53dc613.tar.bz2
samba-c28d3f635887c22713221d2df3c7aee5b53dc613.zip
converted nt_create and setatr
(This used to be commit c40a1e4ebdb379482bf6e7d4efcc9b5321a4e7c6)
-rw-r--r--source3/libsmb/clifile.c19
1 files changed, 10 insertions, 9 deletions
diff --git a/source3/libsmb/clifile.c b/source3/libsmb/clifile.c
index 10b6a9e543..199fd831c0 100644
--- a/source3/libsmb/clifile.c
+++ b/source3/libsmb/clifile.c
@@ -176,7 +176,7 @@ int cli_nt_create(struct cli_state *cli, char *fname, uint32 DesiredAccess)
memset(cli->outbuf,'\0',smb_size);
memset(cli->inbuf,'\0',smb_size);
- set_message(cli->outbuf,24,1 + strlen(fname),True);
+ set_message(cli->outbuf,24,0,True);
CVAL(cli->outbuf,smb_com) = SMBntcreateX;
SSVAL(cli->outbuf,smb_tid,cli->cnum);
@@ -197,9 +197,9 @@ int cli_nt_create(struct cli_state *cli, char *fname, uint32 DesiredAccess)
SSVAL(cli->outbuf,smb_ntcreate_NameLength, strlen(fname));
p = smb_buf(cli->outbuf);
- pstrcpy(p,fname);
- unix_to_dos(p,True);
- p = skip_string(p,1);
+ p += clistr_push(cli, p, fname, -1, CLISTR_TERMINATE | CLISTR_CONVERT);
+
+ cli_setup_bcc(cli, p);
cli_send_smb(cli);
if (!cli_receive_smb(cli)) {
@@ -623,16 +623,17 @@ BOOL cli_getatr(struct cli_state *cli, char *fname,
memset(cli->outbuf,'\0',smb_size);
memset(cli->inbuf,'\0',smb_size);
- set_message(cli->outbuf,0,strlen(fname)+2,True);
+ set_message(cli->outbuf,0,0,True);
CVAL(cli->outbuf,smb_com) = SMBgetatr;
SSVAL(cli->outbuf,smb_tid,cli->cnum);
cli_setup_packet(cli);
p = smb_buf(cli->outbuf);
- *p = 4;
- pstrcpy(p+1, fname);
- unix_to_dos(p+1,True);
+ *p++ = 4;
+ p += clistr_push(cli, p, fname, -1, CLISTR_TERMINATE | CLISTR_CONVERT);
+
+ cli_setup_bcc(cli, p);
cli_send_smb(cli);
if (!cli_receive_smb(cli)) {
@@ -682,7 +683,7 @@ BOOL cli_setatr(struct cli_state *cli, char *fname, uint16 attr, time_t t)
p = smb_buf(cli->outbuf);
*p = 4;
pstrcpy(p+1, fname);
- unix_to_dos(p+1,True);
+ unix_to_dos(p+1,True);
p = skip_string(p,1);
*p = 4;