From 070b33489179d07ed76530ad52b828e6e708789d Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Fri, 16 Oct 1998 00:54:16 +0000 Subject: 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) --- source3/libsmb/clientgen.c | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'source3/libsmb') 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); -- cgit