summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--selftest/knownfail.d/samba3.smb2.create_no_streams1
-rw-r--r--source3/smbd/filename.c6
-rw-r--r--source3/smbd/files.c10
3 files changed, 14 insertions, 3 deletions
diff --git a/selftest/knownfail.d/samba3.smb2.create_no_streams b/selftest/knownfail.d/samba3.smb2.create_no_streams
deleted file mode 100644
index c8476081f2d..00000000000
--- a/selftest/knownfail.d/samba3.smb2.create_no_streams
+++ /dev/null
@@ -1 +0,0 @@
-^samba3.smb2.create_no_streams.no_stream\(fileserver\)
diff --git a/source3/smbd/filename.c b/source3/smbd/filename.c
index ca94b7ec7f9..0be8e320ffa 100644
--- a/source3/smbd/filename.c
+++ b/source3/smbd/filename.c
@@ -1120,6 +1120,12 @@ static NTSTATUS filename_convert_dirfsp_nosymlink(
goto fail;
}
+ if ((streamname != NULL) &&
+ ((conn->fs_capabilities & FILE_NAMED_STREAMS) == 0)) {
+ status = NT_STATUS_OBJECT_NAME_INVALID;
+ goto fail;
+ }
+
if (!posix) {
bool name_has_wild = ms_has_wild(dirname);
name_has_wild |= ms_has_wild(fname_rel);
diff --git a/source3/smbd/files.c b/source3/smbd/files.c
index b494a8b789a..179c3e11a76 100644
--- a/source3/smbd/files.c
+++ b/source3/smbd/files.c
@@ -565,8 +565,14 @@ NTSTATUS openat_pathref_fsp(const struct files_struct *dirfsp,
return NT_STATUS_OK;
}
- if (!(conn->fs_capabilities & FILE_NAMED_STREAMS) ||
- !is_named_stream(smb_fname)) {
+ if (is_named_stream(smb_fname) &&
+ ((conn->fs_capabilities & FILE_NAMED_STREAMS) == 0)) {
+ DBG_DEBUG("stream open [%s] on non-stream share\n",
+ smb_fname_str_dbg(smb_fname));
+ return NT_STATUS_OBJECT_NAME_INVALID;
+ }
+
+ if (!is_named_stream(smb_fname)) {
/*
* openat_pathref_fullname() will make "full_fname" a
* talloc child of the smb_fname->fsp. Don't use