Move SET_STAT_INVALID call added by Volker as fix for bug 8042 - Newly create files...
authorJeremy Allison <jra@samba.org>
Mon, 4 Apr 2011 17:22:03 +0000 (10:22 -0700)
committerJeremy Allison <jra@samba.org>
Mon, 4 Apr 2011 18:08:45 +0000 (20:08 +0200)
Ensure we do this for all cases where the stat fails.

Jeremy

Autobuild-User: Jeremy Allison <jra@samba.org>
Autobuild-Date: Mon Apr  4 20:08:45 CEST 2011 on sn-devel-104

source3/smbd/filename.c

index 3bab2c8971dcc2789133b46a380122bb447e219f..08bc79dfd2273a7b0012e0620371a90588cd3d6e 100644 (file)
@@ -440,6 +440,9 @@ NTSTATUS unix_convert(TALLOC_CTX *ctx,
                        goto done;
                }
 
+               /* Stat failed - ensure we don't use it. */
+               SET_STAT_INVALID(smb_fname->st);
+
                if (errno == ENOENT) {
                        /* Optimization when creating a new file - only
                           the last component doesn't exist. */
@@ -506,9 +509,6 @@ 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.