s4: torture: Add regression test case for #10671 - Samba file corruption as a result...
authorJeremy Allison <jra@samba.org>
Tue, 24 Jun 2014 21:22:24 +0000 (14:22 -0700)
committerDavid Disseldorp <ddiss@samba.org>
Wed, 25 Jun 2014 09:22:12 +0000 (11:22 +0200)
commitc4f7c02137cb2aa1d58251362e7e04ad32ede5d8
treeecd7a39ea11329a29d85c3c70c5f810ba1d1c8d9
parent31b3427a417217e5e869baafdf63e633efc39d12
s4: torture: Add regression test case for #10671 - Samba file corruption as a result of failed lock check.

Adds a new test to raw.open.

Opens a file with SHARE_NONE, writes 1 byte at offset 1023,
attempts a second open with r/w access+truncate disposition,
then checks that open fails with SHARING_VIOLATION, and
the file is not truncated (is still size 1024). Correctly
detects the bug and fixed smbd for me.

https://bugzilla.samba.org/show_bug.cgi?id=10671

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
Reviewed-by: David Disseldorp <ddiss@samba.org>
source4/torture/raw/open.c