summaryrefslogtreecommitdiffstats
path: root/source/locking/locking.c
diff options
context:
space:
mode:
authorJeremy Allison <jra@samba.org>2006-05-17 23:15:53 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 11:17:06 -0500
commitfd6fa1d4eaf61783df74ee2da50d331477f06998 (patch)
tree7011e4b9a86d1fc652224fca2b1b9d3c0c804d88 /source/locking/locking.c
parentf66b9701b5c6bb6302fa11889adab6902cbaf2e3 (diff)
downloadsamba-fd6fa1d4eaf61783df74ee2da50d331477f06998.tar.gz
samba-fd6fa1d4eaf61783df74ee2da50d331477f06998.tar.xz
samba-fd6fa1d4eaf61783df74ee2da50d331477f06998.zip
r15668: DOS or FCB opens share one share mode entry from different
fsp pointers. Ensure we cope with this to pass Samba4 DENY tests (we used to pass these, there must have been a regression with newer code). We now pass them. Jeremy
Diffstat (limited to 'source/locking/locking.c')
-rw-r--r--source/locking/locking.c23
1 files changed, 7 insertions, 16 deletions
diff --git a/source/locking/locking.c b/source/locking/locking.c
index 2b6023c0c41..2766b257be2 100644
--- a/source/locking/locking.c
+++ b/source/locking/locking.c
@@ -927,7 +927,7 @@ static void fill_share_mode_entry(struct share_mode_entry *e,
e->op_type = op_type;
e->time.tv_sec = fsp->open_time.tv_sec;
e->time.tv_usec = fsp->open_time.tv_usec;
- e->share_file_id = fsp->file_id;
+ e->share_file_id = fsp->fh->file_id;
e->dev = fsp->dev;
e->inode = fsp->inode;
}
@@ -986,28 +986,19 @@ void add_deferred_open(struct share_mode_lock *lck, uint16 mid,
/*******************************************************************
Check if two share mode entries are identical, ignoring oplock
- and mid info and desired_access.
+ and mid info and desired_access. (Removed paranoia test - it's
+ not automatically a logic error if they are identical. JRA.)
********************************************************************/
static BOOL share_modes_identical(struct share_mode_entry *e1,
struct share_mode_entry *e2)
{
-#if 1 /* JRA PARANOIA TEST - REMOVE LATER */
- if (procid_equal(&e1->pid, &e2->pid) &&
- e1->share_file_id == e2->share_file_id &&
- e1->dev == e2->dev &&
- e1->inode == e2->inode &&
- (e1->share_access) != (e2->share_access)) {
- DEBUG(0,("PANIC: share_modes_identical: share_mode "
- "mismatch (e1 = 0x%x, e2 = 0x%x). Logic error.\n",
- (unsigned int)e1->share_access,
- (unsigned int)e2->share_access ));
- smb_panic("PANIC: share_modes_identical logic error.\n");
- }
-#endif
+ /* We used to check for e1->share_access == e2->share_access here
+ as well as the other fields but 2 different DOS or FCB opens
+ sharing the same share mode entry may validly differ in
+ fsp->share_access field. */
return (procid_equal(&e1->pid, &e2->pid) &&
- (e1->share_access) == (e2->share_access) &&
e1->dev == e2->dev &&
e1->inode == e2->inode &&
e1->share_file_id == e2->share_file_id );