s3: smbd - Prevent file truncation on an open that fails with share mode violation.
commitf8af6870a061758a37bb6c63d09ce23ab971c6ce
authorJeremy Allison <jra@samba.org>
Tue, 24 Jun 2014 21:19:30 +0000 (24 14:19 -0700)
committerKarolin Seeger <kseeger@samba.org>
Thu, 17 Jul 2014 06:54:06 +0000 (17 08:54 +0200)
tree4f2785492cd9c073e830dbde044baaf8d09aca88
parent610320ee67ff1430ebd72bcd187953b6f9127045
s3: smbd - Prevent file truncation on an open that fails with share mode violation.

Fix from Volker, really - just tidied up a little.
The S_ISFIFO check may not be strictly neccessary,
but doesn't hurt (might make the code a bit more complex
than it needs to be).

Fixes bug #10671 - Samba file corruption as a result of failed lock check.

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>
(cherry picked from commit 31b3427a417217e5e869baafdf63e633efc39d12)
[ddiss@samba.org: 4.1 backport]
source3/smbd/open.c