summaryrefslogtreecommitdiff
path: root/source3
diff options
context:
space:
mode:
authorJeremy Allison <jra@samba.org>2019-02-23 12:24:31 -0800
committerKarolin Seeger <kseeger@samba.org>2019-03-05 07:39:29 +0000
commit1ca055cb13b750180e268714a34472225c773fec (patch)
treeed5d5c8fa936090cc1704d7ca4699ed744e0a32e /source3
parent8d407971129ae308c574c0d9dc7e0cfd7c7483b1 (diff)
downloadsamba-1ca055cb13b750180e268714a34472225c773fec.tar.gz
smbd: unix_convert: Ensure we don't call get_real_filename on POSIX paths.
For posix_pathnames don't blunder into the name_has_wildcard OR get_real_filename() codepaths as they may be doing case insensitive lookups. So when creating a new POSIX directory 'Foo' they might match on name 'foo'. Remove POSIX-MKDIR from knownfail. BUG: https://bugzilla.samba.org/show_bug.cgi?id=13803 Signed-off-by: Jeremy Allison <jra@samba.org> Reviewed-by: Volker Lendecke <vl@samba.org> Autobuild-User(master): Volker Lendecke <vl@samba.org> Autobuild-Date(master): Sun Feb 24 14:04:14 CET 2019 on sn-devel-144 (cherry picked from commit 12da33e2bbce657f25abe9bc4cb936ca4615b30f)
Diffstat (limited to 'source3')
-rw-r--r--source3/smbd/filename.c25
1 files changed, 25 insertions, 0 deletions
diff --git a/source3/smbd/filename.c b/source3/smbd/filename.c
index ede14b95e79..4c8c5ea19bc 100644
--- a/source3/smbd/filename.c
+++ b/source3/smbd/filename.c
@@ -906,6 +906,31 @@ NTSTATUS unix_convert(TALLOC_CTX *ctx,
/* Stat failed - ensure we don't use it. */
SET_STAT_INVALID(smb_fname->st);
+ if (posix_pathnames) {
+ /*
+ * For posix_pathnames, we're done.
+ * Don't blunder into the name_has_wildcard OR
+ * get_real_filename() codepaths as they may
+ * be doing case insensitive lookups. So when
+ * creating a new POSIX directory Foo they might
+ * match on name foo.
+ *
+ * BUG: https://bugzilla.samba.org/show_bug.cgi?id=13803
+ */
+ if (errno == ENOENT) {
+ /* New file or directory. */
+ goto done;
+ }
+ if ((errno == EACCES) &&
+ (ucf_flags & UCF_PREP_CREATEFILE)) {
+ /* POSIX Dropbox case. */
+ errno = 0;
+ goto done;
+ }
+ status = map_nt_error_from_unix(errno);
+ goto fail;
+ }
+
/*
* Reset errno so we can detect
* directory open errors.