diff options
author | Andrew Tridgell <tridge@samba.org> | 2000-01-13 12:08:53 +0000 |
---|---|---|
committer | Andrew Tridgell <tridge@samba.org> | 2000-01-13 12:08:53 +0000 |
commit | 6bad53f758437938ee9b1cbdd34d1b74a1c522dd (patch) | |
tree | 4e20d284a399c8a9c3445d2bbbdf59f5ba8d29a5 | |
parent | 415e3c0cec198ee94710c3344766bf9273cdefd8 (diff) | |
download | samba-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)
-rw-r--r-- | source3/libsmb/clientgen.c | 8 |
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); |