From 2b94169cda00e31a3b7814996abf42635735b6ff Mon Sep 17 00:00:00 2001 From: Volker Lendecke Date: Sun, 3 Apr 2011 13:57:11 +0200 Subject: [PATCH] s3: Fix bug 8042: File creation on OS/X With a case insensitive file system the stat cache lookup leaked the parent directorys stat information from unix_convert into the smb_filename. This led open_file_ntcreate to believe it just created a directory. In the case where we do the search we already invalidate the stat struct. Thanks to TAKAHASHI Motonobu for insisting! :-) Volker Autobuild-User: Volker Lendecke Autobuild-Date: Sun Apr 3 14:54:27 CEST 2011 on sn-devel-104 --- source3/smbd/filename.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/source3/smbd/filename.c b/source3/smbd/filename.c index 0fda8879da7..912e3a41f3c 100644 --- a/source3/smbd/filename.c +++ b/source3/smbd/filename.c @@ -506,6 +506,9 @@ NTSTATUS unix_convert(TALLOC_CTX *ctx, } } + /* Stat failed - ensure we don't use it. */ + SET_STAT_INVALID(smb_fname->st); + /* * Missing last component is ok - new file. * Also deal with permission denied elsewhere. -- 2.11.4.GIT