summaryrefslogtreecommitdiff
path: root/source3/libsmb
diff options
context:
space:
mode:
authorJeremy Allison <jra@samba.org>1997-11-30 02:58:34 +0000
committerJeremy Allison <jra@samba.org>1997-11-30 02:58:34 +0000
commit15a6097263d4d5179b0eed43ede74fd65a83e090 (patch)
treef0bff05f151fb78509a158daf6bcb7307d39071b /source3/libsmb
parent7da2663f0dbffe5e3c11be9c6c6753720159971e (diff)
downloadsamba-15a6097263d4d5179b0eed43ede74fd65a83e090.tar.gz
samba-15a6097263d4d5179b0eed43ede74fd65a83e090.tar.bz2
samba-15a6097263d4d5179b0eed43ede74fd65a83e090.zip
clientgen.c: Added cli_mv() (used in a recent torture test).
reply.c: Changed reply_open_and_X to split out the oplock request bits from core and extended and if an oplock was granted only set the corresponding bit on reply. server.c: Added code to dynamically allocate i/o buffers in oplock_break (prevents recursion problems) , also made reset of sent_oplock_break explicit. Jeremy. (This used to be commit 16e55ee2b8be9a4210d8cf87691cdf42373759d2)
Diffstat (limited to 'source3/libsmb')
-rw-r--r--source3/libsmb/clientgen.c37
1 files changed, 37 insertions, 0 deletions
diff --git a/source3/libsmb/clientgen.c b/source3/libsmb/clientgen.c
index 1bd55cffe8..69e940845c 100644
--- a/source3/libsmb/clientgen.c
+++ b/source3/libsmb/clientgen.c
@@ -574,6 +574,43 @@ BOOL cli_tdis(struct cli_state *cli)
}
/****************************************************************************
+rename a file
+****************************************************************************/
+BOOL cli_mv(struct cli_state *cli, char *fname_src, char *fname_dst)
+{
+ char *p;
+
+ bzero(cli->outbuf,smb_size);
+ bzero(cli->inbuf,smb_size);
+
+ set_message(cli->outbuf,1, 4 + strlen(fname_src) + strlen(fname_dst), True);
+
+ CVAL(cli->outbuf,smb_com) = SMBmv;
+ SSVAL(cli->outbuf,smb_tid,cli->cnum);
+ cli_setup_packet(cli);
+
+ SSVAL(cli->outbuf,smb_vwv0,aSYSTEM | aHIDDEN);
+
+ p = smb_buf(cli->outbuf);
+ *p++ = 4;
+ strcpy(p,fname_src);
+ p = skip_string(p,1);
+ *p++ = 4;
+ strcpy(p,fname_dst);
+
+ send_smb(cli->fd,cli->outbuf);
+ if (!receive_smb(cli->fd,cli->inbuf,cli->timeout)) {
+ return False;
+ }
+
+ if (CVAL(cli->inbuf,smb_rcls) != 0) {
+ return False;
+ }
+
+ return True;
+}
+
+/****************************************************************************
delete a file
****************************************************************************/
BOOL cli_unlink(struct cli_state *cli, char *fname)