diff options
author | Andrew Tridgell <tridge@samba.org> | 2001-02-20 12:30:01 +0000 |
---|---|---|
committer | Andrew Tridgell <tridge@samba.org> | 2001-02-20 12:30:01 +0000 |
commit | 20b037b84951368cdac7fb65cd77aee0aeae9b37 (patch) | |
tree | e60d55101b90f13bd9db324a283e086e7b58896c | |
parent | d4b2639c00c17ad98d038e7974b1b1eddd541e0e (diff) | |
download | samba-20b037b84951368cdac7fb65cd77aee0aeae9b37.tar.gz samba-20b037b84951368cdac7fb65cd77aee0aeae9b37.tar.bz2 samba-20b037b84951368cdac7fb65cd77aee0aeae9b37.zip |
converted cli_open()
(This used to be commit db60c0c26242be0370e6459fe6f1634c97b61176)
-rw-r--r-- | source3/libsmb/clifile.c | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/source3/libsmb/clifile.c b/source3/libsmb/clifile.c index 0cfe168f43..8dc16c3f66 100644 --- a/source3/libsmb/clifile.c +++ b/source3/libsmb/clifile.c @@ -141,7 +141,7 @@ BOOL cli_rmdir(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) = SMBrmdir; SSVAL(cli->outbuf,smb_tid,cli->cnum); @@ -149,8 +149,9 @@ BOOL cli_rmdir(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_TERMINATE|CLISTR_CONVERT); + + set_message(cli->outbuf,0, PTR_DIFF(p, smb_buf(cli->outbuf)), False); cli_send_smb(cli); if (!cli_receive_smb(cli)) { @@ -301,7 +302,7 @@ int cli_open(struct cli_state *cli, char *fname, int flags, int share_mode) memset(cli->outbuf,'\0',smb_size); memset(cli->inbuf,'\0',smb_size); - set_message(cli->outbuf,15,1 + strlen(fname),True); + set_message(cli->outbuf,15,0,True); CVAL(cli->outbuf,smb_com) = SMBopenX; SSVAL(cli->outbuf,smb_tid,cli->cnum); @@ -323,9 +324,9 @@ int cli_open(struct cli_state *cli, char *fname, int flags, int share_mode) } 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); + + set_message(cli->outbuf,15, PTR_DIFF(p, smb_buf(cli->outbuf)), False); cli_send_smb(cli); if (!cli_receive_smb(cli)) { |