From 2ec48260ee377e499fe7f0fc2ca18b8a078c6aaa Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Mon, 4 Apr 2011 10:22:03 -0700 Subject: Move SET_STAT_INVALID call added by Volker as fix for bug 8042 - Newly create files are always failed with NT_STATUS_FILE_IS_A_DIRECTORY Ensure we do this for all cases where the stat fails. Jeremy Autobuild-User: Jeremy Allison Autobuild-Date: Mon Apr 4 20:08:45 CEST 2011 on sn-devel-104 --- source3/smbd/filename.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'source3/smbd/filename.c') diff --git a/source3/smbd/filename.c b/source3/smbd/filename.c index 3bab2c8971..08bc79dfd2 100644 --- a/source3/smbd/filename.c +++ b/source3/smbd/filename.c @@ -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. -- cgit