From 3b537c31b0dfc0d5368f622f89ad953b66f67b1e Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Mon, 4 Apr 2011 10:05:17 -0700 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 --- source3/smbd/filename.c | 3 +++ 1 files changed, 3 insertions(+), 0 deletions(-) diff --git a/source3/smbd/filename.c b/source3/smbd/filename.c index 154d34a..e1ed329 100644 --- a/source3/smbd/filename.c +++ b/source3/smbd/filename.c @@ -350,6 +350,9 @@ NTSTATUS unix_convert(TALLOC_CTX *ctx, DEBUG(5,("conversion of base_name finished %s -> %s\n", orig_path, smb_fname->base_name)); goto done; + } else { + /* Stat failed - ensure we don't use it. */ + SET_STAT_INVALID(smb_fname->st); } /* -- 1.7.3.1