s3: Fix bug 8042: File creation on OS/X
authorVolker Lendecke <Volker.Lendecke@SerNet.DE>
Mon, 4 Apr 2011 17:19:18 +0000 (10:19 -0700)
committerKarolin Seeger <kseeger@samba.org>
Tue, 14 Jun 2011 10:56:50 +0000 (12:56 +0200)
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
(cherry picked from commit c9015e381905bb254ee61b64d99052b96b4d4913)

source3/smbd/filename.c

index 154d34a4c06c41754669dee8cec35c6d21ca04fc..c92921edce6518de5cbd07ca69b66d249cd461ae 100644 (file)
@@ -352,6 +352,9 @@ NTSTATUS unix_convert(TALLOC_CTX *ctx,
                        goto done;
                }
 
+               /* Stat failed - ensure we don't use it. */
+               SET_STAT_INVALID(smb_fname->st);
+
                /*
                 * A special case - if we don't have any wildcards or mangling chars and are case
                 * sensitive or the underlying filesystem is case insentive then searching