summaryrefslogtreecommitdiff
path: root/source3
diff options
context:
space:
mode:
authorAndrew Tridgell <tridge@samba.org>2000-01-13 12:08:53 +0000
committerAndrew Tridgell <tridge@samba.org>2000-01-13 12:08:53 +0000
commit6bad53f758437938ee9b1cbdd34d1b74a1c522dd (patch)
tree4e20d284a399c8a9c3445d2bbbdf59f5ba8d29a5 /source3
parent415e3c0cec198ee94710c3344766bf9273cdefd8 (diff)
downloadsamba-6bad53f758437938ee9b1cbdd34d1b74a1c522dd.tar.gz
samba-6bad53f758437938ee9b1cbdd34d1b74a1c522dd.tar.bz2
samba-6bad53f758437938ee9b1cbdd34d1b74a1c522dd.zip
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)
Diffstat (limited to 'source3')
-rw-r--r--source3/libsmb/clientgen.c8
1 files changed, 4 insertions, 4 deletions
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);