s3:streams: check for :$DATA only in the backend (fix bug #6642)
[metze/samba/wip.git] / source3 / modules / vfs_streams_depot.c
index 2581c7fd5b5ad3b5f2f9a4b966b7d2e039e42098..5879b34f096061ce02588ebd64e7b8dbbabe227a 100644 (file)
@@ -321,6 +321,14 @@ static NTSTATUS stream_smb_fname(vfs_handle_struct *handle,
 
        *smb_fname_out = NULL;
 
+       stype = strchr_m(smb_fname->stream_name + 1, ':');
+
+       if (stype) {
+               if (StrCaseCmp(stype, ":$DATA") != 0) {
+                       return NT_STATUS_INVALID_PARAMETER;
+               }
+       }
+
        dirname = stream_dir(handle, smb_fname, NULL, create_dir);
 
        if (dirname == NULL) {
@@ -328,8 +336,6 @@ static NTSTATUS stream_smb_fname(vfs_handle_struct *handle,
                goto fail;
        }
 
-       stype = strchr_m(smb_fname->stream_name + 1, ':');
-
        stream_fname = talloc_asprintf(talloc_tos(), "%s/%s", dirname,
                                       smb_fname->stream_name);