smbd: Fix a profile problem
[samba.git] / source3 / smbd / filename.c
index 03e1d2dfa1e62e75a05ebb30327a8df113f4ce6a..4384f5a5c030c8046dbe1c12b38a090f67ebc830 100644 (file)
@@ -723,7 +723,8 @@ NTSTATUS unix_convert(TALLOC_CTX *ctx,
                                 * can only put stuff with permission -wx.
                                 */
                                if ((errno != 0) && (errno != ENOENT)
-                                   && (errno != EACCES)) {
+                                   && ((ucf_flags & UCF_CREATING_FILE) &&
+                                       (errno != EACCES))) {
                                        /*
                                         * ENOTDIR and ELOOP both map to
                                         * NT_STATUS_OBJECT_PATH_NOT_FOUND