summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJeremy Allison <jra@samba.org>2011-04-04 10:22:03 -0700
committerJeremy Allison <jra@samba.org>2011-04-04 20:08:45 +0200
commit2ec48260ee377e499fe7f0fc2ca18b8a078c6aaa (patch)
treeeedbd66196da6b08f1eea490d5e2dedd801e5d9a
parent074239ac2eec666abb892b5eef46ca70691ed41f (diff)
downloadsamba-2ec48260ee377e499fe7f0fc2ca18b8a078c6aaa.tar.gz
samba-2ec48260ee377e499fe7f0fc2ca18b8a078c6aaa.tar.bz2
samba-2ec48260ee377e499fe7f0fc2ca18b8a078c6aaa.zip
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 <jra@samba.org> Autobuild-Date: Mon Apr 4 20:08:45 CEST 2011 on sn-devel-104
-rw-r--r--source3/smbd/filename.c6
1 files changed, 3 insertions, 3 deletions
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.