From eef7ac6ed0b92d06ff35829593adb05b94c82993 Mon Sep 17 00:00:00 2001 From: Stefan Metzmacher Date: Tue, 18 Aug 2009 11:34:54 +0200 Subject: [PATCH] s3:streams: check for :$DATA only in the backend (fix bug #6642) 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 | 3 +++ source3/modules/vfs_streams_depot.c | 10 ++++++++-- source3/smbd/reply.c | 3 --- 3 files changed, 11 insertions(+), 5 deletions(-) diff --git a/source3/modules/onefs_streams.c b/source3/modules/onefs_streams.c index 66eda57a34fd..da2666130c3d 100644 --- a/source3/modules/onefs_streams.c +++ b/source3/modules/onefs_streams.c @@ -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) { + if (StrCaseCmp(str_tmp, ":$DATA") != 0) { + return NT_STATUS_INVALID_PARAMETER; + } str_tmp[0] = '\0'; } } diff --git a/source3/modules/vfs_streams_depot.c b/source3/modules/vfs_streams_depot.c index 2581c7fd5b5a..5879b34f0960 100644 --- a/source3/modules/vfs_streams_depot.c +++ b/source3/modules/vfs_streams_depot.c @@ -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); diff --git a/source3/smbd/reply.c b/source3/smbd/reply.c index 7b290a6b0ea9..bdc71c240432 100644 --- a/source3/smbd/reply.c +++ b/source3/smbd/reply.c @@ -65,9 +65,6 @@ static NTSTATUS check_path_syntax_internal(char *path, if (strchr_m(&s[1], ':')) { return NT_STATUS_OBJECT_NAME_INVALID; } - if (StrCaseCmp(s, ":$DATA") != 0) { - return NT_STATUS_INVALID_PARAMETER; - } break; } } -- 2.34.1