summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJeremy Allison <jra@samba.org>2000-05-05 20:50:22 +0000
committerJeremy Allison <jra@samba.org>2000-05-05 20:50:22 +0000
commit6d9ce383061782b888f4b3403099a3c2c34b1a4c (patch)
tree60c22c6e516ee4bbb5f3faed85dc1a226e5f0919
parent652d98c0bc22b761de72d0ce9c5a5f96412453fe (diff)
downloadsamba-6d9ce383061782b888f4b3403099a3c2c34b1a4c.tar.gz
samba-6d9ce383061782b888f4b3403099a3c2c34b1a4c.tar.bz2
samba-6d9ce383061782b888f4b3403099a3c2c34b1a4c.zip
Fix for uninitialized memory read in brlock code. brl_locktest now needs
to correctly set the fnum, as the brl_conflict code looks at it. Jeremy. (This used to be commit df87259a356b91989604a10b3691480dcd16cf3f)
-rw-r--r--source3/include/proto.h2
-rw-r--r--source3/locking/brlock.c3
-rw-r--r--source3/locking/locking.c2
3 files changed, 4 insertions, 3 deletions
diff --git a/source3/include/proto.h b/source3/include/proto.h
index 9487f4254c..146775bd2a 100644
--- a/source3/include/proto.h
+++ b/source3/include/proto.h
@@ -823,7 +823,7 @@ BOOL brl_lock(SMB_DEV_T dev, SMB_INO_T ino, int fnum,
BOOL brl_unlock(SMB_DEV_T dev, SMB_INO_T ino, int fnum,
uint16 smbpid, pid_t pid, uint16 tid,
br_off start, br_off size);
-BOOL brl_locktest(SMB_DEV_T dev, SMB_INO_T ino,
+BOOL brl_locktest(SMB_DEV_T dev, SMB_INO_T ino, int fnum,
uint16 smbpid, pid_t pid, uint16 tid,
br_off start, br_off size,
enum brl_type lock_type);
diff --git a/source3/locking/brlock.c b/source3/locking/brlock.c
index 51f3175dbf..78a9174141 100644
--- a/source3/locking/brlock.c
+++ b/source3/locking/brlock.c
@@ -300,7 +300,7 @@ smbpid = %u, pid = %u, tid = %u\n",
Test if we could add a lock if we wanted to.
****************************************************************************/
-BOOL brl_locktest(SMB_DEV_T dev, SMB_INO_T ino,
+BOOL brl_locktest(SMB_DEV_T dev, SMB_INO_T ino, int fnum,
uint16 smbpid, pid_t pid, uint16 tid,
br_off start, br_off size,
enum brl_type lock_type)
@@ -325,6 +325,7 @@ BOOL brl_locktest(SMB_DEV_T dev, SMB_INO_T ino,
lock.context.tid = tid;
lock.start = start;
lock.size = size;
+ lock.fnum = fnum;
lock.lock_type = lock_type;
if (dbuf.dptr) {
diff --git a/source3/locking/locking.c b/source3/locking/locking.c
index 47ae917f9a..07411e8919 100644
--- a/source3/locking/locking.c
+++ b/source3/locking/locking.c
@@ -68,7 +68,7 @@ BOOL is_locked(files_struct *fsp,connection_struct *conn,
if (!lp_locking(snum) || !lp_strict_locking(snum))
return(False);
- ret = !brl_locktest(fsp->dev, fsp->inode,
+ ret = !brl_locktest(fsp->dev, fsp->inode, fsp->fnum,
global_smbpid, sys_getpid(), conn->cnum,
offset, count, lock_type);