From 6bad53f758437938ee9b1cbdd34d1b74a1c522dd Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Thu, 13 Jan 2000 12:08:53 +0000 Subject: the lock routines now take a enumerated type for read/write locks, and we now don't pass the lock type at all for unlocks. I was surprised to discover that NT totally ignores the lock type in unlocks. It unlocks a matching write lock if there is one, otherwise it removes the first matching read lock. (This used to be commit 1bbc1ce18b8ccb92b5a78ee648539a591a452118) --- source3/libsmb/clientgen.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'source3/libsmb/clientgen.c') diff --git a/source3/libsmb/clientgen.c b/source3/libsmb/clientgen.c index bf610a7ff7..06a5e5427f 100644 --- a/source3/libsmb/clientgen.c +++ b/source3/libsmb/clientgen.c @@ -1345,7 +1345,7 @@ BOOL cli_close(struct cli_state *cli, int fnum) lock a file ****************************************************************************/ BOOL cli_lock(struct cli_state *cli, int fnum, - uint32 offset, uint32 len, int timeout, int locktype) + uint32 offset, uint32 len, int timeout, enum lock_type lock_type) { char *p; int saved_timeout = cli->timeout; @@ -1361,7 +1361,7 @@ BOOL cli_lock(struct cli_state *cli, int fnum, CVAL(cli->outbuf,smb_vwv0) = 0xFF; SSVAL(cli->outbuf,smb_vwv2,fnum); - CVAL(cli->outbuf,smb_vwv3) = (locktype == F_RDLCK? 1 : 0); + CVAL(cli->outbuf,smb_vwv3) = (lock_type == READ_LOCK? 1 : 0); SIVALS(cli->outbuf, smb_vwv4, timeout); SSVAL(cli->outbuf,smb_vwv6,0); SSVAL(cli->outbuf,smb_vwv7,1); @@ -1392,7 +1392,7 @@ BOOL cli_lock(struct cli_state *cli, int fnum, unlock a file ****************************************************************************/ BOOL cli_unlock(struct cli_state *cli, int fnum, - uint32 offset, uint32 len, int timeout, int locktype) + uint32 offset, uint32 len, int timeout) { char *p; @@ -1407,7 +1407,7 @@ BOOL cli_unlock(struct cli_state *cli, int fnum, CVAL(cli->outbuf,smb_vwv0) = 0xFF; SSVAL(cli->outbuf,smb_vwv2,fnum); - CVAL(cli->outbuf,smb_vwv3) = (locktype == F_RDLCK? 1 : 0); + CVAL(cli->outbuf,smb_vwv3) = 0; SIVALS(cli->outbuf, smb_vwv4, timeout); SSVAL(cli->outbuf,smb_vwv6,1); SSVAL(cli->outbuf,smb_vwv7,0); -- cgit