s3:streams: check for :$DATA only in the backend (fix bug #6642)
authorStefan Metzmacher <metze@samba.org>
Tue, 18 Aug 2009 09:34:54 +0000 (11:34 +0200)
committerStefan Metzmacher <metze@samba.org>
Thu, 27 Aug 2009 14:45:40 +0000 (16:45 +0200)
We need to allow "\\$Extend\\$Quota:$Q:$INDEX_ALLOCATION" to pass
check_path(), so that the Quota Dialog works.

metze

source3/modules/onefs_streams.c
source3/modules/vfs_streams_depot.c
source3/smbd/reply.c

index 66eda57a34fd52dcc4c89d57d79235ca7539ea18..da2666130c3da7c4d1666dc3fa7c939c87455986 100644 (file)
@@ -55,6 +55,9 @@ NTSTATUS onefs_stream_prep_smb_fname(TALLOC_CTX *ctx,
                /* Strip off the :$DATA if one exists. */
                str_tmp = strrchr_m(stream_name, ':');
                if (str_tmp) {
                /* Strip off the :$DATA if one exists. */
                str_tmp = strrchr_m(stream_name, ':');
                if (str_tmp) {
+                       if (StrCaseCmp(str_tmp, ":$DATA") != 0) {
+                               return NT_STATUS_INVALID_PARAMETER;
+                       }
                        str_tmp[0] = '\0';
                }
        }
                        str_tmp[0] = '\0';
                }
        }
index d09255a4a23d8e040b2b99ba5ff096bf9bfbfb60..aa0189123bbf4bbac973c1df334cf60be66ebb06 100644 (file)
@@ -321,6 +321,14 @@ static NTSTATUS stream_smb_fname(vfs_handle_struct *handle,
 
        *smb_fname_out = NULL;
 
 
        *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) {
        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;
        }
 
                goto fail;
        }
 
-       stype = strchr_m(smb_fname->stream_name + 1, ':');
-
        stream_fname = talloc_asprintf(talloc_tos(), "%s/%s", dirname,
                                       smb_fname->stream_name);
 
        stream_fname = talloc_asprintf(talloc_tos(), "%s/%s", dirname,
                                       smb_fname->stream_name);
 
index 7b290a6b0ea909e6050d3052f393016f7999af8d..bdc71c240432d8afb306feaf8c73a95cb0e60346 100644 (file)
@@ -65,9 +65,6 @@ static NTSTATUS check_path_syntax_internal(char *path,
                                if (strchr_m(&s[1], ':')) {
                                        return NT_STATUS_OBJECT_NAME_INVALID;
                                }
                                if (strchr_m(&s[1], ':')) {
                                        return NT_STATUS_OBJECT_NAME_INVALID;
                                }
-                               if (StrCaseCmp(s, ":$DATA") != 0) {
-                                       return NT_STATUS_INVALID_PARAMETER;
-                               }
                                break;
                        }
                }
                                break;
                        }
                }