]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
s4:torture/vfs/fruit: ensure test_adouble_conversion_wo_xattr() uses a non-emtpy...
authorRalph Boehme <slow@samba.org>
Tue, 21 May 2019 16:39:52 +0000 (18:39 +0200)
committerKarolin Seeger <kseeger@samba.org>
Thu, 13 Jun 2019 10:22:12 +0000 (10:22 +0000)
This ensures the resource fork is not deleted as part of the AppleDouble file
conversion for the option fruit:wipe_intentionally_left_blank_rfork=yes.

This is currently not a problem in selftest, as we don't enable the option, but
a subsequent commit will run all vfs.fruit tests against a share with this
option enabled.

Bug: https://bugzilla.samba.org/show_bug.cgi?id=13958

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
(cherry picked from commit bb5a457f2872a383b58d62981dade322fca9b283)

source4/torture/vfs/fruit.c

index 1c0754af4561e1d14321adab0b30cdb273d5810d..8e8731662fbe7ddc52b932dbb6fc6cc2f959847e 100644 (file)
@@ -902,7 +902,7 @@ static char osx_adouble_w_xattr[] = {
  *
  * -RAW DUMP--:  0  1  2  3  4  5  6  7  8  9  A  B  C  D  E  F : (ASCII)
  * 00000000   : 00 00 01 00 00 00 01 00 00 00 00 00 00 00 00 1E : ................
- * 00000010   : 54 68 69 73 20 72 65 73 6F 75 72 63 65 20 66 6F : This resource fo
+ * 00000010   : F0 F1 F2 F3 F5 F5 F6 F7 F8 F9 FA FB FC FD FE FF : ................
  * 00000020   : 72 6B 20 69 6E 74 65 6E 74 69 6F 6E 61 6C 6C 79 : rk intentionally
  * 00000030   : 20 6C 65 66 74 20 62 6C 61 6E 6B 20 20 20 00 00 :  left blank   ..
  * 00000040   : 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 : ................
@@ -991,9 +991,9 @@ static char osx_adouble_without_xattr[] = {
        0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
        0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00,
        0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-       0x00, 0x1e, 0x54, 0x68, 0x69, 0x73, 0x20, 0x72,
-       0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x20,
-       0x66, 0x6f, 0x72, 0x6b, 0x20, 0x69, 0x6e, 0x74,
+       0x00, 0x1e, 0xf0, 0xf1, 0xf2, 0xf3, 0xf4, 0xf5,
+       0xf6, 0xf7, 0xf8, 0xf9, 0xfa, 0xfb, 0xfc, 0xfd,
+       0xfe, 0xff, 0x72, 0x6b, 0x20, 0x69, 0x6e, 0x74,
        0x65, 0x6e, 0x74, 0x69, 0x6f, 0x6e, 0x61, 0x6c,
        0x6c, 0x79, 0x20, 0x6c, 0x65, 0x66, 0x74, 0x20,
        0x62, 0x6c, 0x61, 0x6e, 0x6b, 0x20, 0x20, 0x20,
@@ -2833,8 +2833,11 @@ static bool test_adouble_conversion_wo_xattr(struct torture_context *tctx,
        struct smb2_find find;
        unsigned int count;
        union smb_search_data *d;
-       const char *data = "This resource fork intentionally left blank";
-       size_t datalen = strlen(data);
+       const char data[] = {
+               0xf0, 0xf1, 0xf2, 0xf3, 0xf4, 0xf5, 0xf6, 0xf7,
+               0xf8, 0xf9, 0xfa, 0xfb, 0xfc, 0xfd, 0xfe, 0xff
+       };
+       size_t datalen = sizeof(data);
        bool is_osx = torture_setting_bool(tctx, "osx", false);
 
        if (is_osx) {