diff options
author | Jeremy Allison <jra@samba.org> | 2006-05-17 23:15:53 +0000 |
---|---|---|
committer | Gerald (Jerry) Carter <jerry@samba.org> | 2007-10-10 11:17:06 -0500 |
commit | cc9ea93456e594432e203e6d2d2f4dbcaac9a3dd (patch) | |
tree | 7bf722a9a742cf7986f31f454bfd17a4a8415ec0 /source3/locking | |
parent | c91a675ac108f48046ce72287c6d70a1a54ef65f (diff) | |
download | samba-cc9ea93456e594432e203e6d2d2f4dbcaac9a3dd.tar.gz samba-cc9ea93456e594432e203e6d2d2f4dbcaac9a3dd.tar.xz samba-cc9ea93456e594432e203e6d2d2f4dbcaac9a3dd.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
(This used to be commit fd6fa1d4eaf61783df74ee2da50d331477f06998)
Diffstat (limited to 'source3/locking')
-rw-r--r-- | source3/locking/locking.c | 23 |
1 files changed, 7 insertions, 16 deletions
diff --git a/source3/locking/locking.c b/source3/locking/locking.c index 2b6023c0c41..2766b257be2 100644 --- a/source3/locking/locking.c +++ b/source3/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 ); |