s3: Fix bug 8042: File creation on OS/X
authorVolker Lendecke <vl@samba.org>
Sun, 3 Apr 2011 11:57:11 +0000 (13:57 +0200)
committerVolker Lendecke <vlendec@samba.org>
Sun, 3 Apr 2011 12:54:27 +0000 (14:54 +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

Autobuild-User: Volker Lendecke <vlendec@samba.org>
Autobuild-Date: Sun Apr  3 14:54:27 CEST 2011 on sn-devel-104

source3/smbd/filename.c

index 0fda8879da7a361f6f713c569f7045941c0bfa89..912e3a41f3c1bbcd5e914fe1862a5b066b3977ed 100644 (file)
@@ -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.