summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStefan Metzmacher <metze@samba.org>2008-12-01 13:59:00 -0800
committerKarolin Seeger <kseeger@samba.org>2008-12-11 10:27:12 +0100
commit9ffcedb2eb580d67ae4890052a1013dfa89e26a2 (patch)
treeeb81f200f9de900aeda8715a6f8f183c47e128c8
parentb06868667a95ab52e1dce66d07a257068341e439 (diff)
downloadsamba-9ffcedb2eb580d67ae4890052a1013dfa89e26a2.tar.gz
s3:streams_depot: map 'file::$DATA' to just 'file'
metze (cherry picked from commit 507f5853bc98a240307f429c369bf920e3f2f4a4)
-rw-r--r--source/modules/vfs_streams_depot.c13
1 files changed, 12 insertions, 1 deletions
diff --git a/source/modules/vfs_streams_depot.c b/source/modules/vfs_streams_depot.c
index e7ecedaaed2..ccb0a2ec89b 100644
--- a/source/modules/vfs_streams_depot.c
+++ b/source/modules/vfs_streams_depot.c
@@ -270,6 +270,11 @@ static char *stream_name(vfs_handle_struct *handle, const char *fname,
goto fail;
}
+ /* if it's the ::$DATA stream just return the base file name */
+ if (!sname) {
+ return base;
+ }
+
dirname = stream_dir(handle, base, NULL, create_dir);
if (dirname == NULL) {
@@ -409,6 +414,7 @@ static int streams_depot_open(vfs_handle_struct *handle, const char *fname,
{
TALLOC_CTX *frame;
char *base = NULL;
+ char *sname = NULL;
SMB_STRUCT_STAT base_sbuf;
char *stream_fname;
int ret = -1;
@@ -420,11 +426,16 @@ static int streams_depot_open(vfs_handle_struct *handle, const char *fname,
frame = talloc_stackframe();
if (!NT_STATUS_IS_OK(split_ntfs_stream_name(talloc_tos(), fname,
- &base, NULL))) {
+ &base, &sname))) {
errno = ENOMEM;
goto done;
}
+ if (!sname) {
+ ret = SMB_VFS_NEXT_OPEN(handle, base, fsp, flags, mode);
+ goto done;
+ }
+
ret = SMB_VFS_NEXT_STAT(handle, base, &base_sbuf);
if (ret == -1) {