Fix the SMB2 showstopper, found by an extended torture test from Volker.
commit3c21f14a0686384697cdec4b02360d958505f51b
authorJeremy Allison <jra@samba.org>
Mon, 16 May 2011 19:20:14 +0000 (16 12:20 -0700)
committerKarolin Seeger <kseeger@samba.org>
Tue, 17 May 2011 07:20:13 +0000 (17 09:20 +0200)
tree3d979a6f425188e7c5bef34389b5f4be325761e7
parenta58a74d2bdf0897bfa76426fc721c7c216458549
Fix the SMB2 showstopper, found by an extended torture test from Volker.

In the oplock refactoring, the algorithm underwent an unnoticed change.
In 3.5.x stat_opens were silently (i.e. no explicit code had comments
explaining this) ignored when looking for oplock breaks and share mode
violations. After the refactoring, the function find_oplock_types()
no longer ignored stat_open entries in the share mode table when looking
for batch and exclusive oplocks. This patch adds two changes to find_oplock_types()
to ignore the case where the incoming open request is a stat open being
tested against existing opens, and also when the incoming open request
is a non-stat open being tested against existing stat opens. Neither
of these cause an oplock break or share mode violation. Thanks a *lot*
to Volker, who persevered in reproducing this problem.

Autobuild-User: Jeremy Allison <jra@samba.org>
Autobuild-Date: Mon May 16 22:38:20 CEST 2011 on sn-devel-104
(cherry picked from commit 8cf14c21b3bc55454728bf48b23f696e15c92aea)
(cherry picked from commit a2bc1d37b98a0581960039a5ff3deb55cf0c4f90)
source3/smbd/open.c