summaryrefslogtreecommitdiff
path: root/source3/libsmb/clientgen.c
diff options
context:
space:
mode:
authorJeremy Allison <jra@samba.org>1998-10-16 00:54:16 +0000
committerJeremy Allison <jra@samba.org>1998-10-16 00:54:16 +0000
commit070b33489179d07ed76530ad52b828e6e708789d (patch)
treed5c58264420d93421d0caa1522514ab02b4a38ba /source3/libsmb/clientgen.c
parent1bcbc67767e68ae12533c1ea44e2c0a567e4c93c (diff)
downloadsamba-070b33489179d07ed76530ad52b828e6e708789d.tar.gz
samba-070b33489179d07ed76530ad52b828e6e708789d.tar.bz2
samba-070b33489179d07ed76530ad52b828e6e708789d.zip
trans2.h: Added Thursby MAC extension.
smbd/trans2.c: Added Thursby MAX extension. libsmb/clientgen.c: Fixed smbtorture lock code. Jeremy. (This used to be commit 514e52e4b4d6c7db7ebe2265e60c77b4f18d11b3)
Diffstat (limited to 'source3/libsmb/clientgen.c')
-rw-r--r--source3/libsmb/clientgen.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/source3/libsmb/clientgen.c b/source3/libsmb/clientgen.c
index a6ffb57834..3c2ad3e0ea 100644
--- a/source3/libsmb/clientgen.c
+++ b/source3/libsmb/clientgen.c
@@ -1126,6 +1126,7 @@ BOOL cli_close(struct cli_state *cli, int fnum)
BOOL cli_lock(struct cli_state *cli, int fnum, uint32 offset, uint32 len, int timeout)
{
char *p;
+ int saved_timeout = cli->timeout;
bzero(cli->outbuf,smb_size);
bzero(cli->inbuf,smb_size);
@@ -1149,10 +1150,16 @@ BOOL cli_lock(struct cli_state *cli, int fnum, uint32 offset, uint32 len, int ti
SIVAL(p, 6, len);
send_smb(cli->fd,cli->outbuf);
+
+ cli->timeout = (timeout == -1) ? 0x7FFFFFFF : timeout;
+
if (!client_receive_smb(cli->fd,cli->inbuf,cli->timeout)) {
+ cli->timeout = saved_timeout;
return False;
}
+ cli->timeout = saved_timeout;
+
if (CVAL(cli->inbuf,smb_rcls) != 0) {
return False;
}
@@ -1315,6 +1322,7 @@ static void cli_issue_write(struct cli_state *cli, int fnum, off_t offset, uint1
CVAL(cli->outbuf,smb_vwv0) = 0xFF;
SSVAL(cli->outbuf,smb_vwv2,fnum);
+
SIVAL(cli->outbuf,smb_vwv3,offset);
SIVAL(cli->outbuf,smb_vwv5,IS_BITS_SET_ALL(mode, 0x0008) ? 0xFFFFFFFF : 0);
SSVAL(cli->outbuf,smb_vwv7,mode);