summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRalph Boehme <slow@samba.org>2017-02-17 16:35:44 +0100
committerStefan Metzmacher <metze@samba.org>2017-03-07 08:28:15 +0100
commit8d04b53642419c3199b9f12f2441f4eabef7b68d (patch)
tree620071e25553ba9cf05a3e2ef4fde99bb86859b9
parent161974b5599348c0e9a4e8ed0c513614dbc67014 (diff)
downloadsamba-8d04b53642419c3199b9f12f2441f4eabef7b68d.tar.gz
s4/torture: vfs_fruit: add stream with illegal ntfs characters to copyile test
This ensures a stream with illegal NTFS characters mapped to the Unicode private range like :foo\xef\x80\xa2bar:$DATA that is stored as an xattr name user.DosStream.foo:bar:$DATA if "fruit:encoding = native" is set, is copied by the special fruit copy_chunk request. Bug: https://bugzilla.samba.org/show_bug.cgi?id=12427 Signed-off-by: Ralph Boehme <slow@samba.org> Reviewed-by: Uri Simchoni <uri@samba.org> (cherry picked from commit c7a79a9b35225f41eeae961ab340882c7d49f0c4)
-rw-r--r--source4/torture/vfs/fruit.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/source4/torture/vfs/fruit.c b/source4/torture/vfs/fruit.c
index ca8f430e05d..2aa3d7112a0 100644
--- a/source4/torture/vfs/fruit.c
+++ b/source4/torture/vfs/fruit.c
@@ -2451,6 +2451,7 @@ static bool test_copyfile(struct torture_context *torture,
struct srv_copychunk_rsp cc_rsp;
enum ndr_err_code ndr_ret;
bool ok;
+ const char *sname = ":foo" "\xef\x80\xa2" "bar:$DATA";
/*
* First test a copy_chunk with a 0 chunk count without having
@@ -2521,6 +2522,11 @@ static bool test_copyfile(struct torture_context *torture,
torture_fail(torture, "setup stream error");
}
+ ok = write_stream(tree, __location__, torture, tmp_ctx,
+ FNAME_CC_SRC, sname,
+ 10, 10, "abcdefghij");
+ torture_assert_goto(torture, ok == true, ok, done, "write_stream failed\n");
+
ok = test_setup_copy_chunk(torture, tree, tmp_ctx,
0, /* 0 chunks, copyfile semantics */
&src_h, 4096, /* fill 4096 byte src file */
@@ -2573,6 +2579,11 @@ static bool test_copyfile(struct torture_context *torture,
torture_fail_goto(torture, done, "inconsistent stream data");
}
+ ok = check_stream(tree, __location__, torture, tmp_ctx,
+ FNAME_CC_DST, sname,
+ 0, 20, 10, 10, "abcdefghij");
+ torture_assert_goto(torture, ok == true, ok, done, "check_stream failed\n");
+
done:
smb2_util_close(tree, src_h);
smb2_util_close(tree, dest_h);