converted cli_mkdir()
authorAndrew Tridgell <tridge@samba.org>
Tue, 20 Feb 2001 10:19:02 +0000 (10:19 +0000)
committerAndrew Tridgell <tridge@samba.org>
Tue, 20 Feb 2001 10:19:02 +0000 (10:19 +0000)
(This used to be commit bce3ed01a9c3c7c89cdc21b60f1122dc6b6db264)

source3/libsmb/clifile.c

index ce9a79ede34fb4d42f27243f05025cec4d45063f..ab16b215647f0aea8b30aceb94b2c588d492c189 100644 (file)
@@ -107,7 +107,7 @@ BOOL cli_mkdir(struct cli_state *cli, char *dname)
        memset(cli->outbuf,'\0',smb_size);
        memset(cli->inbuf,'\0',smb_size);
 
-       set_message(cli->outbuf,0, 2 + strlen(dname),True);
+       set_message(cli->outbuf,0, 0,True);
 
        CVAL(cli->outbuf,smb_com) = SMBmkdir;
        SSVAL(cli->outbuf,smb_tid,cli->cnum);
@@ -115,8 +115,9 @@ BOOL cli_mkdir(struct cli_state *cli, char *dname)
 
        p = smb_buf(cli->outbuf);
        *p++ = 4;      
-       pstrcpy(p,dname);
-    unix_to_dos(p,True);
+       p += clistr_push(cli, p, dname, -1, CLISTR_CONVERT|CLISTR_TERMINATE);
+
+       set_message(cli->outbuf,0, PTR_DIFF(p, smb_buf(cli->outbuf)), False);
 
        cli_send_smb(cli);
        if (!cli_receive_smb(cli)) {