smbtorture: add test for fruit:validate_afpinfo option
[Samba.git] / source4 / torture / vfs / fruit.c
blobb9cab0c5467fcb9c0aca3a8bd689d5c30826d5cf
1 /*
2 Unix SMB/CIFS implementation.
4 vfs_fruit tests
6 Copyright (C) Ralph Boehme 2014
8 This program is free software; you can redistribute it and/or modify
9 it under the terms of the GNU General Public License as published by
10 the Free Software Foundation; either version 3 of the License, or
11 (at your option) any later version.
13 This program is distributed in the hope that it will be useful,
14 but WITHOUT ANY WARRANTY; without even the implied warranty of
15 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 GNU General Public License for more details.
18 You should have received a copy of the GNU General Public License
19 along with this program. If not, see <http://www.gnu.org/licenses/>.
22 #include "includes.h"
23 #include "system/filesys.h"
24 #include "libcli/libcli.h"
25 #include "libcli/smb2/smb2.h"
26 #include "libcli/smb2/smb2_calls.h"
27 #include "libcli/smb/smb2_create_ctx.h"
28 #include "lib/cmdline/cmdline.h"
29 #include "param/param.h"
30 #include "libcli/resolve/resolve.h"
31 #include "MacExtensions.h"
32 #include "lib/util/tsort.h"
34 #include "torture/torture.h"
35 #include "torture/util.h"
36 #include "torture/smb2/proto.h"
37 #include "torture/vfs/proto.h"
38 #include "librpc/gen_ndr/ndr_ioctl.h"
39 #include "libcli/security/dom_sid.h"
40 #include "../librpc/gen_ndr/ndr_security.h"
41 #include "libcli/security/secace.h"
42 #include "libcli/security/security_descriptor.h"
44 #define BASEDIR "vfs_fruit_dir"
45 #define FNAME_CC_SRC "testfsctl.dat"
46 #define FNAME_CC_DST "testfsctl2.dat"
48 #define CHECK_STATUS(status, correct) do { \
49 if (!NT_STATUS_EQUAL(status, correct)) { \
50 torture_result(tctx, TORTURE_FAIL, \
51 "(%s) Incorrect status %s - should be %s\n", \
52 __location__, nt_errstr(status), nt_errstr(correct)); \
53 ret = false; \
54 goto done; \
55 }} while (0)
57 #define CHECK_VALUE(v, correct) do { \
58 if ((v) != (correct)) { \
59 torture_result(tctx, TORTURE_FAIL, \
60 "(%s) Incorrect value %s=%u - should be %u\n", \
61 __location__, #v, (unsigned)v, (unsigned)correct); \
62 ret = false; \
63 goto done; \
64 }} while (0)
66 static bool check_stream_list(struct smb2_tree *tree,
67 struct torture_context *tctx,
68 const char *fname,
69 int num_exp,
70 const char **exp,
71 bool is_dir);
73 static int qsort_string(char * const *s1, char * const *s2)
75 return strcmp(*s1, *s2);
78 static int qsort_stream(const struct stream_struct * s1, const struct stream_struct *s2)
80 return strcmp(s1->stream_name.s, s2->stream_name.s);
84 * REVIEW:
85 * This is hokey, but what else can we do?
87 #if defined(HAVE_ATTROPEN) || defined(FREEBSD)
88 #define AFPINFO_EA_NETATALK "org.netatalk.Metadata"
89 #define AFPRESOURCE_EA_NETATALK "org.netatalk.ResourceFork"
90 #else
91 #define AFPINFO_EA_NETATALK "user.org.netatalk.Metadata"
92 #define AFPRESOURCE_EA_NETATALK "user.org.netatalk.ResourceFork"
93 #endif
96 The metadata xattr char buf below contains the following attributes:
98 -------------------------------------------------------------------------------
99 Entry ID : 00000008 : File Dates Info
100 Offset : 00000162 : 354
101 Length : 00000010 : 16
103 -DATE------: : (GMT) : (Local)
104 create : 1B442169 : Mon Jun 30 13:23:53 2014 : Mon Jun 30 15:23:53 2014
105 modify : 1B442169 : Mon Jun 30 13:23:53 2014 : Mon Jun 30 15:23:53 2014
106 backup : 80000000 : Unknown or Initial
107 access : 1B442169 : Mon Jun 30 13:23:53 2014 : Mon Jun 30 15:23:53 2014
109 -RAW DUMP--: 0 1 2 3 4 5 6 7 8 9 A B C D E F : (ASCII)
110 00000000 : 1B 44 21 69 1B 44 21 69 80 00 00 00 1B 44 21 69 : .D!i.D!i.....D!i
112 -------------------------------------------------------------------------------
113 Entry ID : 00000009 : Finder Info
114 Offset : 0000007A : 122
115 Length : 00000020 : 32
117 -FInfo-----:
118 Type : 42415252 : BARR
119 Creator : 464F4F4F : FOOO
120 isAlias : 0
121 Invisible : 1
122 hasBundle : 0
123 nameLocked : 0
124 Stationery : 0
125 CustomIcon : 0
126 Reserved : 0
127 Inited : 0
128 NoINITS : 0
129 Shared : 0
130 SwitchLaunc: 0
131 Hidden Ext : 0
132 color : 000 : none
133 isOnDesk : 0
134 Location v : 0000 : 0
135 Location h : 0000 : 0
136 Fldr : 0000 : ..
138 -FXInfo----:
139 Rsvd|IconID: 0000 : 0
140 Rsvd : 0000 : ..
141 Rsvd : 0000 : ..
142 Rsvd : 0000 : ..
143 AreInvalid : 0
144 unknown bit: 0
145 unknown bit: 0
146 unknown bit: 0
147 unknown bit: 0
148 unknown bit: 0
149 unknown bit: 0
150 CustomBadge: 0
151 ObjctIsBusy: 0
152 unknown bit: 0
153 unknown bit: 0
154 unknown bit: 0
155 unknown bit: 0
156 RoutingInfo: 0
157 unknown bit: 0
158 unknown bit: 0
159 Rsvd|commnt: 0000 : 0
160 PutAway : 00000000 : 0
162 -RAW DUMP--: 0 1 2 3 4 5 6 7 8 9 A B C D E F : (ASCII)
163 00000000 : 42 41 52 52 46 4F 4F 4F 40 00 00 00 00 00 00 00 : BARRFOOO@.......
164 00000010 : 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 : ................
166 -------------------------------------------------------------------------------
167 Entry ID : 0000000E : AFP File Info
168 Offset : 00000172 : 370
169 Length : 00000004 : 4
171 -RAW DUMP--: 0 1 2 3 4 5 6 7 8 9 A B C D E F : (ASCII)
172 00000000 : 00 00 01 A1 : ....
175 char metadata_xattr[] = {
176 0x00, 0x05, 0x16, 0x07, 0x00, 0x02, 0x00, 0x00,
177 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
178 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
179 0x00, 0x08, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00,
180 0x00, 0x9a, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
181 0x00, 0x08, 0x00, 0x00, 0x01, 0x62, 0x00, 0x00,
182 0x00, 0x10, 0x00, 0x00, 0x00, 0x09, 0x00, 0x00,
183 0x00, 0x7a, 0x00, 0x00, 0x00, 0x20, 0x00, 0x00,
184 0x00, 0x0e, 0x00, 0x00, 0x01, 0x72, 0x00, 0x00,
185 0x00, 0x04, 0x80, 0x44, 0x45, 0x56, 0x00, 0x00,
186 0x01, 0x76, 0x00, 0x00, 0x00, 0x08, 0x80, 0x49,
187 0x4e, 0x4f, 0x00, 0x00, 0x01, 0x7e, 0x00, 0x00,
188 0x00, 0x08, 0x80, 0x53, 0x59, 0x4e, 0x00, 0x00,
189 0x01, 0x86, 0x00, 0x00, 0x00, 0x08, 0x80, 0x53,
190 0x56, 0x7e, 0x00, 0x00, 0x01, 0x8e, 0x00, 0x00,
191 0x00, 0x04, 0x42, 0x41, 0x52, 0x52, 0x46, 0x4f,
192 0x4f, 0x4f, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00,
193 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
194 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
195 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
196 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
197 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
198 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
199 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
200 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
201 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
202 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
203 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
204 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
205 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
206 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
207 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
208 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
209 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
210 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
211 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
212 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
213 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
214 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
215 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
216 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
217 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
218 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
219 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
220 0x00, 0x00, 0x1b, 0x44, 0x21, 0x69, 0x1b, 0x44,
221 0x21, 0x69, 0x80, 0x00, 0x00, 0x00, 0x1b, 0x44,
222 0x21, 0x69, 0x00, 0x00, 0x01, 0xa1, 0x00, 0xfd,
223 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc1, 0x20,
224 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf1, 0xe3,
225 0x86, 0x53, 0x00, 0x00, 0x00, 0x00, 0x3b, 0x01,
226 0x00, 0x00
230 The buf below contains the following AppleDouble encoded data:
232 -------------------------------------------------------------------------------
233 MagicNumber: 00051607 : AppleDouble
234 Version : 00020000 : Version 2
235 Filler : 4D 61 63 20 4F 53 20 58 20 20 20 20 20 20 20 20 : Mac OS X
236 Num. of ent: 0002 : 2
238 -------------------------------------------------------------------------------
239 Entry ID : 00000009 : Finder Info
240 Offset : 00000032 : 50
241 Length : 00000EB0 : 3760
243 -FInfo-----:
244 Type : 54455354 : TEST
245 Creator : 534C4F57 : SLOW
246 isAlias : 0
247 Invisible : 0
248 hasBundle : 0
249 nameLocked : 0
250 Stationery : 0
251 CustomIcon : 0
252 Reserved : 0
253 Inited : 0
254 NoINITS : 0
255 Shared : 0
256 SwitchLaunc: 0
257 Hidden Ext : 0
258 color : 100 : blue
259 isOnDesk : 0
260 Location v : 0000 : 0
261 Location h : 0000 : 0
262 Fldr : 0000 : ..
264 -FXInfo----:
265 Rsvd|IconID: 0000 : 0
266 Rsvd : 0000 : ..
267 Rsvd : 0000 : ..
268 Rsvd : 0000 : ..
269 AreInvalid : 0
270 unknown bit: 0
271 unknown bit: 0
272 unknown bit: 0
273 unknown bit: 0
274 unknown bit: 0
275 unknown bit: 0
276 CustomBadge: 0
277 ObjctIsBusy: 0
278 unknown bit: 0
279 unknown bit: 0
280 unknown bit: 0
281 unknown bit: 0
282 RoutingInfo: 0
283 unknown bit: 0
284 unknown bit: 0
285 Rsvd|commnt: 0000 : 0
286 PutAway : 00000000 : 0
288 -EA--------:
289 pad : 0000 : ..
290 magic : 41545452 : ATTR
291 debug_tag : 53D4580C : 1406425100
292 total_size : 00000EE2 : 3810
293 data_start : 000000BC : 188
294 data_length: 0000005E : 94
295 reserved[0]: 00000000 : ....
296 reserved[1]: 00000000 : ....
297 reserved[2]: 00000000 : ....
298 flags : 0000 : ..
299 num_attrs : 0002 : 2
300 -EA ENTRY--:
301 offset : 000000BC : 188
302 length : 0000005B : 91
303 flags : 0000 : ..
304 namelen : 24 : 36
305 -EA NAME---: 0 1 2 3 4 5 6 7 8 9 A B C D E F : (ASCII)
306 00000000 : 63 6F 6D 2E 61 70 70 6C 65 2E 6D 65 74 61 64 61 : com.apple.metada
307 00000010 : 74 61 3A 5F 6B 4D 44 49 74 65 6D 55 73 65 72 54 : ta:_kMDItemUserT
308 00000020 : 61 67 73 00 : ags.
309 -EA VALUE--: 0 1 2 3 4 5 6 7 8 9 A B C D E F : (ASCII)
310 00000000 : 62 70 6C 69 73 74 30 30 A5 01 02 03 04 05 54 74 : bplist00......Tt
311 00000010 : 65 73 74 66 00 47 00 72 00 FC 00 6E 00 0A 00 32 : estf.G.r...n...2
312 00000020 : 56 4C 69 6C 61 0A 33 56 47 65 6C 62 0A 35 56 42 : VLila.3VGelb.5VB
313 00000030 : 6C 61 75 0A 34 08 0E 13 20 27 2E 00 00 00 00 00 : lau.4... '......
314 00000040 : 00 01 01 00 00 00 00 00 00 00 06 00 00 00 00 00 : ................
315 00000050 : 00 00 00 00 00 00 00 00 00 00 35 : ..........5
316 -EA ENTRY--:
317 offset : 00000117 : 279
318 length : 00000003 : 3
319 flags : 0000 : ..
320 namelen : 08 : 8
321 -EA NAME---: 0 1 2 3 4 5 6 7 8 9 A B C D E F : (ASCII)
322 00000000 : 66 6F 6F 3A 62 61 72 00 : foo:bar.
323 -EA VALUE--: 0 1 2 3 4 5 6 7 8 9 A B C D E F : (ASCII)
324 00000000 : 62 61 7A : baz
326 -RAW DUMP--: 0 1 2 3 4 5 6 7 8 9 A B C D E F : (ASCII)
327 00000000 : 54 45 53 54 53 4C 4F 57 00 08 00 00 00 00 00 00 : TESTSLOW........
328 00000010 : 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 : ................
329 00000020 : 00 00 41 54 54 52 53 D4 58 0C 00 00 0E E2 00 00 : ..ATTRS.X.......
330 00000030 : 00 BC 00 00 00 5E 00 00 00 00 00 00 00 00 00 00 : .....^..........
331 00000040 : 00 00 00 00 00 02 00 00 00 BC 00 00 00 5B 00 00 : .............[..
332 00000050 : 24 63 6F 6D 2E 61 70 70 6C 65 2E 6D 65 74 61 64 : $com.apple.metad
333 00000060 : 61 74 61 3A 5F 6B 4D 44 49 74 65 6D 55 73 65 72 : ata:_kMDItemUser
334 00000070 : 54 61 67 73 00 00 00 00 01 17 00 00 00 03 00 00 : Tags............
335 00000080 : 08 66 6F 6F 3A 62 61 72 00 66 62 70 6C 69 73 74 : .foo:bar.fbplist
336 00000090 : 30 30 A5 01 02 03 04 05 54 74 65 73 74 66 00 47 : 00......Ttestf.G
337 000000A0 : 00 72 00 FC 00 6E 00 0A 00 32 56 4C 69 6C 61 0A : .r...n...2VLila.
338 000000B0 : 33 56 47 65 6C 62 0A 35 56 42 6C 61 75 0A 34 08 : 3VGelb.5VBlau.4.
339 000000C0 : 0E 13 20 27 2E 00 00 00 00 00 00 01 01 00 00 00 : .. '............
340 000000D0 : 00 00 00 00 06 00 00 00 00 00 00 00 00 00 00 00 : ................
341 000000E0 : 00 00 00 00 35 62 61 7A 00 00 00 00 00 00 00 00 : ....5baz........
342 000000F0 : 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 : ................
343 ... all zeroes ...
344 00000EA0 : 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 : ................
346 -------------------------------------------------------------------------------
347 Entry ID : 00000002 : Resource Fork
348 Offset : 00000EE2 : 3810
349 Length : 0000011E : 286
351 -RAW DUMP--: 0 1 2 3 4 5 6 7 8 9 A B C D E F : (ASCII)
352 00000000 : 00 00 01 00 00 00 01 00 00 00 00 00 00 00 00 1E : ................
353 00000010 : 54 68 69 73 20 72 65 73 6F 75 72 63 65 20 66 6F : This resource fo
354 00000020 : 72 6B 20 69 6E 74 65 6E 74 69 6F 6E 61 6C 6C 79 : rk intentionally
355 00000030 : 20 6C 65 66 74 20 62 6C 61 6E 6B 20 20 20 00 00 : left blank ..
356 00000040 : 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 : ................
357 00000050 : 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 : ................
358 00000060 : 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 : ................
359 00000070 : 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 : ................
360 00000080 : 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 : ................
361 00000090 : 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 : ................
362 000000A0 : 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 : ................
363 000000B0 : 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 : ................
364 000000C0 : 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 : ................
365 000000D0 : 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 : ................
366 000000E0 : 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 : ................
367 000000F0 : 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 : ................
368 00000100 : 00 00 01 00 00 00 01 00 00 00 00 00 00 00 00 1E : ................
369 00000110 : 00 00 00 00 00 00 00 00 00 1C 00 1E FF FF : ..............
371 It was created with:
372 $ hexdump -ve '"\t" 7/1 "0x%02x, " 1/1 " 0x%02x," "\n"'
374 static char osx_adouble_w_xattr[] = {
375 0x00, 0x05, 0x16, 0x07, 0x00, 0x02, 0x00, 0x00,
376 0x4d, 0x61, 0x63, 0x20, 0x4f, 0x53, 0x20, 0x58,
377 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
378 0x00, 0x02, 0x00, 0x00, 0x00, 0x09, 0x00, 0x00,
379 0x00, 0x32, 0x00, 0x00, 0x0e, 0xb0, 0x00, 0x00,
380 0x00, 0x02, 0x00, 0x00, 0x0e, 0xe2, 0x00, 0x00,
381 0x01, 0x1e, 0x54, 0x45, 0x53, 0x54, 0x53, 0x4c,
382 0x4f, 0x57, 0x00, 0x08, 0x00, 0x00, 0x00, 0x00,
383 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
384 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
385 0x00, 0x00, 0x00, 0x00, 0x41, 0x54, 0x54, 0x52,
386 0x53, 0xd4, 0x58, 0x0c, 0x00, 0x00, 0x0e, 0xe2,
387 0x00, 0x00, 0x00, 0xbc, 0x00, 0x00, 0x00, 0x5e,
388 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
389 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02,
390 0x00, 0x00, 0x00, 0xbc, 0x00, 0x00, 0x00, 0x5b,
391 0x00, 0x00, 0x24, 0x63, 0x6f, 0x6d, 0x2e, 0x61,
392 0x70, 0x70, 0x6c, 0x65, 0x2e, 0x6d, 0x65, 0x74,
393 0x61, 0x64, 0x61, 0x74, 0x61, 0x3a, 0x5f, 0x6b,
394 0x4d, 0x44, 0x49, 0x74, 0x65, 0x6d, 0x55, 0x73,
395 0x65, 0x72, 0x54, 0x61, 0x67, 0x73, 0x00, 0x00,
396 0x00, 0x00, 0x01, 0x17, 0x00, 0x00, 0x00, 0x03,
397 0x00, 0x00, 0x08, 0x66, 0x6f, 0x6f, 0x3a, 0x62,
398 0x61, 0x72, 0x00, 0x66, 0x62, 0x70, 0x6c, 0x69,
399 0x73, 0x74, 0x30, 0x30, 0xa5, 0x01, 0x02, 0x03,
400 0x04, 0x05, 0x54, 0x74, 0x65, 0x73, 0x74, 0x66,
401 0x00, 0x47, 0x00, 0x72, 0x00, 0xfc, 0x00, 0x6e,
402 0x00, 0x0a, 0x00, 0x32, 0x56, 0x4c, 0x69, 0x6c,
403 0x61, 0x0a, 0x33, 0x56, 0x47, 0x65, 0x6c, 0x62,
404 0x0a, 0x35, 0x56, 0x42, 0x6c, 0x61, 0x75, 0x0a,
405 0x34, 0x08, 0x0e, 0x13, 0x20, 0x27, 0x2e, 0x00,
406 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, 0x00,
407 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, 0x00,
408 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
409 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x35, 0x62,
410 0x61, 0x7a, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
411 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
412 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
413 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
414 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
415 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
416 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
417 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
418 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
419 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
420 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
421 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
422 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
423 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
424 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
425 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
426 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
427 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
428 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
429 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
430 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
431 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
432 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
433 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
434 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
435 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
436 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
437 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
438 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
439 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
440 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
441 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
442 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
443 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
444 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
445 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
446 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
447 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
448 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
449 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
450 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
451 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
452 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
453 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
454 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
455 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
456 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
457 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
458 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
459 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
460 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
461 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
462 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
463 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
464 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
465 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
466 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
467 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
468 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
469 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
470 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
471 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
472 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
473 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
474 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
475 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
476 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
477 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
478 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
479 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
480 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
481 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
482 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
483 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
484 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
485 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
486 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
487 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
488 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
489 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
490 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
491 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
492 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
493 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
494 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
495 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
496 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
497 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
498 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
499 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
500 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
501 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
502 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
503 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
504 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
505 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
506 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
507 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
508 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
509 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
510 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
511 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
512 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
513 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
514 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
515 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
516 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
517 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
518 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
519 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
520 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
521 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
522 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
523 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
524 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
525 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
526 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
527 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
528 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
529 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
530 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
531 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
532 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
533 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
534 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
535 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
536 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
537 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
538 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
539 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
540 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
541 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
542 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
543 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
544 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
545 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
546 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
547 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
548 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
549 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
550 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
551 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
552 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
553 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
554 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
555 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
556 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
557 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
558 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
559 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
560 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
561 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
562 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
563 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
564 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
565 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
566 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
567 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
568 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
569 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
570 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
571 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
572 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
573 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
574 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
575 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
576 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
577 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
578 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
579 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
580 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
581 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
582 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
583 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
584 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
585 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
586 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
587 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
588 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
589 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
590 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
591 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
592 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
593 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
594 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
595 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
596 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
597 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
598 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
599 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
600 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
601 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
602 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
603 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
604 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
605 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
606 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
607 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
608 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
609 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
610 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
611 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
612 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
613 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
614 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
615 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
616 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
617 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
618 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
619 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
620 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
621 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
622 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
623 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
624 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
625 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
626 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
627 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
628 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
629 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
630 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
631 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
632 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
633 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
634 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
635 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
636 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
637 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
638 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
639 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
640 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
641 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
642 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
643 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
644 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
645 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
646 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
647 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
648 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
649 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
650 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
651 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
652 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
653 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
654 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
655 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
656 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
657 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
658 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
659 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
660 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
661 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
662 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
663 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
664 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
665 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
666 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
667 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
668 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
669 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
670 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
671 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
672 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
673 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
674 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
675 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
676 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
677 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
678 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
679 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
680 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
681 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
682 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
683 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
684 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
685 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
686 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
687 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
688 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
689 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
690 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
691 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
692 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
693 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
694 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
695 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
696 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
697 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
698 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
699 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
700 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
701 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
702 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
703 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
704 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
705 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
706 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
707 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
708 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
709 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
710 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
711 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
712 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
713 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
714 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
715 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
716 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
717 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
718 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
719 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
720 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
721 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
722 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
723 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
724 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
725 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
726 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
727 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
728 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
729 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
730 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
731 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
732 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
733 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
734 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
735 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
736 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
737 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
738 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
739 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
740 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
741 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
742 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
743 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
744 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
745 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
746 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
747 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
748 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
749 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
750 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
751 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
752 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
753 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
754 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
755 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
756 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
757 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
758 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
759 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
760 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
761 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
762 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
763 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
764 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
765 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
766 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
767 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
768 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
769 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
770 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
771 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
772 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
773 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
774 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
775 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
776 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
777 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
778 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
779 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
780 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
781 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
782 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
783 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
784 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
785 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
786 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
787 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
788 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
789 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
790 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
791 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
792 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
793 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
794 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
795 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
796 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
797 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
798 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
799 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
800 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
801 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
802 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
803 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
804 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
805 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
806 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
807 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
808 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
809 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
810 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
811 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
812 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
813 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
814 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
815 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
816 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
817 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
818 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
819 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
820 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
821 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
822 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
823 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
824 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
825 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
826 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
827 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
828 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
829 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
830 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
831 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
832 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
833 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
834 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
835 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
836 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
837 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
838 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
839 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
840 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
841 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
842 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
843 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
844 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
845 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
846 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
847 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
848 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
849 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
850 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
851 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00,
852 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
853 0x00, 0x1e, 0x54, 0x68, 0x69, 0x73, 0x20, 0x72,
854 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x20,
855 0x66, 0x6f, 0x72, 0x6b, 0x20, 0x69, 0x6e, 0x74,
856 0x65, 0x6e, 0x74, 0x69, 0x6f, 0x6e, 0x61, 0x6c,
857 0x6c, 0x79, 0x20, 0x6c, 0x65, 0x66, 0x74, 0x20,
858 0x62, 0x6c, 0x61, 0x6e, 0x6b, 0x20, 0x20, 0x20,
859 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
860 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
861 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
862 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
863 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
864 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
865 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
866 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
867 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
868 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
869 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
870 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
871 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
872 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
873 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
874 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
875 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
876 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
877 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
878 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
879 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
880 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
881 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
882 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
883 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00,
884 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
885 0x00, 0x1e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
886 0x00, 0x00, 0x00, 0x1c, 0x00, 0x1e, 0xff, 0xff
890 * The buf below contains the following AppleDouble encoded data:
892 * -------------------------------------------------------------------------------
893 * MagicNumber: 00051607 : AppleDouble
894 * Version : 00020000 : Version 2
895 * Filler : 4D 61 63 20 4F 53 20 58 20 20 20 20 20 20 20 20 : Mac OS X
896 * Num. of ent: 0002 : 2
898 * -------------------------------------------------------------------------------
899 * Entry ID : 00000002 : Resource Fork
900 * Offset : 00000052 : 82
901 * Length : 0000011E : 286
903 * -RAW DUMP--: 0 1 2 3 4 5 6 7 8 9 A B C D E F : (ASCII)
904 * 00000000 : 00 00 01 00 00 00 01 00 00 00 00 00 00 00 00 1E : ................
905 * 00000010 : F0 F1 F2 F3 F5 F5 F6 F7 F8 F9 FA FB FC FD FE FF : ................
906 * 00000020 : 72 6B 20 69 6E 74 65 6E 74 69 6F 6E 61 6C 6C 79 : rk intentionally
907 * 00000030 : 20 6C 65 66 74 20 62 6C 61 6E 6B 20 20 20 00 00 : left blank ..
908 * 00000040 : 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 : ................
909 * 00000050 : 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 : ................
910 * 00000060 : 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 : ................
911 * 00000070 : 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 : ................
912 * 00000080 : 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 : ................
913 * 00000090 : 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 : ................
914 * 000000A0 : 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 : ................
915 * 000000B0 : 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 : ................
916 * 000000C0 : 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 : ................
917 * 000000D0 : 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 : ................
918 * 000000E0 : 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 : ................
919 * 000000F0 : 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 : ................
920 * 00000100 : 00 00 01 00 00 00 01 00 00 00 00 00 00 00 00 1E : ................
921 * 00000110 : 00 00 00 00 00 00 00 00 00 1C 00 1E FF FF : ..............
923 * Entry ID : 00000009 : Finder Info
924 * Offset : 00000032 : 50
925 * Length : 00000020 : 32
927 * -NOTE------: cannot detect whether FInfo or DInfo. assume FInfo.
929 * -FInfo-----:
930 * Type : 57415645 : WAVE
931 * Creator : 5054756C : PTul
932 * isAlias : 0
933 * Invisible : 0
934 * hasBundle : 0
935 * nameLocked : 0
936 * Stationery : 0
937 * CustomIcon : 0
938 * Reserved : 0
939 * Inited : 0
940 * NoINITS : 0
941 * Shared : 0
942 * SwitchLaunc: 0
943 * Hidden Ext : 0
944 * color : 000 : none
945 * isOnDesk : 0
946 * Location v : 0000 : 0
947 * Location h : 0000 : 0
948 * Fldr : 0000 : ..
950 * -FXInfo----:
951 * Rsvd|IconID: 0000 : 0
952 * Rsvd : 0000 : ..
953 * Rsvd : 0000 : ..
954 * Rsvd : 0000 : ..
955 * AreInvalid : 0
956 * unknown bit: 0
957 * unknown bit: 0
958 * unknown bit: 0
959 * unknown bit: 0
960 * unknown bit: 0
961 * unknown bit: 0
962 * CustomBadge: 0
963 * ObjctIsBusy: 0
964 * unknown bit: 0
965 * unknown bit: 0
966 * unknown bit: 0
967 * unknown bit: 0
968 * RoutingInfo: 0
969 * unknown bit: 0
970 * unknown bit: 0
971 * Rsvd|commnt: 0000 : 0
972 * PutAway : 00000000 : 0
974 * -RAW DUMP--: 0 1 2 3 4 5 6 7 8 9 A B C D E F : (ASCII)
975 * 00000000 : 57 41 56 45 50 54 75 6C 00 00 00 00 00 00 00 00 : WAVEPTul........
976 * 00000010 : 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 : ................
978 * It was created with:
979 * $ hexdump -ve '"\t" 7/1 "0x%02x, " 1/1 " 0x%02x," "\n"'
981 static char osx_adouble_without_xattr[] = {
982 0x00, 0x05, 0x16, 0x07, 0x00, 0x02, 0x00, 0x00,
983 0x4d, 0x61, 0x63, 0x20, 0x4f, 0x53, 0x20, 0x58,
984 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
985 0x00, 0x02, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00,
986 0x00, 0x52, 0x00, 0x00, 0x01, 0x1e, 0x00, 0x00,
987 0x00, 0x09, 0x00, 0x00, 0x00, 0x32, 0x00, 0x00,
988 0x00, 0x20, 0x57, 0x41, 0x56, 0x45, 0x50, 0x54,
989 0x75, 0x6c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
990 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
991 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
992 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00,
993 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
994 0x00, 0x1e, 0xf0, 0xf1, 0xf2, 0xf3, 0xf4, 0xf5,
995 0xf6, 0xf7, 0xf8, 0xf9, 0xfa, 0xfb, 0xfc, 0xfd,
996 0xfe, 0xff, 0x72, 0x6b, 0x20, 0x69, 0x6e, 0x74,
997 0x65, 0x6e, 0x74, 0x69, 0x6f, 0x6e, 0x61, 0x6c,
998 0x6c, 0x79, 0x20, 0x6c, 0x65, 0x66, 0x74, 0x20,
999 0x62, 0x6c, 0x61, 0x6e, 0x6b, 0x20, 0x20, 0x20,
1000 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1001 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1002 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1003 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1004 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1005 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1006 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1007 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1008 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1009 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1010 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1011 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1012 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1013 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1014 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1015 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1016 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1017 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1018 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1019 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1020 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1021 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1022 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1023 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1024 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00,
1025 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1026 0x00, 0x1e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1027 0x00, 0x00, 0x00, 0x1c, 0x00, 0x1e, 0xff, 0xff
1031 The buf below contains the following AppleDouble encoded data:
1033 -------------------------------------------------------------------------------
1034 MagicNumber: 00051607 : AppleDouble
1035 Version : 00020000 : Version 2
1036 Filler : 4D 61 63 20 4F 53 20 58 20 20 20 20 20 20 20 20 : Mac OS X
1037 Num. of ent: 0002 : 2
1039 -------------------------------------------------------------------------------
1040 Entry ID : 00000009 : Finder Info
1041 Offset : 00000032 : 50
1042 Length : 00000EB0 : 3760
1044 -FInfo-----:
1045 Type : 54455354 : TEST
1046 Creator : 534C4F57 : SLOW
1047 isAlias : 0
1048 Invisible : 0
1049 hasBundle : 0
1050 nameLocked : 0
1051 Stationery : 0
1052 CustomIcon : 0
1053 Reserved : 0
1054 Inited : 0
1055 NoINITS : 0
1056 Shared : 0
1057 SwitchLaunc: 0
1058 Hidden Ext : 0
1059 color : 100 : blue
1060 isOnDesk : 0
1061 Location v : 0000 : 0
1062 Location h : 0000 : 0
1063 Fldr : 0000 : ..
1065 -FXInfo----:
1066 Rsvd|IconID: 0000 : 0
1067 Rsvd : 0000 : ..
1068 Rsvd : 0000 : ..
1069 Rsvd : 0000 : ..
1070 AreInvalid : 0
1071 unknown bit: 0
1072 unknown bit: 0
1073 unknown bit: 0
1074 unknown bit: 0
1075 unknown bit: 0
1076 unknown bit: 0
1077 CustomBadge: 0
1078 ObjctIsBusy: 0
1079 unknown bit: 0
1080 unknown bit: 0
1081 unknown bit: 0
1082 unknown bit: 0
1083 RoutingInfo: 0
1084 unknown bit: 0
1085 unknown bit: 0
1086 Rsvd|commnt: 0000 : 0
1087 PutAway : 00000000 : 0
1089 -EA--------:
1090 pad : 0000 : ..
1091 magic : 41545452 : ATTR
1092 debug_tag : 53D4580C : 1406425100
1093 total_size : 00000EE2 : 3810
1094 data_start : 000000BC : 188
1095 data_length: 0000005E : 94
1096 reserved[0]: 00000000 : ....
1097 reserved[1]: 00000000 : ....
1098 reserved[2]: 00000000 : ....
1099 flags : 0000 : ..
1100 num_attrs : 0002 : 2
1101 -EA ENTRY--:
1102 offset : 000000BC : 188
1103 length : 0000005B : 91
1104 flags : 0000 : ..
1105 namelen : 24 : 36
1106 -EA NAME---: 0 1 2 3 4 5 6 7 8 9 A B C D E F : (ASCII)
1107 00000000 : 63 6F 6D 2E 61 70 70 6C 65 2E 6D 65 74 61 64 61 : com.apple.metada
1108 00000010 : 74 61 3A 5F 6B 4D 44 49 74 65 6D 55 73 65 72 54 : ta:_kMDItemUserT
1109 00000020 : 61 67 73 00 : ags.
1110 -EA VALUE--: 0 1 2 3 4 5 6 7 8 9 A B C D E F : (ASCII)
1111 00000000 : 62 70 6C 69 73 74 30 30 A5 01 02 03 04 05 54 74 : bplist00......Tt
1112 00000010 : 65 73 74 66 00 47 00 72 00 FC 00 6E 00 0A 00 32 : estf.G.r...n...2
1113 00000020 : 56 4C 69 6C 61 0A 33 56 47 65 6C 62 0A 35 56 42 : VLila.3VGelb.5VB
1114 00000030 : 6C 61 75 0A 34 08 0E 13 20 27 2E 00 00 00 00 00 : lau.4... '......
1115 00000040 : 00 01 01 00 00 00 00 00 00 00 06 00 00 00 00 00 : ................
1116 00000050 : 00 00 00 00 00 00 00 00 00 00 35 : ..........5
1117 -EA ENTRY--:
1118 offset : 00000117 : 279
1119 length : 00000003 : 3
1120 flags : 0000 : ..
1121 namelen : 08 : 8
1122 -EA NAME---: 0 1 2 3 4 5 6 7 8 9 A B C D E F : (ASCII)
1123 00000000 : 66 6F 6F 3A 62 61 72 00 : foo:bar.
1124 -EA VALUE--: 0 1 2 3 4 5 6 7 8 9 A B C D E F : (ASCII)
1125 00000000 : 62 61 7A : baz
1127 -RAW DUMP--: 0 1 2 3 4 5 6 7 8 9 A B C D E F : (ASCII)
1128 00000000 : 54 45 53 54 53 4C 4F 57 00 08 00 00 00 00 00 00 : TESTSLOW........
1129 00000010 : 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 : ................
1130 00000020 : 00 00 41 54 54 52 53 D4 58 0C 00 00 0E E2 00 00 : ..ATTRS.X.......
1131 00000030 : 00 BC 00 00 00 5E 00 00 00 00 00 00 00 00 00 00 : .....^..........
1132 00000040 : 00 00 00 00 00 02 00 00 00 BC 00 00 00 5B 00 00 : .............[..
1133 00000050 : 24 63 6F 6D 2E 61 70 70 6C 65 2E 6D 65 74 61 64 : $com.apple.metad
1134 00000060 : 61 74 61 3A 5F 6B 4D 44 49 74 65 6D 55 73 65 72 : ata:_kMDItemUser
1135 00000070 : 54 61 67 73 00 00 00 00 01 17 00 00 00 03 00 00 : Tags............
1136 00000080 : 08 66 6F 6F 3A 62 61 72 00 66 62 70 6C 69 73 74 : .foo:bar.fbplist
1137 00000090 : 30 30 A5 01 02 03 04 05 54 74 65 73 74 66 00 47 : 00......Ttestf.G
1138 000000A0 : 00 72 00 FC 00 6E 00 0A 00 32 56 4C 69 6C 61 0A : .r...n...2VLila.
1139 000000B0 : 33 56 47 65 6C 62 0A 35 56 42 6C 61 75 0A 34 08 : 3VGelb.5VBlau.4.
1140 000000C0 : 0E 13 20 27 2E 00 00 00 00 00 00 01 01 00 00 00 : .. '............
1141 000000D0 : 00 00 00 00 06 00 00 00 00 00 00 00 00 00 00 00 : ................
1142 000000E0 : 00 00 00 00 35 62 61 7A 00 00 00 00 00 00 00 00 : ....5baz........
1143 000000F0 : 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 : ................
1144 ... all zeroes ...
1145 00000EA0 : 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 : ................
1147 -------------------------------------------------------------------------------
1148 Entry ID : 00000002 : Resource Fork
1149 Offset : 00000EE2 : 3810
1150 Length : 0000011E : 286
1152 -RAW DUMP--: 0 1 2 3 4 5 6 7 8 9 A B C D E F : (ASCII)
1153 00000000 : 00 00 01 00 00 00 01 00 00 00 00 00 00 00 00 1E : ................
1154 00000010 : F0 F1 F2 F3 F4 F5 F6 F7 F8 F9 FA FB FC FD FE FF : This resource fo
1155 00000020 : 72 6B 20 69 6E 74 65 6E 74 69 6F 6E 61 6C 6C 79 : rk intentionally
1156 00000030 : 20 6C 65 66 74 20 62 6C 61 6E 6B 20 20 20 00 00 : left blank ..
1157 00000040 : 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 : ................
1158 00000050 : 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 : ................
1159 00000060 : 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 : ................
1160 00000070 : 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 : ................
1161 00000080 : 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 : ................
1162 00000090 : 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 : ................
1163 000000A0 : 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 : ................
1164 000000B0 : 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 : ................
1165 000000C0 : 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 : ................
1166 000000D0 : 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 : ................
1167 000000E0 : 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 : ................
1168 000000F0 : 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 : ................
1169 00000100 : 00 00 01 00 00 00 01 00 00 00 00 00 00 00 00 1E : ................
1170 00000110 : 00 00 00 00 00 00 00 00 00 1C 00 1E FF FF : ..............
1172 It was created with:
1173 $ hexdump -ve '"\t" 7/1 "0x%02x, " 1/1 " 0x%02x," "\n"'
1175 static char osx_adouble_non_empty_rfork_w_xattr[] = {
1176 0x00, 0x05, 0x16, 0x07, 0x00, 0x02, 0x00, 0x00,
1177 0x4d, 0x61, 0x63, 0x20, 0x4f, 0x53, 0x20, 0x58,
1178 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
1179 0x00, 0x02, 0x00, 0x00, 0x00, 0x09, 0x00, 0x00,
1180 0x00, 0x32, 0x00, 0x00, 0x0e, 0xb0, 0x00, 0x00,
1181 0x00, 0x02, 0x00, 0x00, 0x0e, 0xe2, 0x00, 0x00,
1182 0x01, 0x1e, 0x54, 0x45, 0x53, 0x54, 0x53, 0x4c,
1183 0x4f, 0x57, 0x00, 0x08, 0x00, 0x00, 0x00, 0x00,
1184 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1185 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1186 0x00, 0x00, 0x00, 0x00, 0x41, 0x54, 0x54, 0x52,
1187 0x53, 0xd4, 0x58, 0x0c, 0x00, 0x00, 0x0e, 0xe2,
1188 0x00, 0x00, 0x00, 0xbc, 0x00, 0x00, 0x00, 0x5e,
1189 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1190 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02,
1191 0x00, 0x00, 0x00, 0xbc, 0x00, 0x00, 0x00, 0x5b,
1192 0x00, 0x00, 0x24, 0x63, 0x6f, 0x6d, 0x2e, 0x61,
1193 0x70, 0x70, 0x6c, 0x65, 0x2e, 0x6d, 0x65, 0x74,
1194 0x61, 0x64, 0x61, 0x74, 0x61, 0x3a, 0x5f, 0x6b,
1195 0x4d, 0x44, 0x49, 0x74, 0x65, 0x6d, 0x55, 0x73,
1196 0x65, 0x72, 0x54, 0x61, 0x67, 0x73, 0x00, 0x00,
1197 0x00, 0x00, 0x01, 0x17, 0x00, 0x00, 0x00, 0x03,
1198 0x00, 0x00, 0x08, 0x66, 0x6f, 0x6f, 0x3a, 0x62,
1199 0x61, 0x72, 0x00, 0x66, 0x62, 0x70, 0x6c, 0x69,
1200 0x73, 0x74, 0x30, 0x30, 0xa5, 0x01, 0x02, 0x03,
1201 0x04, 0x05, 0x54, 0x74, 0x65, 0x73, 0x74, 0x66,
1202 0x00, 0x47, 0x00, 0x72, 0x00, 0xfc, 0x00, 0x6e,
1203 0x00, 0x0a, 0x00, 0x32, 0x56, 0x4c, 0x69, 0x6c,
1204 0x61, 0x0a, 0x33, 0x56, 0x47, 0x65, 0x6c, 0x62,
1205 0x0a, 0x35, 0x56, 0x42, 0x6c, 0x61, 0x75, 0x0a,
1206 0x34, 0x08, 0x0e, 0x13, 0x20, 0x27, 0x2e, 0x00,
1207 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, 0x00,
1208 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, 0x00,
1209 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1210 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x35, 0x62,
1211 0x61, 0x7a, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1212 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1213 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1214 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1215 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1216 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1217 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1218 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1219 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1220 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1221 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1222 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1223 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1224 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1225 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1226 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1227 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1228 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1229 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1230 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1231 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1232 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1233 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1234 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1235 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1236 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1237 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1238 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1239 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1240 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1241 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1242 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1243 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1244 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1245 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1246 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1247 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1248 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1249 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1250 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1251 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1252 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1253 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1254 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1255 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1256 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1257 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1258 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1259 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1260 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1261 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1262 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1263 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1264 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1265 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1266 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1267 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1268 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1269 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1270 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1271 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1272 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1273 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1274 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1275 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1276 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1277 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1278 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1279 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1280 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1281 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1282 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1283 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1284 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1285 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1286 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1287 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1288 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1289 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1290 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1291 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1292 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1293 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1294 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1295 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1296 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1297 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1298 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1299 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1300 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1301 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1302 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1303 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1304 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1305 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1306 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1307 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1308 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1309 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1310 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1311 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1312 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1313 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1314 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1315 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1316 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1317 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1318 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1319 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1320 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1321 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1322 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1323 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1324 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1325 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1326 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1327 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1328 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1329 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1330 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1331 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1332 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1333 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1334 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1335 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1336 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1337 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1338 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1339 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1340 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1341 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1342 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1343 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1344 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1345 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1346 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1347 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1348 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1349 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1350 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1351 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1352 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1353 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1354 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1355 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1356 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1357 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1358 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1359 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1360 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1361 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1362 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1363 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1364 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1365 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1366 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1367 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1368 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1369 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1370 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1371 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1372 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1373 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1374 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1375 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1376 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1377 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1378 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1379 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1380 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1381 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1382 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1383 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1384 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1385 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1386 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1387 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1388 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1389 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1390 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1391 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1392 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1393 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1394 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1395 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1396 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1397 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1398 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1399 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1400 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1401 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1402 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1403 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1404 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1405 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1406 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1407 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1408 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1409 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1410 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1411 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1412 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1413 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1414 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1415 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1416 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1417 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1418 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1419 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1420 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1421 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1422 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1423 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1424 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1425 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1426 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1427 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1428 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1429 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1430 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1431 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1432 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1433 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1434 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1435 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1436 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1437 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1438 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1439 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1440 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1441 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1442 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1443 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1444 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1445 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1446 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1447 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1448 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1449 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1450 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1451 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1452 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1453 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1454 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1455 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1456 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1457 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1458 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1459 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1460 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1461 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1462 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1463 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1464 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1465 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1466 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1467 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1468 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1469 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1470 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1471 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1472 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1473 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1474 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1475 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1476 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1477 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1478 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1479 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1480 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1481 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1482 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1483 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1484 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1485 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1486 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1487 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1488 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1489 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1490 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1491 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1492 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1493 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1494 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1495 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1496 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1497 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1498 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1499 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1500 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1501 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1502 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1503 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1504 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1505 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1506 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1507 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1508 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1509 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1510 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1511 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1512 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1513 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1514 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1515 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1516 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1517 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1518 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1519 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1520 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1521 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1522 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1523 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1524 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1525 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1526 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1527 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1528 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1529 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1530 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1531 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1532 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1533 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1534 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1535 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1536 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1537 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1538 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1539 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1540 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1541 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1542 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1543 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1544 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1545 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1546 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1547 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1548 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1549 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1550 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1551 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1552 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1553 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1554 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1555 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1556 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1557 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1558 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1559 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1560 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1561 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1562 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1563 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1564 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1565 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1566 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1567 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1568 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1569 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1570 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1571 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1572 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1573 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1574 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1575 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1576 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1577 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1578 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1579 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1580 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1581 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1582 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1583 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1584 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1585 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1586 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1587 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1588 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1589 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1590 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1591 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1592 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1593 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1594 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1595 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1596 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1597 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1598 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1599 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1600 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1601 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1602 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1603 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1604 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1605 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1606 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1607 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1608 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1609 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1610 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1611 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1612 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1613 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1614 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1615 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1616 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1617 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1618 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1619 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1620 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1621 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1622 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1623 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1624 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1625 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1626 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1627 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1628 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1629 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1630 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1631 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1632 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1633 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1634 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1635 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1636 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1637 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1638 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1639 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1640 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1641 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1642 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1643 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1644 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1645 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1646 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1647 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1648 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1649 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1650 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1651 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1652 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00,
1653 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1654 0x00, 0x1e, 0xf0, 0xf1, 0xf2, 0xf3, 0xf4, 0xf5,
1655 0xf6, 0xf7, 0xf8, 0xf9, 0xfa, 0xfb, 0xfc, 0xfd,
1656 0xfe, 0xff, 0x72, 0x6b, 0x20, 0x69, 0x6e, 0x74,
1657 0x65, 0x6e, 0x74, 0x69, 0x6f, 0x6e, 0x61, 0x6c,
1658 0x6c, 0x79, 0x20, 0x6c, 0x65, 0x66, 0x74, 0x20,
1659 0x62, 0x6c, 0x61, 0x6e, 0x6b, 0x20, 0x20, 0x20,
1660 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1661 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1662 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1663 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1664 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1665 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1666 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1667 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1668 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1669 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1670 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1671 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1672 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1673 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1674 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1675 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1676 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1677 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1678 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1679 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1680 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1681 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1682 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1683 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1684 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00,
1685 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1686 0x00, 0x1e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1687 0x00, 0x00, 0x00, 0x1c, 0x00, 0x1e, 0xff, 0xff
1691 * talloc and intialize an AfpInfo
1693 static AfpInfo *torture_afpinfo_new(TALLOC_CTX *mem_ctx)
1695 AfpInfo *info;
1697 info = talloc_zero(mem_ctx, AfpInfo);
1698 if (info == NULL) {
1699 return NULL;
1702 info->afpi_Signature = AFP_Signature;
1703 info->afpi_Version = AFP_Version;
1704 info->afpi_BackupTime = AFP_BackupTime;
1706 return info;
1710 * Pack AfpInfo into a talloced buffer
1712 static char *torture_afpinfo_pack(TALLOC_CTX *mem_ctx,
1713 AfpInfo *info)
1715 char *buf;
1717 buf = talloc_zero_array(mem_ctx, char, AFP_INFO_SIZE);
1718 if (buf == NULL) {
1719 return NULL;
1722 RSIVAL(buf, 0, info->afpi_Signature);
1723 RSIVAL(buf, 4, info->afpi_Version);
1724 RSIVAL(buf, 12, info->afpi_BackupTime);
1725 memcpy(buf + 16, info->afpi_FinderInfo, sizeof(info->afpi_FinderInfo));
1727 return buf;
1731 * Unpack AfpInfo
1733 #if 0
1734 static void torture_afpinfo_unpack(AfpInfo *info, char *data)
1736 info->afpi_Signature = RIVAL(data, 0);
1737 info->afpi_Version = RIVAL(data, 4);
1738 info->afpi_BackupTime = RIVAL(data, 12);
1739 memcpy(info->afpi_FinderInfo, (const char *)data + 16,
1740 sizeof(info->afpi_FinderInfo));
1742 #endif
1744 static bool torture_write_afpinfo(struct smb2_tree *tree,
1745 struct torture_context *tctx,
1746 TALLOC_CTX *mem_ctx,
1747 const char *fname,
1748 AfpInfo *info)
1750 struct smb2_handle handle;
1751 struct smb2_create io;
1752 NTSTATUS status;
1753 const char *full_name;
1754 char *infobuf;
1755 bool ret = true;
1757 full_name = talloc_asprintf(mem_ctx, "%s%s", fname, AFPINFO_STREAM_NAME);
1758 if (full_name == NULL) {
1759 torture_comment(tctx, "talloc_asprintf error\n");
1760 return false;
1762 ZERO_STRUCT(io);
1763 io.in.desired_access = SEC_FILE_WRITE_DATA;
1764 io.in.file_attributes = FILE_ATTRIBUTE_NORMAL;
1765 io.in.create_disposition = NTCREATEX_DISP_OVERWRITE_IF;
1766 io.in.create_options = 0;
1767 io.in.fname = full_name;
1769 status = smb2_create(tree, mem_ctx, &io);
1770 CHECK_STATUS(status, NT_STATUS_OK);
1772 handle = io.out.file.handle;
1774 infobuf = torture_afpinfo_pack(mem_ctx, info);
1775 if (infobuf == NULL) {
1776 return false;
1779 status = smb2_util_write(tree, handle, infobuf, 0, AFP_INFO_SIZE);
1780 CHECK_STATUS(status, NT_STATUS_OK);
1782 smb2_util_close(tree, handle);
1784 done:
1785 return ret;
1789 * Read 'count' bytes at 'offset' from stream 'fname:sname' and
1790 * compare against buffer 'value'
1792 static bool check_stream(struct smb2_tree *tree,
1793 const char *location,
1794 struct torture_context *tctx,
1795 TALLOC_CTX *mem_ctx,
1796 const char *fname,
1797 const char *sname,
1798 off_t read_offset,
1799 size_t read_count,
1800 off_t comp_offset,
1801 size_t comp_count,
1802 const char *value)
1804 struct smb2_handle handle;
1805 struct smb2_create create;
1806 struct smb2_read r;
1807 NTSTATUS status;
1808 char *full_name;
1809 bool ret = true;
1811 full_name = talloc_asprintf(mem_ctx, "%s%s", fname, sname);
1812 if (full_name == NULL) {
1813 torture_comment(tctx, "talloc_asprintf error\n");
1814 return false;
1816 ZERO_STRUCT(create);
1817 create.in.desired_access = SEC_FILE_READ_DATA;
1818 create.in.file_attributes = FILE_ATTRIBUTE_NORMAL;
1819 create.in.create_disposition = NTCREATEX_DISP_OPEN;
1820 create.in.fname = full_name;
1822 torture_comment(tctx, "Open stream %s\n", full_name);
1824 status = smb2_create(tree, mem_ctx, &create);
1825 if (!NT_STATUS_IS_OK(status)) {
1826 if (value == NULL) {
1827 TALLOC_FREE(full_name);
1828 return true;
1830 torture_comment(tctx, "Unable to open stream %s: %s\n",
1831 full_name, nt_errstr(status));
1832 TALLOC_FREE(full_name);
1833 return false;
1836 handle = create.out.file.handle;
1837 if (value == NULL) {
1838 TALLOC_FREE(full_name);
1839 smb2_util_close(tree, handle);
1840 return true;
1843 ZERO_STRUCT(r);
1844 r.in.file.handle = handle;
1845 r.in.length = read_count;
1846 r.in.offset = read_offset;
1848 status = smb2_read(tree, tree, &r);
1850 torture_assert_ntstatus_ok_goto(
1851 tctx, status, ret, done,
1852 talloc_asprintf(tctx, "(%s) Failed to read %lu bytes from stream '%s'\n",
1853 location, (long)strlen(value), full_name));
1855 torture_assert_goto(tctx, r.out.data.length == read_count, ret, done,
1856 talloc_asprintf(tctx, "smb2_read returned %jd bytes, expected %jd\n",
1857 (intmax_t)r.out.data.length, (intmax_t)read_count));
1859 torture_assert_goto(
1860 tctx, memcmp(r.out.data.data + comp_offset, value, comp_count) == 0,
1861 ret, done,
1862 talloc_asprintf(tctx, "(%s) Bad data in stream\n", location));
1864 done:
1865 TALLOC_FREE(full_name);
1866 smb2_util_close(tree, handle);
1867 return ret;
1871 * Read 'count' bytes at 'offset' from stream 'fname:sname' and
1872 * compare against buffer 'value'
1874 static ssize_t read_stream(struct smb2_tree *tree,
1875 const char *location,
1876 struct torture_context *tctx,
1877 TALLOC_CTX *mem_ctx,
1878 const char *fname,
1879 const char *sname,
1880 off_t read_offset,
1881 size_t read_count)
1883 struct smb2_handle handle;
1884 struct smb2_create create;
1885 struct smb2_read r;
1886 NTSTATUS status;
1887 const char *full_name;
1888 bool ret = true;
1890 full_name = talloc_asprintf(mem_ctx, "%s%s", fname, sname);
1891 if (full_name == NULL) {
1892 torture_comment(tctx, "talloc_asprintf error\n");
1893 return -1;
1895 ZERO_STRUCT(create);
1896 create.in.desired_access = SEC_FILE_READ_DATA;
1897 create.in.file_attributes = FILE_ATTRIBUTE_NORMAL;
1898 create.in.create_disposition = NTCREATEX_DISP_OPEN;
1899 create.in.fname = full_name;
1901 torture_comment(tctx, "Open stream %s\n", full_name);
1903 status = smb2_create(tree, mem_ctx, &create);
1904 if (!NT_STATUS_IS_OK(status)) {
1905 torture_comment(tctx, "Unable to open stream %s: %s\n",
1906 full_name, nt_errstr(status));
1907 return -1;
1910 handle = create.out.file.handle;
1912 ZERO_STRUCT(r);
1913 r.in.file.handle = handle;
1914 r.in.length = read_count;
1915 r.in.offset = read_offset;
1917 status = smb2_read(tree, tree, &r);
1918 if (!NT_STATUS_IS_OK(status)) {
1919 CHECK_STATUS(status, NT_STATUS_END_OF_FILE);
1922 smb2_util_close(tree, handle);
1924 done:
1925 if (ret == false) {
1926 return -1;
1928 return r.out.data.length;
1932 * Read 'count' bytes at 'offset' from stream 'fname:sname' and
1933 * compare against buffer 'value'
1935 static bool write_stream(struct smb2_tree *tree,
1936 const char *location,
1937 struct torture_context *tctx,
1938 TALLOC_CTX *mem_ctx,
1939 const char *fname,
1940 const char *sname,
1941 off_t offset,
1942 size_t size,
1943 const char *value)
1945 struct smb2_handle handle;
1946 struct smb2_create create;
1947 NTSTATUS status;
1948 const char *full_name;
1950 full_name = talloc_asprintf(mem_ctx, "%s%s", fname, sname ? sname : "");
1951 if (full_name == NULL) {
1952 torture_comment(tctx, "talloc_asprintf error\n");
1953 return false;
1955 ZERO_STRUCT(create);
1956 create.in.desired_access = SEC_FILE_WRITE_DATA;
1957 create.in.file_attributes = FILE_ATTRIBUTE_NORMAL;
1958 create.in.create_disposition = NTCREATEX_DISP_OPEN_IF;
1959 create.in.fname = full_name;
1961 status = smb2_create(tree, mem_ctx, &create);
1962 if (!NT_STATUS_IS_OK(status)) {
1963 if (value == NULL) {
1964 return true;
1965 } else {
1966 torture_comment(tctx, "Unable to open stream %s: %s\n",
1967 full_name, nt_errstr(status));
1968 return false;
1972 handle = create.out.file.handle;
1973 if (value == NULL) {
1974 return true;
1977 status = smb2_util_write(tree, handle, value, offset, size);
1979 if (!NT_STATUS_IS_OK(status)) {
1980 torture_comment(tctx, "(%s) Failed to write %lu bytes to "
1981 "stream '%s'\n", location, (long)size, full_name);
1982 return false;
1985 smb2_util_close(tree, handle);
1986 return true;
1989 static bool torture_setup_local_xattr(struct torture_context *tctx,
1990 const char *path_option,
1991 const char *name,
1992 const char *xattr,
1993 const char *metadata,
1994 size_t size)
1996 int ret = true;
1997 int result;
1998 const char *spath;
1999 char *path;
2001 spath = torture_setting_string(tctx, path_option, NULL);
2002 if (spath == NULL) {
2003 printf("No sharepath for option %s\n", path_option);
2004 return false;
2007 path = talloc_asprintf(tctx, "%s/%s", spath, name);
2009 result = setxattr(path, xattr, metadata, size, 0);
2010 if (result != 0) {
2011 ret = false;
2014 TALLOC_FREE(path);
2016 return ret;
2020 * Create a file or directory
2022 static bool torture_setup_file(TALLOC_CTX *mem_ctx, struct smb2_tree *tree,
2023 const char *name, bool dir)
2025 struct smb2_create io;
2026 NTSTATUS status;
2028 smb2_util_unlink(tree, name);
2029 ZERO_STRUCT(io);
2030 io.in.desired_access = SEC_FLAG_MAXIMUM_ALLOWED;
2031 io.in.file_attributes = FILE_ATTRIBUTE_NORMAL;
2032 io.in.create_disposition = NTCREATEX_DISP_OVERWRITE_IF;
2033 io.in.share_access =
2034 NTCREATEX_SHARE_ACCESS_DELETE|
2035 NTCREATEX_SHARE_ACCESS_READ|
2036 NTCREATEX_SHARE_ACCESS_WRITE;
2037 io.in.create_options = 0;
2038 io.in.fname = name;
2039 if (dir) {
2040 io.in.create_options = NTCREATEX_OPTIONS_DIRECTORY;
2041 io.in.share_access &= ~NTCREATEX_SHARE_ACCESS_DELETE;
2042 io.in.file_attributes = FILE_ATTRIBUTE_DIRECTORY;
2043 io.in.create_disposition = NTCREATEX_DISP_CREATE;
2046 status = smb2_create(tree, mem_ctx, &io);
2047 if (!NT_STATUS_IS_OK(status)) {
2048 return false;
2051 status = smb2_util_close(tree, io.out.file.handle);
2052 if (!NT_STATUS_IS_OK(status)) {
2053 return false;
2056 return true;
2059 static bool enable_aapl(struct torture_context *tctx,
2060 struct smb2_tree *tree)
2062 TALLOC_CTX *mem_ctx = talloc_new(tctx);
2063 NTSTATUS status;
2064 bool ret = true;
2065 struct smb2_create io;
2066 DATA_BLOB data;
2067 struct smb2_create_blob *aapl = NULL;
2068 uint32_t aapl_server_caps;
2069 uint32_t expected_scaps = (SMB2_CRTCTX_AAPL_UNIX_BASED |
2070 SMB2_CRTCTX_AAPL_SUPPORTS_READ_DIR_ATTR |
2071 SMB2_CRTCTX_AAPL_SUPPORTS_NFS_ACE |
2072 SMB2_CRTCTX_AAPL_SUPPORTS_OSX_COPYFILE);
2073 bool is_osx_server = torture_setting_bool(tctx, "osx", false);
2075 ZERO_STRUCT(io);
2076 io.in.desired_access = SEC_FLAG_MAXIMUM_ALLOWED;
2077 io.in.file_attributes = FILE_ATTRIBUTE_DIRECTORY;
2078 io.in.create_disposition = NTCREATEX_DISP_OPEN;
2079 io.in.share_access = (NTCREATEX_SHARE_ACCESS_DELETE |
2080 NTCREATEX_SHARE_ACCESS_READ |
2081 NTCREATEX_SHARE_ACCESS_WRITE);
2082 io.in.fname = "";
2085 * Issuing an SMB2/CREATE with a suitably formed AAPL context,
2086 * controls behaviour of Apple's SMB2 extensions for the whole
2087 * session!
2090 data = data_blob_talloc(mem_ctx, NULL, 3 * sizeof(uint64_t));
2091 SBVAL(data.data, 0, SMB2_CRTCTX_AAPL_SERVER_QUERY);
2092 SBVAL(data.data, 8, (SMB2_CRTCTX_AAPL_SERVER_CAPS |
2093 SMB2_CRTCTX_AAPL_VOLUME_CAPS |
2094 SMB2_CRTCTX_AAPL_MODEL_INFO));
2095 SBVAL(data.data, 16, (SMB2_CRTCTX_AAPL_SUPPORTS_READ_DIR_ATTR |
2096 SMB2_CRTCTX_AAPL_UNIX_BASED |
2097 SMB2_CRTCTX_AAPL_SUPPORTS_NFS_ACE));
2099 status = smb2_create_blob_add(tctx, &io.in.blobs, "AAPL", data);
2100 torture_assert_ntstatus_ok_goto(tctx, status, ret, done, "smb2_create_blob_add");
2102 status = smb2_create(tree, tctx, &io);
2103 torture_assert_ntstatus_ok_goto(tctx, status, ret, done, "smb2_create");
2105 status = smb2_util_close(tree, io.out.file.handle);
2106 torture_assert_ntstatus_ok_goto(tctx, status, ret, done, "smb2_util_close");
2109 * Now check returned AAPL context
2111 torture_comment(tctx, "Comparing returned AAPL capabilities\n");
2113 aapl = smb2_create_blob_find(&io.out.blobs,
2114 SMB2_CREATE_TAG_AAPL);
2115 torture_assert_goto(tctx, aapl != NULL, ret, done, "missing AAPL context");
2117 if (!is_osx_server) {
2118 size_t expected_aapl_ctx_size;
2120 expected_aapl_ctx_size = strlen("MacSamba") * 2 + 40;
2122 torture_assert_goto(
2123 tctx, aapl->data.length == expected_aapl_ctx_size,
2124 ret, done, "bad AAPL size");
2127 aapl_server_caps = BVAL(aapl->data.data, 16);
2128 torture_assert_goto(tctx, aapl_server_caps == expected_scaps,
2129 ret, done, "bad AAPL caps");
2131 done:
2132 talloc_free(mem_ctx);
2133 return ret;
2136 static bool test_read_netatalk_metadata(struct torture_context *tctx,
2137 struct smb2_tree *tree)
2139 TALLOC_CTX *mem_ctx = talloc_new(tctx);
2140 const char *fname = BASEDIR "\\torture_read_metadata";
2141 NTSTATUS status;
2142 struct smb2_handle testdirh;
2143 bool ret = true;
2144 ssize_t len;
2145 const char *localdir = NULL;
2147 torture_comment(tctx, "Checking metadata access\n");
2149 localdir = torture_setting_string(tctx, "localdir", NULL);
2150 if (localdir == NULL) {
2151 torture_skip(tctx, "Need localdir for test");
2154 smb2_util_unlink(tree, fname);
2156 status = torture_smb2_testdir(tree, BASEDIR, &testdirh);
2157 CHECK_STATUS(status, NT_STATUS_OK);
2158 smb2_util_close(tree, testdirh);
2160 ret = torture_setup_file(mem_ctx, tree, fname, false);
2161 if (ret == false) {
2162 goto done;
2165 ret = torture_setup_local_xattr(tctx, "localdir",
2166 BASEDIR "/torture_read_metadata",
2167 AFPINFO_EA_NETATALK,
2168 metadata_xattr, sizeof(metadata_xattr));
2169 if (ret == false) {
2170 goto done;
2173 ret = check_stream(tree, __location__, tctx, mem_ctx, fname, AFPINFO_STREAM,
2174 0, 60, 0, 4, "AFP");
2175 torture_assert_goto(tctx, ret == true, ret, done, "check_stream failed");
2177 ret = check_stream(tree, __location__, tctx, mem_ctx, fname, AFPINFO_STREAM,
2178 0, 60, 16, 8, "BARRFOOO");
2179 torture_assert_goto(tctx, ret == true, ret, done, "check_stream failed");
2181 ret = check_stream(tree, __location__, tctx, mem_ctx, fname, AFPINFO_STREAM,
2182 16, 8, 0, 3, "AFP");
2183 torture_assert_goto(tctx, ret == true, ret, done, "check_stream failed");
2185 /* Check reading offset and read size > sizeof(AFPINFO_STREAM) */
2187 len = read_stream(tree, __location__, tctx, mem_ctx, fname,
2188 AFPINFO_STREAM, 0, 61);
2189 CHECK_VALUE(len, 60);
2191 len = read_stream(tree, __location__, tctx, mem_ctx, fname,
2192 AFPINFO_STREAM, 59, 2);
2193 CHECK_VALUE(len, 2);
2195 len = read_stream(tree, __location__, tctx, mem_ctx, fname,
2196 AFPINFO_STREAM, 60, 1);
2197 CHECK_VALUE(len, 1);
2199 len = read_stream(tree, __location__, tctx, mem_ctx, fname,
2200 AFPINFO_STREAM, 61, 1);
2201 CHECK_VALUE(len, 0);
2203 done:
2204 smb2_deltree(tree, BASEDIR);
2205 talloc_free(mem_ctx);
2206 return ret;
2209 static bool test_read_afpinfo(struct torture_context *tctx,
2210 struct smb2_tree *tree)
2212 TALLOC_CTX *mem_ctx = talloc_new(tctx);
2213 const char *fname = BASEDIR "\\torture_read_metadata";
2214 NTSTATUS status;
2215 struct smb2_handle testdirh;
2216 bool ret = true;
2217 ssize_t len;
2218 AfpInfo *info;
2219 const char *type_creator = "SMB,OLE!";
2221 torture_comment(tctx, "Checking metadata access\n");
2223 smb2_util_unlink(tree, fname);
2225 status = torture_smb2_testdir(tree, BASEDIR, &testdirh);
2226 torture_assert_ntstatus_ok_goto(tctx, status, ret, done, "torture_smb2_testdir failed");
2227 smb2_util_close(tree, testdirh);
2229 ret = torture_setup_file(mem_ctx, tree, fname, false);
2230 torture_assert_goto(tctx, ret == true, ret, done, "torture_setup_file failed");
2232 info = torture_afpinfo_new(mem_ctx);
2233 torture_assert_goto(tctx, info != NULL, ret, done, "torture_afpinfo_new failed");
2235 memcpy(info->afpi_FinderInfo, type_creator, 8);
2236 ret = torture_write_afpinfo(tree, tctx, mem_ctx, fname, info);
2237 torture_assert_goto(tctx, ret == true, ret, done, "torture_write_afpinfo failed");
2239 ret = check_stream(tree, __location__, tctx, mem_ctx, fname, AFPINFO_STREAM,
2240 0, 60, 0, 4, "AFP");
2241 torture_assert_goto(tctx, ret == true, ret, done, "check_stream failed");
2243 ret = check_stream(tree, __location__, tctx, mem_ctx, fname, AFPINFO_STREAM,
2244 0, 60, 16, 8, type_creator);
2245 torture_assert_goto(tctx, ret == true, ret, done, "check_stream failed");
2248 * OS X ignores offset <= 60 and treats the as
2249 * offset=0. Reading from offsets > 60 returns EOF=0.
2252 ret = check_stream(tree, __location__, tctx, mem_ctx, fname, AFPINFO_STREAM,
2253 16, 8, 0, 8, "AFP\0\0\0\001\0");
2254 torture_assert_goto(tctx, ret == true, ret, done, "check_stream failed");
2256 len = read_stream(tree, __location__, tctx, mem_ctx, fname,
2257 AFPINFO_STREAM, 0, 61);
2258 torture_assert_goto(tctx, len == 60, ret, done, "read_stream failed");
2260 len = read_stream(tree, __location__, tctx, mem_ctx, fname,
2261 AFPINFO_STREAM, 59, 2);
2262 torture_assert_goto(tctx, len == 2, ret, done, "read_stream failed");
2264 ret = check_stream(tree, __location__, tctx, mem_ctx, fname, AFPINFO_STREAM,
2265 59, 2, 0, 2, "AF");
2266 torture_assert_goto(tctx, ret == true, ret, done, "check_stream failed");
2268 len = read_stream(tree, __location__, tctx, mem_ctx, fname,
2269 AFPINFO_STREAM, 60, 1);
2270 torture_assert_goto(tctx, len == 1, ret, done, "read_stream failed");
2272 ret = check_stream(tree, __location__, tctx, mem_ctx, fname, AFPINFO_STREAM,
2273 60, 1, 0, 1, "A");
2274 torture_assert_goto(tctx, ret == true, ret, done, "check_stream failed");
2276 len = read_stream(tree, __location__, tctx, mem_ctx, fname,
2277 AFPINFO_STREAM, 61, 1);
2278 torture_assert_goto(tctx, len == 0, ret, done, "read_stream failed");
2280 done:
2281 smb2_util_unlink(tree, fname);
2282 smb2_deltree(tree, BASEDIR);
2283 talloc_free(mem_ctx);
2284 return ret;
2287 static bool test_write_atalk_metadata(struct torture_context *tctx,
2288 struct smb2_tree *tree)
2290 TALLOC_CTX *mem_ctx = talloc_new(tctx);
2291 const char *fname = BASEDIR "\\torture_write_metadata";
2292 const char *type_creator = "SMB,OLE!";
2293 NTSTATUS status;
2294 struct smb2_handle testdirh;
2295 bool ret = true;
2296 AfpInfo *info;
2298 smb2_deltree(tree, BASEDIR);
2299 status = torture_smb2_testdir(tree, BASEDIR, &testdirh);
2300 CHECK_STATUS(status, NT_STATUS_OK);
2301 smb2_util_close(tree, testdirh);
2303 ret = torture_setup_file(mem_ctx, tree, fname, false);
2304 if (ret == false) {
2305 goto done;
2308 info = torture_afpinfo_new(mem_ctx);
2309 if (info == NULL) {
2310 goto done;
2313 memcpy(info->afpi_FinderInfo, type_creator, 8);
2314 ret = torture_write_afpinfo(tree, tctx, mem_ctx, fname, info);
2315 ret &= check_stream(tree, __location__, tctx, mem_ctx, fname, AFPINFO_STREAM,
2316 0, 60, 16, 8, type_creator);
2318 done:
2319 smb2_util_unlink(tree, fname);
2320 smb2_deltree(tree, BASEDIR);
2321 talloc_free(mem_ctx);
2322 return ret;
2325 static bool test_write_atalk_rfork_io(struct torture_context *tctx,
2326 struct smb2_tree *tree)
2328 TALLOC_CTX *mem_ctx = talloc_new(tctx);
2329 const char *fname = BASEDIR "\\torture_write_rfork_io";
2330 const char *rfork = BASEDIR "\\torture_write_rfork_io" AFPRESOURCE_STREAM_NAME;
2331 const char *rfork_content = "1234567890";
2332 NTSTATUS status;
2333 struct smb2_handle testdirh;
2334 bool ret = true;
2336 union smb_open io;
2337 struct smb2_handle filehandle;
2338 union smb_fileinfo finfo;
2339 union smb_setfileinfo sinfo;
2341 smb2_util_unlink(tree, fname);
2343 status = torture_smb2_testdir(tree, BASEDIR, &testdirh);
2344 CHECK_STATUS(status, NT_STATUS_OK);
2345 smb2_util_close(tree, testdirh);
2347 ret = torture_setup_file(mem_ctx, tree, fname, false);
2348 if (ret == false) {
2349 goto done;
2352 torture_comment(tctx, "(%s) writing to resource fork\n",
2353 __location__);
2355 ret &= write_stream(tree, __location__, tctx, mem_ctx,
2356 fname, AFPRESOURCE_STREAM_NAME,
2357 10, 10, rfork_content);
2359 ret &= check_stream(tree, __location__, tctx, mem_ctx,
2360 fname, AFPRESOURCE_STREAM_NAME,
2361 0, 20, 10, 10, rfork_content);
2363 /* Check size after write */
2365 ZERO_STRUCT(io);
2366 io.smb2.in.create_disposition = NTCREATEX_DISP_OPEN;
2367 io.smb2.in.desired_access = SEC_FILE_READ_ATTRIBUTE |
2368 SEC_FILE_WRITE_ATTRIBUTE;
2369 io.smb2.in.fname = rfork;
2370 status = smb2_create(tree, mem_ctx, &(io.smb2));
2371 CHECK_STATUS(status, NT_STATUS_OK);
2372 filehandle = io.smb2.out.file.handle;
2374 torture_comment(tctx, "(%s) check resource fork size after write\n",
2375 __location__);
2377 ZERO_STRUCT(finfo);
2378 finfo.generic.level = RAW_FILEINFO_ALL_INFORMATION;
2379 finfo.generic.in.file.handle = filehandle;
2380 status = smb2_getinfo_file(tree, mem_ctx, &finfo);
2381 CHECK_STATUS(status, NT_STATUS_OK);
2382 if (finfo.all_info.out.size != 20) {
2383 torture_result(tctx, TORTURE_FAIL,
2384 "(%s) Incorrect resource fork size\n",
2385 __location__);
2386 ret = false;
2387 smb2_util_close(tree, filehandle);
2388 goto done;
2390 smb2_util_close(tree, filehandle);
2392 /* Write at large offset */
2394 torture_comment(tctx, "(%s) writing to resource fork at large offset\n",
2395 __location__);
2397 ret &= write_stream(tree, __location__, tctx, mem_ctx,
2398 fname, AFPRESOURCE_STREAM_NAME,
2399 (off_t)64*1024*1024, 10, rfork_content);
2401 /* Check size after write */
2403 ZERO_STRUCT(io);
2404 io.smb2.in.create_disposition = NTCREATEX_DISP_OPEN;
2405 io.smb2.in.desired_access = SEC_FILE_READ_ATTRIBUTE |
2406 SEC_FILE_WRITE_ATTRIBUTE;
2407 io.smb2.in.fname = rfork;
2408 status = smb2_create(tree, mem_ctx, &(io.smb2));
2409 CHECK_STATUS(status, NT_STATUS_OK);
2410 filehandle = io.smb2.out.file.handle;
2412 torture_comment(tctx, "(%s) check resource fork size after write\n",
2413 __location__);
2415 ZERO_STRUCT(finfo);
2416 finfo.generic.level = RAW_FILEINFO_ALL_INFORMATION;
2417 finfo.generic.in.file.handle = filehandle;
2418 status = smb2_getinfo_file(tree, mem_ctx, &finfo);
2419 CHECK_STATUS(status, NT_STATUS_OK);
2420 if (finfo.all_info.out.size != 64*1024*1024 + 10) {
2421 torture_result(tctx, TORTURE_FAIL,
2422 "(%s) Incorrect resource fork size\n",
2423 __location__);
2424 ret = false;
2425 smb2_util_close(tree, filehandle);
2426 goto done;
2428 smb2_util_close(tree, filehandle);
2430 ret &= check_stream(tree, __location__, tctx, mem_ctx,
2431 fname, AFPRESOURCE_STREAM_NAME,
2432 (off_t)64*1024*1024, 10, 0, 10, rfork_content);
2434 /* Truncate back to size of 1 byte */
2436 torture_comment(tctx, "(%s) truncate resource fork and check size\n",
2437 __location__);
2439 ZERO_STRUCT(io);
2440 io.smb2.in.create_disposition = NTCREATEX_DISP_OPEN;
2441 io.smb2.in.desired_access = SEC_FILE_ALL;
2442 io.smb2.in.fname = rfork;
2443 status = smb2_create(tree, mem_ctx, &(io.smb2));
2444 CHECK_STATUS(status, NT_STATUS_OK);
2445 filehandle = io.smb2.out.file.handle;
2447 ZERO_STRUCT(sinfo);
2448 sinfo.end_of_file_info.level =
2449 RAW_SFILEINFO_END_OF_FILE_INFORMATION;
2450 sinfo.end_of_file_info.in.file.handle = filehandle;
2451 sinfo.end_of_file_info.in.size = 1;
2452 status = smb2_setinfo_file(tree, &sinfo);
2453 CHECK_STATUS(status, NT_STATUS_OK);
2455 smb2_util_close(tree, filehandle);
2457 /* Now check size */
2458 ZERO_STRUCT(io);
2459 io.smb2.in.create_disposition = NTCREATEX_DISP_OPEN;
2460 io.smb2.in.desired_access = SEC_FILE_READ_ATTRIBUTE |
2461 SEC_FILE_WRITE_ATTRIBUTE;
2462 io.smb2.in.fname = rfork;
2463 status = smb2_create(tree, mem_ctx, &(io.smb2));
2464 CHECK_STATUS(status, NT_STATUS_OK);
2465 filehandle = io.smb2.out.file.handle;
2467 ZERO_STRUCT(finfo);
2468 finfo.generic.level = RAW_FILEINFO_ALL_INFORMATION;
2469 finfo.generic.in.file.handle = filehandle;
2470 status = smb2_getinfo_file(tree, mem_ctx, &finfo);
2471 CHECK_STATUS(status, NT_STATUS_OK);
2472 if (finfo.all_info.out.size != 1) {
2473 torture_result(tctx, TORTURE_FAIL,
2474 "(%s) Incorrect resource fork size\n",
2475 __location__);
2476 ret = false;
2477 smb2_util_close(tree, filehandle);
2478 goto done;
2480 smb2_util_close(tree, filehandle);
2482 done:
2483 smb2_util_unlink(tree, fname);
2484 smb2_deltree(tree, BASEDIR);
2485 talloc_free(mem_ctx);
2486 return ret;
2489 static bool test_rfork_truncate(struct torture_context *tctx,
2490 struct smb2_tree *tree)
2492 TALLOC_CTX *mem_ctx = talloc_new(tctx);
2493 const char *fname = BASEDIR "\\torture_rfork_truncate";
2494 const char *rfork = BASEDIR "\\torture_rfork_truncate" AFPRESOURCE_STREAM;
2495 const char *rfork_content = "1234567890";
2496 NTSTATUS status;
2497 struct smb2_handle testdirh;
2498 bool ret = true;
2499 struct smb2_create create;
2500 struct smb2_handle fh1, fh2, fh3;
2501 union smb_setfileinfo sinfo;
2503 ret = enable_aapl(tctx, tree);
2504 torture_assert_goto(tctx, ret == true, ret, done, "enable_aapl failed");
2506 smb2_util_unlink(tree, fname);
2508 status = torture_smb2_testdir(tree, BASEDIR, &testdirh);
2509 torture_assert_ntstatus_ok_goto(tctx, status, ret, done, "torture_smb2_testdir");
2510 smb2_util_close(tree, testdirh);
2512 ret = torture_setup_file(mem_ctx, tree, fname, false);
2513 if (ret == false) {
2514 goto done;
2517 ret &= write_stream(tree, __location__, tctx, mem_ctx,
2518 fname, AFPRESOURCE_STREAM,
2519 10, 10, rfork_content);
2521 /* Truncate back to size 0, further access MUST return ENOENT */
2523 torture_comment(tctx, "(%s) truncate resource fork to size 0\n",
2524 __location__);
2526 ZERO_STRUCT(create);
2527 create.in.create_disposition = NTCREATEX_DISP_OPEN;
2528 create.in.desired_access = SEC_STD_READ_CONTROL | SEC_FILE_ALL;
2529 create.in.file_attributes = FILE_ATTRIBUTE_NORMAL;
2530 create.in.fname = fname;
2531 create.in.share_access = NTCREATEX_SHARE_ACCESS_DELETE |
2532 NTCREATEX_SHARE_ACCESS_READ |
2533 NTCREATEX_SHARE_ACCESS_WRITE;
2534 status = smb2_create(tree, mem_ctx, &create);
2535 torture_assert_ntstatus_ok_goto(tctx, status, ret, done, "smb2_create");
2536 fh1 = create.out.file.handle;
2538 ZERO_STRUCT(create);
2539 create.in.create_disposition = NTCREATEX_DISP_OPEN_IF;
2540 create.in.desired_access = SEC_STD_READ_CONTROL | SEC_FILE_ALL;
2541 create.in.file_attributes = FILE_ATTRIBUTE_NORMAL;
2542 create.in.fname = rfork;
2543 create.in.share_access = NTCREATEX_SHARE_ACCESS_DELETE |
2544 NTCREATEX_SHARE_ACCESS_READ |
2545 NTCREATEX_SHARE_ACCESS_WRITE;
2546 status = smb2_create(tree, mem_ctx, &create);
2547 torture_assert_ntstatus_ok_goto(tctx, status, ret, done, "smb2_create");
2548 fh2 = create.out.file.handle;
2550 ZERO_STRUCT(sinfo);
2551 sinfo.end_of_file_info.level = RAW_SFILEINFO_END_OF_FILE_INFORMATION;
2552 sinfo.end_of_file_info.in.file.handle = fh2;
2553 sinfo.end_of_file_info.in.size = 0;
2554 status = smb2_setinfo_file(tree, &sinfo);
2555 torture_assert_ntstatus_ok_goto(tctx, status, ret, done, "smb2_setinfo_file");
2558 * Now check size, we should get OBJECT_NAME_NOT_FOUND (!)
2560 ZERO_STRUCT(create);
2561 create.in.create_disposition = NTCREATEX_DISP_OPEN;
2562 create.in.desired_access = SEC_FILE_ALL;
2563 create.in.file_attributes = FILE_ATTRIBUTE_NORMAL;
2564 create.in.fname = rfork;
2565 create.in.share_access = NTCREATEX_SHARE_ACCESS_DELETE |
2566 NTCREATEX_SHARE_ACCESS_READ |
2567 NTCREATEX_SHARE_ACCESS_WRITE;
2568 status = smb2_create(tree, mem_ctx, &create);
2569 torture_assert_ntstatus_equal_goto(tctx, status, NT_STATUS_OBJECT_NAME_NOT_FOUND, ret, done, "smb2_create");
2572 * Do another open on the rfork and write to the new handle. A
2573 * naive server might unlink the AppleDouble resource fork
2574 * file when its truncated to 0 bytes above, so in case both
2575 * open handles share the same underlying fd, the unlink would
2576 * cause the below write to be lost.
2578 ZERO_STRUCT(create);
2579 create.in.create_disposition = NTCREATEX_DISP_OPEN_IF;
2580 create.in.desired_access = SEC_STD_READ_CONTROL | SEC_FILE_ALL;
2581 create.in.file_attributes = FILE_ATTRIBUTE_NORMAL;
2582 create.in.fname = rfork;
2583 create.in.share_access = NTCREATEX_SHARE_ACCESS_DELETE |
2584 NTCREATEX_SHARE_ACCESS_READ |
2585 NTCREATEX_SHARE_ACCESS_WRITE;
2586 status = smb2_create(tree, mem_ctx, &create);
2587 torture_assert_ntstatus_ok_goto(tctx, status, ret, done, "smb2_create");
2588 fh3 = create.out.file.handle;
2590 status = smb2_util_write(tree, fh3, "foo", 0, 3);
2591 torture_assert_ntstatus_ok_goto(tctx, status, ret, done, "smb2_util_write");
2593 smb2_util_close(tree, fh3);
2594 smb2_util_close(tree, fh2);
2595 smb2_util_close(tree, fh1);
2597 ret = check_stream(tree, __location__, tctx, mem_ctx, fname, AFPRESOURCE_STREAM,
2598 0, 3, 0, 3, "foo");
2599 torture_assert_goto(tctx, ret == true, ret, done, "check_stream");
2601 done:
2602 smb2_util_unlink(tree, fname);
2603 smb2_deltree(tree, BASEDIR);
2604 talloc_free(mem_ctx);
2605 return ret;
2608 static bool test_rfork_create(struct torture_context *tctx,
2609 struct smb2_tree *tree)
2611 TALLOC_CTX *mem_ctx = talloc_new(tctx);
2612 const char *fname = BASEDIR "\\torture_rfork_create";
2613 const char *rfork = BASEDIR "\\torture_rfork_create" AFPRESOURCE_STREAM;
2614 NTSTATUS status;
2615 struct smb2_handle testdirh;
2616 bool ret = true;
2617 struct smb2_create create;
2618 struct smb2_handle fh1;
2619 const char *streams[] = {
2620 "::$DATA"
2622 union smb_fileinfo finfo;
2624 ret = enable_aapl(tctx, tree);
2625 torture_assert_goto(tctx, ret == true, ret, done, "enable_aapl failed");
2627 smb2_util_unlink(tree, fname);
2629 status = torture_smb2_testdir(tree, BASEDIR, &testdirh);
2630 torture_assert_ntstatus_ok_goto(tctx, status, ret, done, "torture_smb2_testdir");
2631 smb2_util_close(tree, testdirh);
2633 ret = torture_setup_file(mem_ctx, tree, fname, false);
2634 if (ret == false) {
2635 goto done;
2638 torture_comment(tctx, "(%s) open rfork, should return ENOENT\n",
2639 __location__);
2641 ZERO_STRUCT(create);
2642 create.in.create_disposition = NTCREATEX_DISP_OPEN;
2643 create.in.desired_access = SEC_STD_READ_CONTROL | SEC_FILE_ALL;
2644 create.in.file_attributes = FILE_ATTRIBUTE_NORMAL;
2645 create.in.fname = rfork;
2646 create.in.share_access = NTCREATEX_SHARE_ACCESS_DELETE |
2647 NTCREATEX_SHARE_ACCESS_READ |
2648 NTCREATEX_SHARE_ACCESS_WRITE;
2649 status = smb2_create(tree, mem_ctx, &create);
2650 torture_assert_ntstatus_equal_goto(tctx, status, NT_STATUS_OBJECT_NAME_NOT_FOUND, ret, done, "smb2_create");
2652 torture_comment(tctx, "(%s) create resource fork\n", __location__);
2654 ZERO_STRUCT(create);
2655 create.in.create_disposition = NTCREATEX_DISP_OPEN_IF;
2656 create.in.desired_access = SEC_STD_READ_CONTROL | SEC_FILE_ALL;
2657 create.in.file_attributes = FILE_ATTRIBUTE_NORMAL;
2658 create.in.fname = rfork;
2659 create.in.share_access = NTCREATEX_SHARE_ACCESS_DELETE |
2660 NTCREATEX_SHARE_ACCESS_READ |
2661 NTCREATEX_SHARE_ACCESS_WRITE;
2662 status = smb2_create(tree, mem_ctx, &create);
2663 torture_assert_ntstatus_ok_goto(tctx, status, ret, done, "smb2_create");
2664 fh1 = create.out.file.handle;
2666 torture_comment(tctx, "(%s) getinfo on create handle\n",
2667 __location__);
2669 ZERO_STRUCT(finfo);
2670 finfo.generic.level = RAW_FILEINFO_ALL_INFORMATION;
2671 finfo.generic.in.file.handle = fh1;
2672 status = smb2_getinfo_file(tree, mem_ctx, &finfo);
2673 torture_assert_ntstatus_ok_goto(tctx, status, ret, done, "smb2_getinfo_file");
2674 if (finfo.all_info.out.size != 0) {
2675 torture_result(tctx, TORTURE_FAIL,
2676 "(%s) Incorrect resource fork size\n",
2677 __location__);
2678 ret = false;
2679 smb2_util_close(tree, fh1);
2680 goto done;
2683 torture_comment(tctx, "(%s) open rfork, should still return ENOENT\n",
2684 __location__);
2686 ZERO_STRUCT(create);
2687 create.in.create_disposition = NTCREATEX_DISP_OPEN;
2688 create.in.desired_access = SEC_STD_READ_CONTROL | SEC_FILE_ALL;
2689 create.in.file_attributes = FILE_ATTRIBUTE_NORMAL;
2690 create.in.fname = rfork;
2691 create.in.share_access = NTCREATEX_SHARE_ACCESS_DELETE |
2692 NTCREATEX_SHARE_ACCESS_READ |
2693 NTCREATEX_SHARE_ACCESS_WRITE;
2694 status = smb2_create(tree, mem_ctx, &create);
2695 torture_assert_ntstatus_equal_goto(tctx, status, NT_STATUS_OBJECT_NAME_NOT_FOUND, ret, done, "smb2_create");
2697 ret = check_stream_list(tree, tctx, fname, 1, streams, false);
2698 torture_assert_goto(tctx, ret == true, ret, done, "check_stream_list");
2700 torture_comment(tctx, "(%s) close empty created rfork, open should return ENOENT\n",
2701 __location__);
2703 ZERO_STRUCT(create);
2704 create.in.create_disposition = NTCREATEX_DISP_OPEN;
2705 create.in.desired_access = SEC_STD_READ_CONTROL | SEC_FILE_ALL;
2706 create.in.file_attributes = FILE_ATTRIBUTE_NORMAL;
2707 create.in.fname = rfork;
2708 create.in.share_access = NTCREATEX_SHARE_ACCESS_DELETE |
2709 NTCREATEX_SHARE_ACCESS_READ |
2710 NTCREATEX_SHARE_ACCESS_WRITE;
2711 status = smb2_create(tree, mem_ctx, &create);
2712 torture_assert_ntstatus_equal_goto(tctx, status, NT_STATUS_OBJECT_NAME_NOT_FOUND, ret, done, "smb2_create");
2714 done:
2715 smb2_util_unlink(tree, fname);
2716 smb2_deltree(tree, BASEDIR);
2717 talloc_free(mem_ctx);
2718 return ret;
2722 * BUG: https://bugzilla.samba.org/show_bug.cgi?id=15182
2725 static bool test_rfork_fsync(struct torture_context *tctx,
2726 struct smb2_tree *tree)
2728 TALLOC_CTX *mem_ctx = talloc_new(tctx);
2729 const char *fname = BASEDIR "\\torture_rfork_fsync";
2730 const char *rfork = BASEDIR "\\torture_rfork_fsync" AFPRESOURCE_STREAM;
2731 NTSTATUS status;
2732 struct smb2_handle testdirh;
2733 bool ret = true;
2734 struct smb2_create create;
2735 struct smb2_handle fh1;
2736 struct smb2_flush f;
2738 ZERO_STRUCT(fh1);
2740 ret = enable_aapl(tctx, tree);
2741 torture_assert_goto(tctx, ret == true, ret, done, "enable_aapl failed");
2743 smb2_util_unlink(tree, fname);
2745 status = torture_smb2_testdir(tree, BASEDIR, &testdirh);
2746 torture_assert_ntstatus_ok_goto(tctx,
2747 status,
2748 ret,
2749 done,
2750 "torture_smb2_testdir");
2751 smb2_util_close(tree, testdirh);
2753 ret = torture_setup_file(mem_ctx, tree, fname, false);
2754 if (ret == false) {
2755 goto done;
2758 torture_comment(tctx, "(%s) create resource fork %s\n",
2759 __location__,
2760 rfork);
2762 ZERO_STRUCT(create);
2763 create.in.create_disposition = NTCREATEX_DISP_OPEN_IF;
2764 create.in.desired_access = SEC_STD_READ_CONTROL | SEC_FILE_ALL;
2765 create.in.file_attributes = FILE_ATTRIBUTE_NORMAL;
2766 create.in.fname = rfork;
2767 create.in.share_access = NTCREATEX_SHARE_ACCESS_DELETE |
2768 NTCREATEX_SHARE_ACCESS_READ |
2769 NTCREATEX_SHARE_ACCESS_WRITE;
2770 status = smb2_create(tree, mem_ctx, &create);
2771 torture_assert_ntstatus_ok_goto(tctx, status, ret, done, "smb2_create");
2772 fh1 = create.out.file.handle;
2774 torture_comment(tctx, "(%s) Write 10 bytes to resource fork %s\n",
2775 __location__,
2776 rfork);
2778 status = smb2_util_write(tree, fh1, "1234567890", 0, 10);
2779 torture_assert_ntstatus_ok_goto(tctx, status, ret, done,
2780 "smb2_util_write failed\n");
2782 torture_comment(tctx, "(%s) fsync on resource fork %s\n",
2783 __location__,
2784 rfork);
2786 f.in.file.handle = fh1;
2787 status = smb2_flush(tree, &f);
2788 torture_assert_ntstatus_ok_goto(tctx, status, ret, done,
2789 "smb2_flush failed\n");
2791 done:
2793 smb2_util_close(tree, fh1);
2794 smb2_util_unlink(tree, fname);
2795 smb2_deltree(tree, BASEDIR);
2796 talloc_free(mem_ctx);
2797 return ret;
2800 static bool test_rfork_create_ro(struct torture_context *tctx,
2801 struct smb2_tree *tree)
2803 TALLOC_CTX *mem_ctx = talloc_new(tctx);
2804 const char *fname = BASEDIR "\\torture_rfork_create";
2805 const char *rfork = BASEDIR "\\torture_rfork_create" AFPRESOURCE_STREAM;
2806 NTSTATUS status;
2807 struct smb2_handle testdirh;
2808 bool ret = true;
2809 struct smb2_create create;
2811 smb2_util_unlink(tree, fname);
2812 status = torture_smb2_testdir(tree, BASEDIR, &testdirh);
2813 torture_assert_ntstatus_ok_goto(tctx, status, ret, done,
2814 "torture_smb2_testdir\n");
2815 smb2_util_close(tree, testdirh);
2817 ret = torture_setup_file(mem_ctx, tree, fname, false);
2818 if (ret == false) {
2819 goto done;
2822 torture_comment(tctx, "(%s) Try opening read-only with "
2823 "open_if create disposition, should work\n",
2824 __location__);
2826 ZERO_STRUCT(create);
2827 create.in.fname = rfork;
2828 create.in.create_disposition = NTCREATEX_DISP_OPEN_IF;
2829 create.in.desired_access = SEC_FILE_READ_DATA | SEC_STD_READ_CONTROL;
2830 create.in.file_attributes = FILE_ATTRIBUTE_NORMAL;
2831 create.in.share_access = FILE_SHARE_READ | FILE_SHARE_DELETE;
2832 status = smb2_create(tree, mem_ctx, &(create));
2833 torture_assert_ntstatus_ok_goto(tctx, status, ret, done,
2834 "smb2_create failed\n");
2836 smb2_util_close(tree, create.out.file.handle);
2838 done:
2839 smb2_util_unlink(tree, fname);
2840 smb2_deltree(tree, BASEDIR);
2841 talloc_free(mem_ctx);
2842 return ret;
2845 static bool test_adouble_conversion(struct torture_context *tctx,
2846 struct smb2_tree *tree)
2848 TALLOC_CTX *mem_ctx = talloc_new(tctx);
2849 const char *fname = BASEDIR "\\test_adouble_conversion";
2850 const char *adname = BASEDIR "/._test_adouble_conversion";
2851 NTSTATUS status;
2852 struct smb2_handle testdirh;
2853 bool ret = true;
2854 const char data[] = {
2855 0xf0, 0xf1, 0xf2, 0xf3, 0xf4, 0xf5, 0xf6, 0xf7,
2856 0xf8, 0xf9, 0xfa, 0xfb, 0xfc, 0xfd, 0xfe, 0xff
2858 size_t datalen = sizeof(data);
2859 const char *streams[] = {
2860 "::$DATA",
2861 AFPINFO_STREAM,
2862 AFPRESOURCE_STREAM,
2863 ":com.apple.metadata" "\xef\x80\xa2" "_kMDItemUserTags:$DATA",
2864 ":foo" "\xef\x80\xa2" "bar:$DATA", /* "foo:bar:$DATA" */
2866 bool is_osx = torture_setting_bool(tctx, "osx", false);
2868 if (is_osx) {
2869 torture_skip(tctx, "Test only works with Samba\n");
2872 smb2_deltree(tree, BASEDIR);
2874 status = torture_smb2_testdir(tree, BASEDIR, &testdirh);
2875 CHECK_STATUS(status, NT_STATUS_OK);
2876 smb2_util_close(tree, testdirh);
2878 ret = torture_setup_file(tctx, tree, fname, false);
2879 torture_assert_goto(tctx, ret == true, ret, done,
2880 "torture_setup_file failed\n");
2882 ret = torture_setup_file(tctx, tree, adname, false);
2883 torture_assert_goto(tctx, ret == true, ret, done,
2884 "torture_setup_file failed\n");
2886 ret = write_stream(tree, __location__, tctx, mem_ctx,
2887 adname, NULL,
2889 sizeof(osx_adouble_non_empty_rfork_w_xattr),
2890 osx_adouble_non_empty_rfork_w_xattr);
2891 torture_assert_goto(tctx, ret == true, ret, done,
2892 "write_stream failed\n");
2894 torture_comment(tctx, "(%s) test OS X AppleDouble conversion\n",
2895 __location__);
2897 ret = check_stream(tree, __location__, tctx, mem_ctx,
2898 fname, AFPRESOURCE_STREAM,
2899 16, datalen, 0, datalen, data);
2900 torture_assert_goto(tctx, ret == true, ret, done,
2901 "check AFPRESOURCE_STREAM failed\n");
2903 ret = check_stream(tree, __location__, tctx, mem_ctx,
2904 fname, AFPINFO_STREAM,
2905 0, 60, 16, 8, "TESTSLOW");
2906 torture_assert_goto(tctx, ret == true, ret, done,
2907 "check AFPINFO_STREAM failed\n");
2909 ret = check_stream(tree, __location__, tctx, mem_ctx, fname,
2910 ":foo" "\xef\x80\xa2" "bar:$DATA", /* "foo:bar:$DATA" */
2911 0, 3, 0, 3, "baz");
2912 torture_assert_goto(tctx, ret == true, ret, done,
2913 "check foo:bar stream failed\n");
2915 ret = check_stream_list(tree, tctx, fname, 5, streams, false);
2916 torture_assert_goto(tctx, ret == true, ret, done, "check_stream_list");
2918 done:
2919 smb2_deltree(tree, BASEDIR);
2920 talloc_free(mem_ctx);
2921 return ret;
2925 * Test conversion of AppleDouble file without embedded xattr data
2927 static bool test_adouble_conversion_wo_xattr(struct torture_context *tctx,
2928 struct smb2_tree *tree)
2930 TALLOC_CTX *mem_ctx = talloc_new(tctx);
2931 const char *fname = BASEDIR "\\test_adouble_conversion";
2932 const char *adname = BASEDIR "/._test_adouble_conversion";
2933 NTSTATUS status;
2934 struct smb2_handle testdirh;
2935 bool ret = true;
2936 const char *streams[] = {
2937 "::$DATA",
2938 AFPINFO_STREAM,
2939 AFPRESOURCE_STREAM
2941 struct smb2_create create;
2942 struct smb2_find find;
2943 unsigned int count;
2944 union smb_search_data *d;
2945 const char data[] = {
2946 0xf0, 0xf1, 0xf2, 0xf3, 0xf4, 0xf5, 0xf6, 0xf7,
2947 0xf8, 0xf9, 0xfa, 0xfb, 0xfc, 0xfd, 0xfe, 0xff
2949 size_t datalen = sizeof(data);
2950 bool is_osx = torture_setting_bool(tctx, "osx", false);
2952 if (is_osx) {
2953 torture_skip(tctx, "Test only works with Samba\n");
2956 smb2_deltree(tree, BASEDIR);
2958 status = torture_smb2_testdir(tree, BASEDIR, &testdirh);
2959 torture_assert_ntstatus_ok_goto(tctx, status, ret, done,
2960 "torture_smb2_testdir failed\n");
2961 smb2_util_close(tree, testdirh);
2963 ret = torture_setup_file(tctx, tree, fname, false);
2964 torture_assert_goto(tctx, ret == true, ret, done,
2965 "torture_setup_file failed\n");
2967 ret = torture_setup_file(tctx, tree, adname, false);
2968 torture_assert_goto(tctx, ret == true, ret, done,
2969 "torture_setup_file failed\n");
2971 ret = write_stream(tree, __location__, tctx, mem_ctx,
2972 adname, NULL, 0,
2973 sizeof(osx_adouble_without_xattr),
2974 osx_adouble_without_xattr);
2975 torture_assert_goto(tctx, ret == true, ret, done,
2976 "write_stream failed\n");
2978 ret = enable_aapl(tctx, tree);
2979 torture_assert_goto(tctx, ret == true, ret, done, "enable_aapl failed");
2982 * Issue a smb2_find(), this triggers the server-side conversion
2985 create = (struct smb2_create) {
2986 .in.desired_access = SEC_RIGHTS_DIR_READ,
2987 .in.create_options = NTCREATEX_OPTIONS_DIRECTORY,
2988 .in.file_attributes = FILE_ATTRIBUTE_DIRECTORY,
2989 .in.share_access = NTCREATEX_SHARE_ACCESS_READ,
2990 .in.create_disposition = NTCREATEX_DISP_OPEN,
2991 .in.impersonation_level = SMB2_IMPERSONATION_ANONYMOUS,
2992 .in.fname = BASEDIR,
2995 status = smb2_create(tree, tctx, &create);
2996 torture_assert_ntstatus_ok_goto(tctx, status, ret, done,
2997 "smb2_create failed\n");
2999 find = (struct smb2_find) {
3000 .in.file.handle = create.out.file.handle,
3001 .in.pattern = "*",
3002 .in.max_response_size = 0x1000,
3003 .in.level = SMB2_FIND_ID_BOTH_DIRECTORY_INFO,
3006 status = smb2_find_level(tree, tree, &find, &count, &d);
3007 torture_assert_ntstatus_ok_goto(tctx, status, ret, done,
3008 "smb2_find_level failed\n");
3010 status = smb2_util_close(tree, create.out.file.handle);
3011 torture_assert_ntstatus_ok_goto(tctx, status, ret, done,
3012 "smb2_util_close failed");
3015 * Check number of streams
3018 ret = check_stream_list(tree, tctx, fname, 3, streams, false);
3019 torture_assert_goto(tctx, ret == true, ret, done, "check_stream_list");
3023 * Check Resourcefork data can be read.
3026 ret = check_stream(tree, __location__, tctx, mem_ctx,
3027 fname, AFPRESOURCE_STREAM,
3028 16, datalen, 0, datalen, data);
3029 torture_assert_goto(tctx, ret == true, ret, done,
3030 "check AFPRESOURCE_STREAM failed\n");
3033 * Check FinderInfo data has been migrated to stream.
3036 ret = check_stream(tree, __location__, tctx, mem_ctx,
3037 fname, AFPINFO_STREAM,
3038 0, 60, 16, 8, "WAVEPTul");
3039 torture_assert_goto(tctx, ret == true, ret, done,
3040 "check AFPINFO_STREAM failed\n");
3042 done:
3043 smb2_deltree(tree, BASEDIR);
3044 talloc_free(mem_ctx);
3045 return ret;
3048 static bool test_aapl(struct torture_context *tctx,
3049 struct smb2_tree *tree)
3051 TALLOC_CTX *mem_ctx = talloc_new(tctx);
3052 const char *fname = BASEDIR "\\test_aapl";
3053 NTSTATUS status;
3054 struct smb2_handle testdirh;
3055 bool ret = true;
3056 struct smb2_create io;
3057 DATA_BLOB data;
3058 struct smb2_create_blob *aapl = NULL;
3059 AfpInfo *info;
3060 const char *type_creator = "SMB,OLE!";
3061 char type_creator_buf[9];
3062 uint32_t aapl_cmd;
3063 uint32_t aapl_reply_bitmap;
3064 uint32_t aapl_server_caps;
3065 uint32_t aapl_vol_caps;
3066 uint32_t expected_vol_caps = 0;
3067 char *model;
3068 struct smb2_find f;
3069 unsigned int count;
3070 union smb_search_data *d;
3071 uint64_t rfork_len;
3072 bool is_osx_server = torture_setting_bool(tctx, "osx", false);
3074 smb2_deltree(tree, BASEDIR);
3076 status = torture_smb2_testdir(tree, BASEDIR, &testdirh);
3077 CHECK_STATUS(status, NT_STATUS_OK);
3078 smb2_util_close(tree, testdirh);
3080 ZERO_STRUCT(io);
3081 io.in.desired_access = SEC_FLAG_MAXIMUM_ALLOWED;
3082 io.in.file_attributes = FILE_ATTRIBUTE_NORMAL;
3083 io.in.create_disposition = NTCREATEX_DISP_OVERWRITE_IF;
3084 io.in.share_access = (NTCREATEX_SHARE_ACCESS_DELETE |
3085 NTCREATEX_SHARE_ACCESS_READ |
3086 NTCREATEX_SHARE_ACCESS_WRITE);
3087 io.in.fname = fname;
3090 * Issuing an SMB2/CREATE with a suitably formed AAPL context,
3091 * controls behaviour of Apple's SMB2 extensions for the whole
3092 * session!
3095 data = data_blob_talloc(mem_ctx, NULL, 3 * sizeof(uint64_t));
3096 SBVAL(data.data, 0, SMB2_CRTCTX_AAPL_SERVER_QUERY);
3097 SBVAL(data.data, 8, (SMB2_CRTCTX_AAPL_SERVER_CAPS |
3098 SMB2_CRTCTX_AAPL_VOLUME_CAPS |
3099 SMB2_CRTCTX_AAPL_MODEL_INFO));
3100 SBVAL(data.data, 16, (SMB2_CRTCTX_AAPL_SUPPORTS_READ_DIR_ATTR |
3101 SMB2_CRTCTX_AAPL_UNIX_BASED |
3102 SMB2_CRTCTX_AAPL_SUPPORTS_NFS_ACE));
3104 torture_comment(tctx, "Testing SMB2 create context AAPL\n");
3105 status = smb2_create_blob_add(tctx, &io.in.blobs, "AAPL", data);
3106 CHECK_STATUS(status, NT_STATUS_OK);
3108 status = smb2_create(tree, tctx, &io);
3109 CHECK_STATUS(status, NT_STATUS_OK);
3110 status = smb2_util_close(tree, io.out.file.handle);
3111 CHECK_STATUS(status, NT_STATUS_OK);
3114 * Now check returned AAPL context
3116 torture_comment(tctx, "Comparing returned AAPL capabilities\n");
3118 aapl = smb2_create_blob_find(&io.out.blobs,
3119 SMB2_CREATE_TAG_AAPL);
3121 if (aapl == NULL) {
3122 torture_result(tctx, TORTURE_FAIL,
3123 "(%s) unexpectedly no AAPL capabilities were returned.",
3124 __location__);
3125 ret = false;
3126 goto done;
3129 if (!is_osx_server) {
3130 size_t expected_aapl_ctx_size;
3131 bool size_ok;
3134 * uint32_t CommandCode = kAAPL_SERVER_QUERY
3135 * uint32_t Reserved = 0;
3136 * uint64_t ReplyBitmap = kAAPL_SERVER_CAPS |
3137 * kAAPL_VOLUME_CAPS |
3138 * kAAPL_MODEL_INFO;
3139 * uint64_t ServerCaps = kAAPL_SUPPORTS_READDIR_ATTR |
3140 * kAAPL_SUPPORTS_OSX_COPYFILE;
3141 * uint64_t VolumeCaps = kAAPL_SUPPORT_RESOLVE_ID |
3142 * kAAPL_CASE_SENSITIVE;
3143 * uint32_t Pad2 = 0;
3144 * uint32_t ModelStringLen = 10;
3145 * ucs2_t ModelString[5] = "MacSamba";
3147 expected_aapl_ctx_size = strlen("MacSamba") * 2 + 40;
3149 size_ok = aapl->data.length == expected_aapl_ctx_size;
3150 torture_assert_goto(tctx, size_ok, ret, done, "bad AAPL size");
3153 aapl_cmd = IVAL(aapl->data.data, 0);
3154 if (aapl_cmd != SMB2_CRTCTX_AAPL_SERVER_QUERY) {
3155 torture_result(tctx, TORTURE_FAIL,
3156 "(%s) unexpected cmd: %d",
3157 __location__, (int)aapl_cmd);
3158 ret = false;
3159 goto done;
3162 aapl_reply_bitmap = BVAL(aapl->data.data, 8);
3163 if (aapl_reply_bitmap != (SMB2_CRTCTX_AAPL_SERVER_CAPS |
3164 SMB2_CRTCTX_AAPL_VOLUME_CAPS |
3165 SMB2_CRTCTX_AAPL_MODEL_INFO)) {
3166 torture_result(tctx, TORTURE_FAIL,
3167 "(%s) unexpected reply_bitmap: %d",
3168 __location__, (int)aapl_reply_bitmap);
3169 ret = false;
3170 goto done;
3173 aapl_server_caps = BVAL(aapl->data.data, 16);
3174 if (aapl_server_caps != (SMB2_CRTCTX_AAPL_UNIX_BASED |
3175 SMB2_CRTCTX_AAPL_SUPPORTS_READ_DIR_ATTR |
3176 SMB2_CRTCTX_AAPL_SUPPORTS_NFS_ACE |
3177 SMB2_CRTCTX_AAPL_SUPPORTS_OSX_COPYFILE)) {
3178 torture_result(tctx, TORTURE_FAIL,
3179 "(%s) unexpected server_caps: %d",
3180 __location__, (int)aapl_server_caps);
3181 ret = false;
3182 goto done;
3185 if (is_osx_server) {
3186 expected_vol_caps = 5;
3188 aapl_vol_caps = BVAL(aapl->data.data, 24);
3189 if (aapl_vol_caps != expected_vol_caps) {
3190 /* this will fail on a case insensitive fs ... */
3191 torture_result(tctx, TORTURE_FAIL,
3192 "(%s) unexpected vol_caps: %d",
3193 __location__, (int)aapl_vol_caps);
3196 ret = convert_string_talloc(mem_ctx,
3197 CH_UTF16LE, CH_UNIX,
3198 aapl->data.data + 40, 10,
3199 &model, NULL);
3200 if (ret == false) {
3201 torture_result(tctx, TORTURE_FAIL,
3202 "(%s) convert_string_talloc() failed",
3203 __location__);
3204 goto done;
3206 torture_comment(tctx, "Got server model: \"%s\"\n", model);
3209 * Now that Requested AAPL extensions are enabled, setup some
3210 * Mac files with metadata and resource fork
3212 ret = torture_setup_file(mem_ctx, tree, fname, false);
3213 if (ret == false) {
3214 torture_result(tctx, TORTURE_FAIL,
3215 "(%s) torture_setup_file() failed",
3216 __location__);
3217 goto done;
3220 info = torture_afpinfo_new(mem_ctx);
3221 if (info == NULL) {
3222 torture_result(tctx, TORTURE_FAIL,
3223 "(%s) torture_afpinfo_new() failed",
3224 __location__);
3225 ret = false;
3226 goto done;
3229 memcpy(info->afpi_FinderInfo, type_creator, 8);
3230 ret = torture_write_afpinfo(tree, tctx, mem_ctx, fname, info);
3231 if (ret == false) {
3232 torture_result(tctx, TORTURE_FAIL,
3233 "(%s) torture_write_afpinfo() failed",
3234 __location__);
3235 goto done;
3238 ret = write_stream(tree, __location__, tctx, mem_ctx,
3239 fname, AFPRESOURCE_STREAM_NAME,
3240 0, 3, "foo");
3241 if (ret == false) {
3242 torture_result(tctx, TORTURE_FAIL,
3243 "(%s) write_stream() failed",
3244 __location__);
3245 goto done;
3249 * Ok, file is prepared, now call smb2/find
3252 ZERO_STRUCT(io);
3253 io.in.desired_access = SEC_RIGHTS_DIR_READ;
3254 io.in.create_options = NTCREATEX_OPTIONS_DIRECTORY;
3255 io.in.file_attributes = FILE_ATTRIBUTE_DIRECTORY;
3256 io.in.share_access = (NTCREATEX_SHARE_ACCESS_READ |
3257 NTCREATEX_SHARE_ACCESS_WRITE |
3258 NTCREATEX_SHARE_ACCESS_DELETE);
3259 io.in.create_disposition = NTCREATEX_DISP_OPEN;
3260 io.in.fname = BASEDIR;
3261 status = smb2_create(tree, tctx, &io);
3262 CHECK_STATUS(status, NT_STATUS_OK);
3264 ZERO_STRUCT(f);
3265 f.in.file.handle = io.out.file.handle;
3266 f.in.pattern = "test_aapl";
3267 f.in.continue_flags = SMB2_CONTINUE_FLAG_SINGLE;
3268 f.in.max_response_size = 0x1000;
3269 f.in.level = SMB2_FIND_ID_BOTH_DIRECTORY_INFO;
3271 status = smb2_find_level(tree, tree, &f, &count, &d);
3272 CHECK_STATUS(status, NT_STATUS_OK);
3274 status = smb2_util_close(tree, io.out.file.handle);
3275 CHECK_STATUS(status, NT_STATUS_OK);
3277 if (strcmp(d[0].id_both_directory_info.name.s, "test_aapl") != 0) {
3278 torture_result(tctx, TORTURE_FAIL,
3279 "(%s) write_stream() failed",
3280 __location__);
3281 ret = false;
3282 goto done;
3285 if (d[0].id_both_directory_info.short_name.private_length != 24) {
3286 torture_result(tctx, TORTURE_FAIL,
3287 "(%s) bad short_name length %" PRIu32 ", expected 24",
3288 __location__, d[0].id_both_directory_info.short_name.private_length);
3289 ret = false;
3290 goto done;
3293 torture_comment(tctx, "short_name buffer:\n");
3294 dump_data(0, d[0].id_both_directory_info.short_name_buf, 24);
3297 * Extract data as specified by the AAPL extension:
3298 * - ea_size contains max_access
3299 * - short_name contains resource fork length + FinderInfo
3300 * - reserved2 contains the unix mode
3302 torture_comment(tctx, "mac_access: %" PRIx32 "\n",
3303 d[0].id_both_directory_info.ea_size);
3305 rfork_len = BVAL(d[0].id_both_directory_info.short_name_buf, 0);
3306 if (rfork_len != 3) {
3307 torture_result(tctx, TORTURE_FAIL,
3308 "(%s) expected resource fork length 3, got: %" PRIu64,
3309 __location__, rfork_len);
3310 ret = false;
3311 goto done;
3314 memcpy(type_creator_buf, d[0].id_both_directory_info.short_name_buf + 8, 8);
3315 type_creator_buf[8] = 0;
3316 if (strcmp(type_creator, type_creator_buf) != 0) {
3317 torture_result(tctx, TORTURE_FAIL,
3318 "(%s) expected type/creator \"%s\" , got: %s",
3319 __location__, type_creator, type_creator_buf);
3320 ret = false;
3321 goto done;
3324 done:
3325 smb2_util_unlink(tree, fname);
3326 smb2_deltree(tree, BASEDIR);
3327 talloc_free(mem_ctx);
3328 return ret;
3331 static uint64_t patt_hash(uint64_t off)
3333 return off;
3336 static bool write_pattern(struct torture_context *torture,
3337 struct smb2_tree *tree, TALLOC_CTX *mem_ctx,
3338 struct smb2_handle h, uint64_t off, uint64_t len,
3339 uint64_t patt_off)
3341 NTSTATUS status;
3342 uint64_t i;
3343 uint8_t *buf;
3344 uint64_t io_sz = MIN(1024 * 64, len);
3346 if (len == 0) {
3347 return true;
3350 torture_assert(torture, (len % 8) == 0, "invalid write len");
3352 buf = talloc_zero_size(mem_ctx, io_sz);
3353 torture_assert(torture, (buf != NULL), "no memory for file data buf");
3355 while (len > 0) {
3356 for (i = 0; i <= io_sz - 8; i += 8) {
3357 SBVAL(buf, i, patt_hash(patt_off));
3358 patt_off += 8;
3361 status = smb2_util_write(tree, h,
3362 buf, off, io_sz);
3363 torture_assert_ntstatus_ok(torture, status, "file write");
3365 len -= io_sz;
3366 off += io_sz;
3369 talloc_free(buf);
3371 return true;
3374 static bool check_pattern(struct torture_context *torture,
3375 struct smb2_tree *tree, TALLOC_CTX *mem_ctx,
3376 struct smb2_handle h, uint64_t off, uint64_t len,
3377 uint64_t patt_off)
3379 if (len == 0) {
3380 return true;
3383 torture_assert(torture, (len % 8) == 0, "invalid read len");
3385 while (len > 0) {
3386 uint64_t i;
3387 struct smb2_read r;
3388 NTSTATUS status;
3389 uint64_t io_sz = MIN(1024 * 64, len);
3391 ZERO_STRUCT(r);
3392 r.in.file.handle = h;
3393 r.in.length = io_sz;
3394 r.in.offset = off;
3395 status = smb2_read(tree, mem_ctx, &r);
3396 torture_assert_ntstatus_ok(torture, status, "read");
3398 torture_assert_u64_equal(torture, r.out.data.length, io_sz,
3399 "read data len mismatch");
3401 for (i = 0; i <= io_sz - 8; i += 8, patt_off += 8) {
3402 uint64_t data = BVAL(r.out.data.data, i);
3403 torture_assert_u64_equal(torture, data, patt_hash(patt_off),
3404 talloc_asprintf(torture, "read data "
3405 "pattern bad at %llu\n",
3406 (unsigned long long)off + i));
3408 talloc_free(r.out.data.data);
3409 len -= io_sz;
3410 off += io_sz;
3413 return true;
3416 static bool test_setup_open(struct torture_context *torture,
3417 struct smb2_tree *tree, TALLOC_CTX *mem_ctx,
3418 const char *fname,
3419 struct smb2_handle *fh,
3420 uint32_t desired_access,
3421 uint32_t file_attributes)
3423 struct smb2_create io;
3424 NTSTATUS status;
3426 ZERO_STRUCT(io);
3427 io.in.desired_access = desired_access;
3428 io.in.file_attributes = file_attributes;
3429 io.in.create_disposition = NTCREATEX_DISP_OPEN_IF;
3430 io.in.share_access =
3431 NTCREATEX_SHARE_ACCESS_DELETE|
3432 NTCREATEX_SHARE_ACCESS_READ|
3433 NTCREATEX_SHARE_ACCESS_WRITE;
3434 if (file_attributes & FILE_ATTRIBUTE_DIRECTORY) {
3435 io.in.create_options = NTCREATEX_OPTIONS_DIRECTORY;
3437 io.in.fname = fname;
3439 status = smb2_create(tree, mem_ctx, &io);
3440 torture_assert_ntstatus_ok(torture, status, "file create");
3442 *fh = io.out.file.handle;
3444 return true;
3447 static bool test_setup_create_fill(struct torture_context *torture,
3448 struct smb2_tree *tree, TALLOC_CTX *mem_ctx,
3449 const char *fname,
3450 struct smb2_handle *fh,
3451 uint64_t size,
3452 uint32_t desired_access,
3453 uint32_t file_attributes)
3455 bool ok;
3457 ok = test_setup_open(torture, tree, mem_ctx,
3458 fname,
3460 desired_access,
3461 file_attributes);
3462 torture_assert(torture, ok, "file open");
3464 if (size > 0) {
3465 ok = write_pattern(torture, tree, mem_ctx, *fh, 0, size, 0);
3466 torture_assert(torture, ok, "write pattern");
3468 return true;
3471 static bool test_setup_copy_chunk(struct torture_context *torture,
3472 struct smb2_tree *tree, TALLOC_CTX *mem_ctx,
3473 uint32_t nchunks,
3474 const char *src_name,
3475 struct smb2_handle *src_h,
3476 uint64_t src_size,
3477 uint32_t src_desired_access,
3478 const char *dst_name,
3479 struct smb2_handle *dest_h,
3480 uint64_t dest_size,
3481 uint32_t dest_desired_access,
3482 struct srv_copychunk_copy *cc_copy,
3483 union smb_ioctl *io)
3485 struct req_resume_key_rsp res_key;
3486 bool ok;
3487 NTSTATUS status;
3488 enum ndr_err_code ndr_ret;
3490 ok = test_setup_create_fill(torture, tree, mem_ctx, src_name,
3491 src_h, src_size, src_desired_access,
3492 FILE_ATTRIBUTE_NORMAL);
3493 torture_assert(torture, ok, "src file create fill");
3495 ok = test_setup_create_fill(torture, tree, mem_ctx, dst_name,
3496 dest_h, dest_size, dest_desired_access,
3497 FILE_ATTRIBUTE_NORMAL);
3498 torture_assert(torture, ok, "dest file create fill");
3500 ZERO_STRUCTPN(io);
3501 io->smb2.level = RAW_IOCTL_SMB2;
3502 io->smb2.in.file.handle = *src_h;
3503 io->smb2.in.function = FSCTL_SRV_REQUEST_RESUME_KEY;
3504 /* Allow for Key + ContextLength + Context */
3505 io->smb2.in.max_output_response = 32;
3506 io->smb2.in.flags = SMB2_IOCTL_FLAG_IS_FSCTL;
3508 status = smb2_ioctl(tree, mem_ctx, &io->smb2);
3509 torture_assert_ntstatus_ok(torture, status,
3510 "FSCTL_SRV_REQUEST_RESUME_KEY");
3512 ndr_ret = ndr_pull_struct_blob(&io->smb2.out.out, mem_ctx, &res_key,
3513 (ndr_pull_flags_fn_t)ndr_pull_req_resume_key_rsp);
3515 torture_assert_ndr_success(torture, ndr_ret,
3516 "ndr_pull_req_resume_key_rsp");
3518 ZERO_STRUCTPN(io);
3519 io->smb2.level = RAW_IOCTL_SMB2;
3520 io->smb2.in.file.handle = *dest_h;
3521 io->smb2.in.function = FSCTL_SRV_COPYCHUNK;
3522 io->smb2.in.max_output_response = sizeof(struct srv_copychunk_rsp);
3523 io->smb2.in.flags = SMB2_IOCTL_FLAG_IS_FSCTL;
3525 ZERO_STRUCTPN(cc_copy);
3526 memcpy(cc_copy->source_key, res_key.resume_key, ARRAY_SIZE(cc_copy->source_key));
3527 cc_copy->chunk_count = nchunks;
3528 cc_copy->chunks = talloc_zero_array(mem_ctx, struct srv_copychunk, nchunks);
3529 torture_assert(torture, (cc_copy->chunks != NULL), "no memory for chunks");
3531 return true;
3535 static bool check_copy_chunk_rsp(struct torture_context *torture,
3536 struct srv_copychunk_rsp *cc_rsp,
3537 uint32_t ex_chunks_written,
3538 uint32_t ex_chunk_bytes_written,
3539 uint32_t ex_total_bytes_written)
3541 torture_assert_int_equal(torture, cc_rsp->chunks_written,
3542 ex_chunks_written, "num chunks");
3543 torture_assert_int_equal(torture, cc_rsp->chunk_bytes_written,
3544 ex_chunk_bytes_written, "chunk bytes written");
3545 torture_assert_int_equal(torture, cc_rsp->total_bytes_written,
3546 ex_total_bytes_written, "chunk total bytes");
3547 return true;
3550 static bool neg_aapl_copyfile(struct torture_context *tctx,
3551 struct smb2_tree *tree,
3552 uint64_t flags)
3554 TALLOC_CTX *mem_ctx = talloc_new(tctx);
3555 const char *fname = "aapl";
3556 NTSTATUS status;
3557 struct smb2_create io;
3558 DATA_BLOB data;
3559 struct smb2_create_blob *aapl = NULL;
3560 uint32_t aapl_cmd;
3561 uint32_t aapl_reply_bitmap;
3562 uint32_t aapl_server_caps;
3563 bool ret = true;
3565 ZERO_STRUCT(io);
3566 io.in.desired_access = SEC_FLAG_MAXIMUM_ALLOWED;
3567 io.in.file_attributes = FILE_ATTRIBUTE_NORMAL;
3568 io.in.create_disposition = NTCREATEX_DISP_OVERWRITE_IF;
3569 io.in.share_access = (NTCREATEX_SHARE_ACCESS_DELETE |
3570 NTCREATEX_SHARE_ACCESS_READ |
3571 NTCREATEX_SHARE_ACCESS_WRITE);
3572 io.in.fname = fname;
3574 data = data_blob_talloc(mem_ctx, NULL, 3 * sizeof(uint64_t));
3575 SBVAL(data.data, 0, SMB2_CRTCTX_AAPL_SERVER_QUERY);
3576 SBVAL(data.data, 8, (SMB2_CRTCTX_AAPL_SERVER_CAPS));
3577 SBVAL(data.data, 16, flags);
3579 status = smb2_create_blob_add(tctx, &io.in.blobs, "AAPL", data);
3580 CHECK_STATUS(status, NT_STATUS_OK);
3582 status = smb2_create(tree, tctx, &io);
3583 CHECK_STATUS(status, NT_STATUS_OK);
3585 aapl = smb2_create_blob_find(&io.out.blobs,
3586 SMB2_CREATE_TAG_AAPL);
3587 if (aapl == NULL) {
3588 ret = false;
3589 goto done;
3592 if (aapl->data.length < 24) {
3593 ret = false;
3594 goto done;
3597 aapl_cmd = IVAL(aapl->data.data, 0);
3598 if (aapl_cmd != SMB2_CRTCTX_AAPL_SERVER_QUERY) {
3599 torture_result(tctx, TORTURE_FAIL,
3600 "(%s) unexpected cmd: %d",
3601 __location__, (int)aapl_cmd);
3602 ret = false;
3603 goto done;
3606 aapl_reply_bitmap = BVAL(aapl->data.data, 8);
3607 if (!(aapl_reply_bitmap & SMB2_CRTCTX_AAPL_SERVER_CAPS)) {
3608 torture_result(tctx, TORTURE_FAIL,
3609 "(%s) unexpected reply_bitmap: %d",
3610 __location__, (int)aapl_reply_bitmap);
3611 ret = false;
3612 goto done;
3615 aapl_server_caps = BVAL(aapl->data.data, 16);
3616 if (!(aapl_server_caps & flags)) {
3617 torture_result(tctx, TORTURE_FAIL,
3618 "(%s) unexpected server_caps: %d",
3619 __location__, (int)aapl_server_caps);
3620 ret = false;
3621 goto done;
3624 done:
3625 status = smb2_util_close(tree, io.out.file.handle);
3626 CHECK_STATUS(status, NT_STATUS_OK);
3628 smb2_util_unlink(tree, "aapl");
3629 talloc_free(mem_ctx);
3630 return ret;
3633 static bool test_copyfile(struct torture_context *torture,
3634 struct smb2_tree *tree)
3636 struct smb2_handle src_h;
3637 struct smb2_handle dest_h;
3638 NTSTATUS status;
3639 union smb_ioctl io;
3640 TALLOC_CTX *tmp_ctx = talloc_new(tree);
3641 struct srv_copychunk_copy cc_copy;
3642 struct srv_copychunk_rsp cc_rsp;
3643 enum ndr_err_code ndr_ret;
3644 bool ok;
3645 const char *sname = ":foo" "\xef\x80\xa2" "bar:$DATA";
3648 * First test a copy_chunk with a 0 chunk count without having
3649 * enabled this via AAPL. The request must not fail and the
3650 * copied length in the response must be 0. This is verified
3651 * against Windows 2008r2.
3654 ok = test_setup_copy_chunk(torture, tree, tmp_ctx,
3655 0, /* 0 chunks, copyfile semantics */
3656 FNAME_CC_SRC,
3657 &src_h, 4096, /* fill 4096 byte src file */
3658 SEC_FILE_READ_DATA | SEC_FILE_WRITE_DATA,
3659 FNAME_CC_DST,
3660 &dest_h, 0, /* 0 byte dest file */
3661 SEC_FILE_READ_DATA | SEC_FILE_WRITE_DATA,
3662 &cc_copy,
3663 &io);
3664 if (!ok) {
3665 torture_fail_goto(torture, done, "setup copy chunk error");
3668 ndr_ret = ndr_push_struct_blob(&io.smb2.in.out, tmp_ctx,
3669 &cc_copy,
3670 (ndr_push_flags_fn_t)ndr_push_srv_copychunk_copy);
3671 torture_assert_ndr_success(torture, ndr_ret,
3672 "ndr_push_srv_copychunk_copy");
3674 status = smb2_ioctl(tree, tmp_ctx, &io.smb2);
3675 torture_assert_ntstatus_ok_goto(torture, status, ok, done, "FSCTL_SRV_COPYCHUNK");
3677 ndr_ret = ndr_pull_struct_blob(&io.smb2.out.out, tmp_ctx,
3678 &cc_rsp,
3679 (ndr_pull_flags_fn_t)ndr_pull_srv_copychunk_rsp);
3680 torture_assert_ndr_success(torture, ndr_ret,
3681 "ndr_pull_srv_copychunk_rsp");
3683 ok = check_copy_chunk_rsp(torture, &cc_rsp,
3684 0, /* chunks written */
3685 0, /* chunk bytes unsuccessfully written */
3686 0); /* total bytes written */
3687 if (!ok) {
3688 torture_fail_goto(torture, done, "bad copy chunk response data");
3692 * Now enable AAPL copyfile and test again, the file and the
3693 * stream must be copied by the server.
3695 ok = neg_aapl_copyfile(torture, tree,
3696 SMB2_CRTCTX_AAPL_SUPPORTS_OSX_COPYFILE);
3697 if (!ok) {
3698 torture_skip_goto(torture, done, "missing AAPL copyfile");
3699 goto done;
3702 smb2_util_close(tree, src_h);
3703 smb2_util_close(tree, dest_h);
3704 smb2_util_unlink(tree, FNAME_CC_SRC);
3705 smb2_util_unlink(tree, FNAME_CC_DST);
3707 ok = torture_setup_file(tmp_ctx, tree, FNAME_CC_SRC, false);
3708 if (!ok) {
3709 torture_fail(torture, "setup file error");
3711 ok = write_stream(tree, __location__, torture, tmp_ctx,
3712 FNAME_CC_SRC, AFPRESOURCE_STREAM,
3713 10, 10, "1234567890");
3714 if (!ok) {
3715 torture_fail(torture, "setup stream error");
3718 ok = write_stream(tree, __location__, torture, tmp_ctx,
3719 FNAME_CC_SRC, sname,
3720 10, 10, "abcdefghij");
3721 torture_assert_goto(torture, ok == true, ok, done, "write_stream failed\n");
3723 ok = test_setup_copy_chunk(torture, tree, tmp_ctx,
3724 0, /* 0 chunks, copyfile semantics */
3725 FNAME_CC_SRC,
3726 &src_h, 4096, /* fill 4096 byte src file */
3727 SEC_FILE_READ_DATA | SEC_FILE_WRITE_DATA,
3728 FNAME_CC_DST,
3729 &dest_h, 0, /* 0 byte dest file */
3730 SEC_FILE_READ_DATA | SEC_FILE_WRITE_DATA,
3731 &cc_copy,
3732 &io);
3733 if (!ok) {
3734 torture_fail_goto(torture, done, "setup copy chunk error");
3737 ndr_ret = ndr_push_struct_blob(&io.smb2.in.out, tmp_ctx,
3738 &cc_copy,
3739 (ndr_push_flags_fn_t)ndr_push_srv_copychunk_copy);
3740 torture_assert_ndr_success(torture, ndr_ret,
3741 "ndr_push_srv_copychunk_copy");
3743 status = smb2_ioctl(tree, tmp_ctx, &io.smb2);
3744 torture_assert_ntstatus_ok_goto(torture, status, ok, done, "FSCTL_SRV_COPYCHUNK");
3746 ndr_ret = ndr_pull_struct_blob(&io.smb2.out.out, tmp_ctx,
3747 &cc_rsp,
3748 (ndr_pull_flags_fn_t)ndr_pull_srv_copychunk_rsp);
3749 torture_assert_ndr_success(torture, ndr_ret,
3750 "ndr_pull_srv_copychunk_rsp");
3752 ok = check_copy_chunk_rsp(torture, &cc_rsp,
3753 0, /* chunks written */
3754 0, /* chunk bytes unsuccessfully written */
3755 4096); /* total bytes written */
3756 if (!ok) {
3757 torture_fail_goto(torture, done, "bad copy chunk response data");
3760 ok = test_setup_open(torture, tree, tmp_ctx, FNAME_CC_DST, &dest_h,
3761 SEC_FILE_READ_DATA, FILE_ATTRIBUTE_NORMAL);
3762 if (!ok) {
3763 torture_fail_goto(torture, done,"open failed");
3765 ok = check_pattern(torture, tree, tmp_ctx, dest_h, 0, 4096, 0);
3766 if (!ok) {
3767 torture_fail_goto(torture, done, "inconsistent file data");
3770 ok = check_stream(tree, __location__, torture, tmp_ctx,
3771 FNAME_CC_DST, AFPRESOURCE_STREAM,
3772 0, 20, 10, 10, "1234567890");
3773 if (!ok) {
3774 torture_fail_goto(torture, done, "inconsistent stream data");
3777 ok = check_stream(tree, __location__, torture, tmp_ctx,
3778 FNAME_CC_DST, sname,
3779 0, 20, 10, 10, "abcdefghij");
3780 torture_assert_goto(torture, ok == true, ok, done, "check_stream failed\n");
3782 done:
3783 smb2_util_close(tree, src_h);
3784 smb2_util_close(tree, dest_h);
3785 smb2_util_unlink(tree, FNAME_CC_SRC);
3786 smb2_util_unlink(tree, FNAME_CC_DST);
3787 talloc_free(tmp_ctx);
3788 return true;
3791 static bool check_stream_list(struct smb2_tree *tree,
3792 struct torture_context *tctx,
3793 const char *fname,
3794 int num_exp,
3795 const char **exp,
3796 bool is_dir)
3798 bool ret = true;
3799 union smb_fileinfo finfo;
3800 NTSTATUS status;
3801 int i;
3802 TALLOC_CTX *tmp_ctx = talloc_new(tctx);
3803 char **exp_sort;
3804 struct stream_struct *stream_sort;
3805 struct smb2_create create;
3806 struct smb2_handle h;
3808 ZERO_STRUCT(h);
3809 torture_assert_goto(tctx, tmp_ctx != NULL, ret, done, "talloc_new failed");
3811 ZERO_STRUCT(create);
3812 create.in.fname = fname;
3813 create.in.create_disposition = NTCREATEX_DISP_OPEN;
3814 create.in.desired_access = SEC_FILE_ALL;
3815 create.in.create_options = is_dir ? NTCREATEX_OPTIONS_DIRECTORY : 0;
3816 create.in.file_attributes = is_dir ? FILE_ATTRIBUTE_DIRECTORY : FILE_ATTRIBUTE_NORMAL;
3817 create.in.share_access = NTCREATEX_SHARE_ACCESS_MASK;
3818 status = smb2_create(tree, tmp_ctx, &create);
3819 torture_assert_ntstatus_ok_goto(tctx, status, ret, done, "smb2_create");
3820 h = create.out.file.handle;
3822 finfo.generic.level = RAW_FILEINFO_STREAM_INFORMATION;
3823 finfo.generic.in.file.handle = h;
3825 status = smb2_getinfo_file(tree, tctx, &finfo);
3826 torture_assert_ntstatus_ok_goto(tctx, status, ret, done, "get stream info");
3828 smb2_util_close(tree, h);
3830 torture_assert_int_equal_goto(tctx, finfo.stream_info.out.num_streams, num_exp,
3831 ret, done, "stream count");
3833 if (num_exp == 0) {
3834 TALLOC_FREE(tmp_ctx);
3835 goto done;
3838 exp_sort = talloc_memdup(tmp_ctx, exp, num_exp * sizeof(*exp));
3839 torture_assert_goto(tctx, exp_sort != NULL, ret, done, __location__);
3841 TYPESAFE_QSORT(exp_sort, num_exp, qsort_string);
3843 stream_sort = talloc_memdup(tmp_ctx, finfo.stream_info.out.streams,
3844 finfo.stream_info.out.num_streams *
3845 sizeof(*stream_sort));
3846 torture_assert_goto(tctx, stream_sort != NULL, ret, done, __location__);
3848 TYPESAFE_QSORT(stream_sort, finfo.stream_info.out.num_streams, qsort_stream);
3850 for (i=0; i<num_exp; i++) {
3851 torture_comment(tctx, "i[%d] exp[%s] got[%s]\n",
3852 i, exp_sort[i], stream_sort[i].stream_name.s);
3853 torture_assert_str_equal_goto(tctx, stream_sort[i].stream_name.s, exp_sort[i],
3854 ret, done, "stream name");
3857 done:
3858 TALLOC_FREE(tmp_ctx);
3859 return ret;
3862 static bool check_stream_list_handle(struct smb2_tree *tree,
3863 struct torture_context *tctx,
3864 struct smb2_handle h,
3865 int num_exp,
3866 const char **exp,
3867 bool is_dir)
3869 bool ret = true;
3870 union smb_fileinfo finfo;
3871 NTSTATUS status;
3872 int i;
3873 TALLOC_CTX *tmp_ctx = talloc_new(tctx);
3874 char **exp_sort;
3875 struct stream_struct *stream_sort;
3877 torture_assert_goto(tctx, tmp_ctx != NULL, ret, done,
3878 "talloc_new failed\n");
3880 finfo = (union smb_fileinfo) {
3881 .stream_info.level = RAW_FILEINFO_STREAM_INFORMATION,
3882 .stream_info.in.file.handle = h,
3885 status = smb2_getinfo_file(tree, tctx, &finfo);
3886 torture_assert_ntstatus_ok_goto(tctx, status, ret, done,
3887 "get stream info\n");
3889 torture_assert_int_equal_goto(tctx, finfo.stream_info.out.num_streams,
3890 num_exp, ret, done, "stream count\n");
3892 if (num_exp == 0) {
3893 TALLOC_FREE(tmp_ctx);
3894 goto done;
3897 exp_sort = talloc_memdup(tmp_ctx, exp, num_exp * sizeof(*exp));
3898 torture_assert_goto(tctx, exp_sort != NULL, ret, done, __location__);
3900 TYPESAFE_QSORT(exp_sort, num_exp, qsort_string);
3902 stream_sort = talloc_memdup(tmp_ctx, finfo.stream_info.out.streams,
3903 finfo.stream_info.out.num_streams *
3904 sizeof(*stream_sort));
3905 torture_assert_goto(tctx, stream_sort != NULL, ret, done, __location__);
3907 TYPESAFE_QSORT(stream_sort, finfo.stream_info.out.num_streams, qsort_stream);
3909 for (i=0; i<num_exp; i++) {
3910 torture_comment(tctx, "i[%d] exp[%s] got[%s]\n",
3911 i, exp_sort[i], stream_sort[i].stream_name.s);
3912 torture_assert_str_equal_goto(tctx, stream_sort[i].stream_name.s,
3913 exp_sort[i], ret, done,
3914 "stream name\n");
3917 done:
3918 TALLOC_FREE(tmp_ctx);
3919 return ret;
3923 test stream names
3925 static bool test_stream_names(struct torture_context *tctx,
3926 struct smb2_tree *tree)
3928 TALLOC_CTX *mem_ctx = talloc_new(tctx);
3929 NTSTATUS status;
3930 struct smb2_create create;
3931 struct smb2_handle h;
3932 const char *fname = BASEDIR "\\stream_names.txt";
3933 const char *sname1;
3934 bool ret;
3935 /* UTF8 private use are starts at 0xef 0x80 0x80 (0xf000) */
3936 const char *streams[] = {
3937 ":foo" "\xef\x80\xa2" "bar:$DATA", /* "foo:bar:$DATA" */
3938 "::$DATA"
3941 sname1 = talloc_asprintf(mem_ctx, "%s%s", fname, streams[0]);
3943 /* clean slate ...*/
3944 smb2_util_unlink(tree, fname);
3945 smb2_deltree(tree, fname);
3946 smb2_deltree(tree, BASEDIR);
3948 status = torture_smb2_testdir(tree, BASEDIR, &h);
3949 CHECK_STATUS(status, NT_STATUS_OK);
3950 smb2_util_close(tree, h);
3952 ret = torture_setup_file(mem_ctx, tree, fname, false);
3953 torture_assert_goto(tctx, ret, ret, done, "torture_setup_file");
3955 torture_comment(tctx, "(%s) testing stream names\n", __location__);
3956 ZERO_STRUCT(create);
3957 create.in.desired_access = SEC_FILE_WRITE_DATA;
3958 create.in.file_attributes = FILE_ATTRIBUTE_NORMAL;
3959 create.in.share_access =
3960 NTCREATEX_SHARE_ACCESS_DELETE|
3961 NTCREATEX_SHARE_ACCESS_READ|
3962 NTCREATEX_SHARE_ACCESS_WRITE;
3963 create.in.create_disposition = NTCREATEX_DISP_CREATE;
3964 create.in.impersonation_level = SMB2_IMPERSONATION_ANONYMOUS;
3965 create.in.fname = sname1;
3967 status = smb2_create(tree, mem_ctx, &create);
3968 CHECK_STATUS(status, NT_STATUS_OK);
3970 status = smb2_util_write(tree, create.out.file.handle, "foo", 0, 3);
3971 torture_assert_ntstatus_ok_goto(tctx, status, ret, done,
3972 "smb2_util_write failed\n");
3974 smb2_util_close(tree, create.out.file.handle);
3976 ret = check_stream_list(tree, tctx, fname, 2, streams, false);
3977 CHECK_VALUE(ret, true);
3979 done:
3980 status = smb2_util_unlink(tree, fname);
3981 smb2_deltree(tree, BASEDIR);
3982 talloc_free(mem_ctx);
3984 return ret;
3987 /* Renaming a directory with open file, should work for OS X AAPL clients */
3988 static bool test_rename_dir_openfile(struct torture_context *torture,
3989 struct smb2_tree *tree)
3991 bool ret = true;
3992 NTSTATUS status;
3993 union smb_open io;
3994 union smb_close cl;
3995 union smb_setfileinfo sinfo;
3996 struct smb2_handle d1, h1;
3997 const char *renamedir = BASEDIR "-new";
3998 bool server_is_osx = torture_setting_bool(torture, "osx", false);
4000 smb2_deltree(tree, BASEDIR);
4001 smb2_util_rmdir(tree, BASEDIR);
4002 smb2_deltree(tree, renamedir);
4004 ZERO_STRUCT(io.smb2);
4005 io.generic.level = RAW_OPEN_SMB2;
4006 io.smb2.in.create_flags = 0;
4007 io.smb2.in.desired_access = 0x0017019f;
4008 io.smb2.in.create_options = NTCREATEX_OPTIONS_DIRECTORY;
4009 io.smb2.in.file_attributes = FILE_ATTRIBUTE_DIRECTORY;
4010 io.smb2.in.share_access = 0;
4011 io.smb2.in.alloc_size = 0;
4012 io.smb2.in.create_disposition = NTCREATEX_DISP_CREATE;
4013 io.smb2.in.impersonation_level = SMB2_IMPERSONATION_ANONYMOUS;
4014 io.smb2.in.security_flags = 0;
4015 io.smb2.in.fname = BASEDIR;
4017 status = smb2_create(tree, torture, &(io.smb2));
4018 torture_assert_ntstatus_ok(torture, status, "smb2_create dir");
4019 d1 = io.smb2.out.file.handle;
4021 ZERO_STRUCT(io.smb2);
4022 io.generic.level = RAW_OPEN_SMB2;
4023 io.smb2.in.create_flags = 0;
4024 io.smb2.in.desired_access = 0x0017019f;
4025 io.smb2.in.create_options = NTCREATEX_OPTIONS_NON_DIRECTORY_FILE;
4026 io.smb2.in.file_attributes = FILE_ATTRIBUTE_NORMAL;
4027 io.smb2.in.share_access = 0;
4028 io.smb2.in.alloc_size = 0;
4029 io.smb2.in.create_disposition = NTCREATEX_DISP_CREATE;
4030 io.smb2.in.impersonation_level = SMB2_IMPERSONATION_ANONYMOUS;
4031 io.smb2.in.security_flags = 0;
4032 io.smb2.in.fname = BASEDIR "\\file.txt";
4034 status = smb2_create(tree, torture, &(io.smb2));
4035 torture_assert_ntstatus_ok(torture, status, "smb2_create file");
4036 h1 = io.smb2.out.file.handle;
4038 if (!server_is_osx) {
4039 torture_comment(torture, "Renaming directory without AAPL, must fail\n");
4041 ZERO_STRUCT(sinfo);
4042 sinfo.rename_information.level = RAW_SFILEINFO_RENAME_INFORMATION;
4043 sinfo.rename_information.in.file.handle = d1;
4044 sinfo.rename_information.in.overwrite = 0;
4045 sinfo.rename_information.in.root_fid = 0;
4046 sinfo.rename_information.in.new_name = renamedir;
4047 status = smb2_setinfo_file(tree, &sinfo);
4049 torture_assert_ntstatus_equal(torture, status,
4050 NT_STATUS_ACCESS_DENIED,
4051 "smb2_setinfo_file");
4054 status = smb2_util_close(tree, d1);
4055 torture_assert_ntstatus_ok(torture, status, "smb2_util_close\n");
4056 ZERO_STRUCT(d1);
4058 torture_comment(torture, "Enabling AAPL\n");
4060 ret = enable_aapl(torture, tree);
4061 torture_assert(torture, ret == true, "enable_aapl failed");
4063 torture_comment(torture, "Renaming directory with AAPL\n");
4065 ZERO_STRUCT(io.smb2);
4066 io.generic.level = RAW_OPEN_SMB2;
4067 io.smb2.in.desired_access = 0x0017019f;
4068 io.smb2.in.file_attributes = FILE_ATTRIBUTE_DIRECTORY;
4069 io.smb2.in.share_access = 0;
4070 io.smb2.in.alloc_size = 0;
4071 io.smb2.in.create_disposition = NTCREATEX_DISP_OPEN;
4072 io.smb2.in.impersonation_level = SMB2_IMPERSONATION_ANONYMOUS;
4073 io.smb2.in.security_flags = 0;
4074 io.smb2.in.fname = BASEDIR;
4076 status = smb2_create(tree, torture, &(io.smb2));
4077 torture_assert_ntstatus_ok(torture, status, "smb2_create dir");
4078 d1 = io.smb2.out.file.handle;
4080 ZERO_STRUCT(sinfo);
4081 sinfo.rename_information.level = RAW_SFILEINFO_RENAME_INFORMATION;
4082 sinfo.rename_information.in.file.handle = d1;
4083 sinfo.rename_information.in.overwrite = 0;
4084 sinfo.rename_information.in.root_fid = 0;
4085 sinfo.rename_information.in.new_name = renamedir;
4087 status = smb2_setinfo_file(tree, &sinfo);
4088 torture_assert_ntstatus_ok(torture, status, "smb2_setinfo_file");
4090 ZERO_STRUCT(cl.smb2);
4091 cl.smb2.level = RAW_CLOSE_SMB2;
4092 cl.smb2.in.file.handle = d1;
4093 status = smb2_close(tree, &(cl.smb2));
4094 torture_assert_ntstatus_ok(torture, status, "smb2_close");
4095 ZERO_STRUCT(d1);
4097 cl.smb2.in.file.handle = h1;
4098 status = smb2_close(tree, &(cl.smb2));
4099 torture_assert_ntstatus_ok(torture, status, "smb2_close");
4100 ZERO_STRUCT(h1);
4102 torture_comment(torture, "Cleaning up\n");
4104 if (h1.data[0] || h1.data[1]) {
4105 ZERO_STRUCT(cl.smb2);
4106 cl.smb2.level = RAW_CLOSE_SMB2;
4107 cl.smb2.in.file.handle = h1;
4108 status = smb2_close(tree, &(cl.smb2));
4111 smb2_util_unlink(tree, BASEDIR "\\file.txt");
4112 smb2_util_unlink(tree, BASEDIR "-new\\file.txt");
4113 smb2_deltree(tree, renamedir);
4114 smb2_deltree(tree, BASEDIR);
4115 return ret;
4118 static bool test_afpinfo_enoent(struct torture_context *tctx,
4119 struct smb2_tree *tree)
4121 bool ret = true;
4122 NTSTATUS status;
4123 struct smb2_create create;
4124 struct smb2_handle h1;
4125 TALLOC_CTX *mem_ctx = talloc_new(tctx);
4126 const char *fname = BASEDIR "\\file";
4127 const char *sname = BASEDIR "\\file" AFPINFO_STREAM_NAME;
4129 torture_comment(tctx, "Opening file without AFP_AfpInfo\n");
4131 smb2_deltree(tree, BASEDIR);
4132 status = torture_smb2_testdir(tree, BASEDIR, &h1);
4133 torture_assert_ntstatus_ok_goto(tctx, status, ret, done, "torture_smb2_testdir");
4134 smb2_util_close(tree, h1);
4135 ret = torture_setup_file(mem_ctx, tree, fname, false);
4136 torture_assert_goto(tctx, ret == true, ret, done, "torture_setup_file");
4138 torture_comment(tctx, "Opening not existing AFP_AfpInfo\n");
4140 ZERO_STRUCT(create);
4141 create.in.create_disposition = NTCREATEX_DISP_OPEN;
4142 create.in.desired_access = SEC_FILE_READ_ATTRIBUTE; /* stat open */
4143 create.in.fname = sname;
4145 status = smb2_create(tree, mem_ctx, &create);
4146 torture_assert_ntstatus_equal_goto(tctx, status, NT_STATUS_OBJECT_NAME_NOT_FOUND,
4147 ret, done, "Got unexpected AFP_AfpInfo stream");
4149 done:
4150 smb2_util_unlink(tree, fname);
4151 smb2_util_rmdir(tree, BASEDIR);
4152 return ret;
4155 static bool test_create_delete_on_close(struct torture_context *tctx,
4156 struct smb2_tree *tree)
4158 bool ret = true;
4159 NTSTATUS status;
4160 struct smb2_create create;
4161 struct smb2_handle h1;
4162 TALLOC_CTX *mem_ctx = talloc_new(tctx);
4163 const char *fname = BASEDIR "\\file";
4164 const char *sname = BASEDIR "\\file" AFPINFO_STREAM_NAME;
4165 const char *type_creator = "SMB,OLE!";
4166 AfpInfo *info = NULL;
4167 const char *streams_basic[] = {
4168 "::$DATA"
4170 const char *streams_afpinfo[] = {
4171 "::$DATA",
4172 AFPINFO_STREAM
4175 torture_assert_goto(tctx, mem_ctx != NULL, ret, done, "talloc_new");
4177 torture_comment(tctx, "Checking whether create with delete-on-close work with AFP_AfpInfo\n");
4179 smb2_deltree(tree, BASEDIR);
4180 status = torture_smb2_testdir(tree, BASEDIR, &h1);
4181 torture_assert_ntstatus_ok_goto(tctx, status, ret, done, "torture_smb2_testdir");
4182 smb2_util_close(tree, h1);
4183 ret = torture_setup_file(mem_ctx, tree, fname, false);
4184 torture_assert_goto(tctx, ret == true, ret, done, "torture_setup_file");
4186 torture_comment(tctx, "Opening not existing AFP_AfpInfo\n");
4188 ZERO_STRUCT(create);
4189 create.in.create_disposition = NTCREATEX_DISP_OPEN;
4190 create.in.desired_access = SEC_FILE_READ_ATTRIBUTE; /* stat open */
4191 create.in.fname = sname;
4193 status = smb2_create(tree, mem_ctx, &create);
4194 torture_assert_ntstatus_equal_goto(tctx, status, NT_STATUS_OBJECT_NAME_NOT_FOUND,
4195 ret, done, "Got unexpected AFP_AfpInfo stream");
4197 ZERO_STRUCT(create);
4198 create.in.create_disposition = NTCREATEX_DISP_OPEN;
4199 create.in.desired_access = SEC_FILE_ALL;
4200 create.in.fname = sname;
4202 status = smb2_create(tree, mem_ctx, &create);
4203 torture_assert_ntstatus_equal_goto(tctx, status, NT_STATUS_OBJECT_NAME_NOT_FOUND,
4204 ret, done, "Got unexpected AFP_AfpInfo stream");
4206 ret = check_stream_list(tree, tctx, fname, 1, streams_basic, false);
4207 torture_assert_goto(tctx, ret == true, ret, done, "Bad streams");
4209 torture_comment(tctx, "Deleting AFP_AfpInfo via create with delete-on-close\n");
4211 info = torture_afpinfo_new(mem_ctx);
4212 torture_assert_goto(tctx, info != NULL, ret, done, "torture_afpinfo_new failed");
4214 memcpy(info->afpi_FinderInfo, type_creator, 8);
4215 ret = torture_write_afpinfo(tree, tctx, mem_ctx, fname, info);
4216 torture_assert_goto(tctx, ret == true, ret, done, "torture_write_afpinfo failed");
4218 ret = check_stream(tree, __location__, tctx, mem_ctx, fname, AFPINFO_STREAM,
4219 0, 60, 16, 8, type_creator);
4220 torture_assert_goto(tctx, ret == true, ret, done, "Bad type/creator in AFP_AfpInfo");
4222 ret = check_stream_list(tree, tctx, fname, 2, streams_afpinfo, false);
4223 torture_assert_goto(tctx, ret == true, ret, done, "Bad streams");
4225 ZERO_STRUCT(create);
4226 create.in.create_disposition = NTCREATEX_DISP_OPEN;
4227 create.in.create_options = NTCREATEX_OPTIONS_DELETE_ON_CLOSE;
4228 create.in.desired_access = SEC_FILE_READ_ATTRIBUTE | SEC_STD_SYNCHRONIZE | SEC_STD_DELETE;
4229 create.in.impersonation_level = NTCREATEX_IMPERSONATION_IMPERSONATION;
4230 create.in.fname = sname;
4231 create.in.file_attributes = FILE_ATTRIBUTE_NORMAL;
4233 status = smb2_create(tree, mem_ctx, &create);
4234 torture_assert_ntstatus_ok_goto(tctx, status, ret, done, "smb2_create failed");
4236 h1 = create.out.file.handle;
4237 smb2_util_close(tree, h1);
4239 ZERO_STRUCT(create);
4240 create.in.create_disposition = NTCREATEX_DISP_OPEN;
4241 create.in.desired_access = SEC_FILE_READ_ATTRIBUTE;
4242 create.in.fname = sname;
4243 create.in.file_attributes = FILE_ATTRIBUTE_NORMAL;
4244 status = smb2_create(tree, mem_ctx, &create);
4245 torture_assert_ntstatus_equal_goto(tctx, status, NT_STATUS_OBJECT_NAME_NOT_FOUND,
4246 ret, done, "Got unexpected AFP_AfpInfo stream");
4248 ret = check_stream_list(tree, tctx, fname, 1, streams_basic, false);
4249 torture_assert_goto(tctx, ret == true, ret, done, "Bad streams");
4251 done:
4252 smb2_util_unlink(tree, fname);
4253 smb2_util_rmdir(tree, BASEDIR);
4254 return ret;
4257 static bool test_setinfo_delete_on_close(struct torture_context *tctx,
4258 struct smb2_tree *tree)
4260 bool ret = true;
4261 NTSTATUS status;
4262 struct smb2_create create;
4263 union smb_setfileinfo sfinfo;
4264 struct smb2_handle h1;
4265 TALLOC_CTX *mem_ctx = talloc_new(tctx);
4266 const char *fname = BASEDIR "\\file";
4267 const char *sname = BASEDIR "\\file" AFPINFO_STREAM_NAME;
4268 const char *type_creator = "SMB,OLE!";
4269 AfpInfo *info = NULL;
4270 const char *streams[] = {
4271 AFPINFO_STREAM,
4272 "::$DATA"
4274 const char *streams_basic[] = {
4275 "::$DATA"
4278 torture_assert_goto(tctx, mem_ctx != NULL, ret, done, "talloc_new");
4280 torture_comment(tctx, "Deleting AFP_AfpInfo via setinfo with delete-on-close\n");
4282 smb2_deltree(tree, BASEDIR);
4283 status = torture_smb2_testdir(tree, BASEDIR, &h1);
4284 torture_assert_ntstatus_ok_goto(tctx, status, ret, done, "torture_smb2_testdir");
4285 smb2_util_close(tree, h1);
4286 ret = torture_setup_file(mem_ctx, tree, fname, false);
4287 torture_assert_goto(tctx, ret == true, ret, done, "torture_setup_file");
4289 info = torture_afpinfo_new(mem_ctx);
4290 torture_assert_goto(tctx, info != NULL, ret, done, "torture_afpinfo_new failed");
4291 memcpy(info->afpi_FinderInfo, type_creator, 8);
4292 ret = torture_write_afpinfo(tree, tctx, mem_ctx, fname, info);
4293 torture_assert_goto(tctx, ret == true, ret, done, "torture_write_afpinfo failed");
4295 ZERO_STRUCT(create);
4296 create.in.create_disposition = NTCREATEX_DISP_OPEN;
4297 create.in.desired_access = SEC_FILE_READ_ATTRIBUTE | SEC_STD_SYNCHRONIZE | SEC_STD_DELETE;
4298 create.in.fname = sname;
4299 create.in.file_attributes = FILE_ATTRIBUTE_NORMAL;
4300 create.in.impersonation_level = NTCREATEX_IMPERSONATION_IMPERSONATION;
4302 status = smb2_create(tree, mem_ctx, &create);
4303 torture_assert_ntstatus_ok_goto(tctx, status, ret, done, "smb2_create failed");
4305 h1 = create.out.file.handle;
4307 /* Delete stream via setinfo delete-on-close */
4308 ZERO_STRUCT(sfinfo);
4309 sfinfo.disposition_info.in.delete_on_close = 1;
4310 sfinfo.generic.level = RAW_SFILEINFO_DISPOSITION_INFORMATION;
4311 sfinfo.generic.in.file.handle = h1;
4312 status = smb2_setinfo_file(tree, &sfinfo);
4313 torture_assert_ntstatus_ok_goto(tctx, status, ret, done, "set delete-on-close failed");
4315 ret = check_stream_list(tree, tctx, fname, 2, streams, false);
4316 torture_assert_goto(tctx, ret == true, ret, done, "Bad streams");
4318 ZERO_STRUCT(create);
4319 create.in.create_disposition = NTCREATEX_DISP_OPEN;
4320 create.in.desired_access = SEC_FILE_ALL;
4321 create.in.fname = sname;
4322 create.in.file_attributes = FILE_ATTRIBUTE_NORMAL;
4323 create.in.impersonation_level = NTCREATEX_IMPERSONATION_IMPERSONATION;
4324 status = smb2_create(tree, mem_ctx, &create);
4325 torture_assert_ntstatus_equal_goto(tctx, status, NT_STATUS_DELETE_PENDING,
4326 ret, done, "Got unexpected AFP_AfpInfo stream");
4328 smb2_util_close(tree, h1);
4330 ret = check_stream_list(tree, tctx, fname, 1, streams_basic, false);
4331 torture_assert_goto(tctx, ret == true, ret, done, "Bad streams");
4333 ZERO_STRUCT(create);
4334 create.in.create_disposition = NTCREATEX_DISP_OPEN;
4335 create.in.desired_access = SEC_FILE_ALL;
4336 create.in.fname = sname;
4337 create.in.file_attributes = FILE_ATTRIBUTE_NORMAL;
4338 create.in.impersonation_level = NTCREATEX_IMPERSONATION_IMPERSONATION;
4339 status = smb2_create(tree, mem_ctx, &create);
4340 torture_assert_ntstatus_equal_goto(tctx, status, NT_STATUS_OBJECT_NAME_NOT_FOUND,
4341 ret, done, "Got unexpected AFP_AfpInfo stream");
4343 done:
4344 smb2_util_unlink(tree, fname);
4345 smb2_util_rmdir(tree, BASEDIR);
4346 return ret;
4349 static bool test_setinfo_eof(struct torture_context *tctx,
4350 struct smb2_tree *tree)
4352 bool ret = true;
4353 NTSTATUS status;
4354 struct smb2_create create;
4355 union smb_setfileinfo sfinfo;
4356 struct smb2_handle h1;
4357 TALLOC_CTX *mem_ctx = talloc_new(tctx);
4358 const char *fname = BASEDIR "\\file";
4359 const char *sname = BASEDIR "\\file" AFPINFO_STREAM_NAME;
4360 const char *type_creator = "SMB,OLE!";
4361 AfpInfo *info = NULL;
4362 const char *streams_afpinfo[] = {
4363 "::$DATA",
4364 AFPINFO_STREAM
4367 torture_assert_goto(tctx, mem_ctx != NULL, ret, done, "talloc_new");
4369 torture_comment(tctx, "Set AFP_AfpInfo EOF to 61, 1 and 0\n");
4371 smb2_deltree(tree, BASEDIR);
4372 status = torture_smb2_testdir(tree, BASEDIR, &h1);
4373 torture_assert_ntstatus_ok_goto(tctx, status, ret, done, "torture_smb2_testdir");
4374 smb2_util_close(tree, h1);
4375 ret = torture_setup_file(mem_ctx, tree, fname, false);
4376 torture_assert_goto(tctx, ret == true, ret, done, "torture_setup_file");
4378 info = torture_afpinfo_new(mem_ctx);
4379 torture_assert_goto(tctx, info != NULL, ret, done, "torture_afpinfo_new failed");
4380 memcpy(info->afpi_FinderInfo, type_creator, 8);
4381 ret = torture_write_afpinfo(tree, tctx, mem_ctx, fname, info);
4382 torture_assert_goto(tctx, ret == true, ret, done, "torture_write_afpinfo failed");
4384 ZERO_STRUCT(create);
4385 create.in.create_disposition = NTCREATEX_DISP_OPEN;
4386 create.in.desired_access = SEC_FILE_ALL;
4387 create.in.fname = sname;
4388 create.in.file_attributes = FILE_ATTRIBUTE_NORMAL;
4389 create.in.impersonation_level = NTCREATEX_IMPERSONATION_IMPERSONATION;
4391 status = smb2_create(tree, mem_ctx, &create);
4392 torture_assert_ntstatus_ok_goto(tctx, status, ret, done, "smb2_create failed");
4394 h1 = create.out.file.handle;
4396 torture_comment(tctx, "Set AFP_AfpInfo EOF to 61\n");
4398 /* Test setinfo end-of-file info */
4399 ZERO_STRUCT(sfinfo);
4400 sfinfo.generic.in.file.handle = h1;
4401 sfinfo.generic.level = RAW_SFILEINFO_END_OF_FILE_INFORMATION;
4402 sfinfo.position_information.in.position = 61;
4403 status = smb2_setinfo_file(tree, &sfinfo);
4404 torture_assert_ntstatus_equal_goto(tctx, status, NT_STATUS_ALLOTTED_SPACE_EXCEEDED,
4405 ret, done, "set eof 61 failed");
4407 torture_comment(tctx, "Set AFP_AfpInfo EOF to 1\n");
4409 /* Truncation returns success, but has no effect */
4410 ZERO_STRUCT(sfinfo);
4411 sfinfo.generic.in.file.handle = h1;
4412 sfinfo.generic.level = RAW_SFILEINFO_END_OF_FILE_INFORMATION;
4413 sfinfo.position_information.in.position = 1;
4414 status = smb2_setinfo_file(tree, &sfinfo);
4415 torture_assert_ntstatus_ok_goto(tctx, status,
4416 ret, done, "set eof 1 failed");
4417 smb2_util_close(tree, h1);
4419 ret = check_stream_list(tree, tctx, fname, 2, streams_afpinfo, false);
4420 torture_assert_goto(tctx, ret == true, ret, done, "Bad streams");
4422 ret = check_stream(tree, __location__, tctx, mem_ctx, fname, AFPINFO_STREAM,
4423 0, 60, 16, 8, type_creator);
4424 torture_assert_goto(tctx, ret == true, ret, done, "FinderInfo changed");
4426 ZERO_STRUCT(create);
4427 create.in.create_disposition = NTCREATEX_DISP_OPEN;
4428 create.in.desired_access = SEC_FILE_ALL;
4429 create.in.fname = sname;
4430 create.in.file_attributes = FILE_ATTRIBUTE_NORMAL;
4431 create.in.impersonation_level = NTCREATEX_IMPERSONATION_IMPERSONATION;
4433 status = smb2_create(tree, mem_ctx, &create);
4434 torture_assert_ntstatus_ok_goto(tctx, status, ret, done, "smb2_create failed");
4436 h1 = create.out.file.handle;
4439 * Delete stream via setinfo end-of-file info to 0, should
4440 * return success but stream MUST NOT deleted
4442 ZERO_STRUCT(sfinfo);
4443 sfinfo.generic.in.file.handle = h1;
4444 sfinfo.generic.level = RAW_SFILEINFO_END_OF_FILE_INFORMATION;
4445 sfinfo.position_information.in.position = 0;
4446 status = smb2_setinfo_file(tree, &sfinfo);
4447 torture_assert_ntstatus_ok_goto(tctx, status, ret, done, "set eof 0 failed");
4449 smb2_util_close(tree, h1);
4451 ret = check_stream_list(tree, tctx, fname, 2, streams_afpinfo, false);
4452 torture_assert_goto(tctx, ret == true, ret, done, "Bad streams");
4454 ret = check_stream(tree, __location__, tctx, mem_ctx, fname, AFPINFO_STREAM,
4455 0, 60, 16, 8, type_creator);
4456 torture_assert_goto(tctx, ret == true, ret, done, "FinderInfo changed");
4458 done:
4459 smb2_util_unlink(tree, fname);
4460 smb2_util_rmdir(tree, BASEDIR);
4461 return ret;
4464 static bool test_afpinfo_all0(struct torture_context *tctx,
4465 struct smb2_tree *tree)
4467 bool ret = true;
4468 NTSTATUS status;
4469 struct smb2_create create;
4470 struct smb2_handle h1 = {{0}};
4471 struct smb2_handle baseh = {{0}};
4472 union smb_setfileinfo setfinfo;
4473 union smb_fileinfo getfinfo;
4474 TALLOC_CTX *mem_ctx = talloc_new(tctx);
4475 const char *fname = BASEDIR "\\file";
4476 const char *sname = BASEDIR "\\file" AFPINFO_STREAM;
4477 const char *type_creator = "SMB,OLE!";
4478 AfpInfo *info = NULL;
4479 char *infobuf = NULL;
4480 const char *streams_basic[] = {
4481 "::$DATA"
4483 const char *streams_afpinfo[] = {
4484 "::$DATA",
4485 AFPINFO_STREAM
4488 torture_assert_goto(tctx, mem_ctx != NULL, ret, done, "talloc_new");
4490 torture_comment(tctx, "Write all 0 to AFP_AfpInfo and see what happens\n");
4492 smb2_deltree(tree, BASEDIR);
4493 status = torture_smb2_testdir(tree, BASEDIR, &h1);
4494 torture_assert_ntstatus_ok_goto(tctx, status, ret, done, "torture_smb2_testdir");
4495 smb2_util_close(tree, h1);
4496 ret = torture_setup_file(mem_ctx, tree, fname, false);
4497 torture_assert_goto(tctx, ret == true, ret, done, "torture_setup_file");
4499 info = torture_afpinfo_new(mem_ctx);
4500 torture_assert_goto(tctx, info != NULL, ret, done, "torture_afpinfo_new failed");
4501 memcpy(info->afpi_FinderInfo, type_creator, 8);
4502 ret = torture_write_afpinfo(tree, tctx, mem_ctx, fname, info);
4503 torture_assert_goto(tctx, ret == true, ret, done, "torture_write_afpinfo failed");
4505 ret = check_stream_list(tree, tctx, fname, 2, streams_afpinfo, false);
4506 torture_assert_goto(tctx, ret == true, ret, done, "Bad streams");
4508 /* Write all 0 to AFP_AfpInfo */
4509 memset(info->afpi_FinderInfo, 0, AFP_FinderSize);
4510 infobuf = torture_afpinfo_pack(mem_ctx, info);
4511 torture_assert_not_null_goto(tctx, infobuf, ret, done,
4512 "torture_afpinfo_pack failed\n");
4514 ZERO_STRUCT(create);
4515 create.in.desired_access = SEC_FILE_ALL;
4516 create.in.file_attributes = FILE_ATTRIBUTE_NORMAL;
4517 create.in.create_disposition = NTCREATEX_DISP_OPEN;
4518 create.in.share_access = NTCREATEX_SHARE_ACCESS_MASK;
4519 create.in.fname = fname;
4521 status = smb2_create(tree, mem_ctx, &create);
4522 torture_assert_ntstatus_ok_goto(tctx, status, ret, done,
4523 "smb2_create failed\n");
4524 baseh = create.out.file.handle;
4526 ZERO_STRUCT(create);
4527 create.in.desired_access = SEC_FILE_ALL;
4528 create.in.file_attributes = FILE_ATTRIBUTE_NORMAL;
4529 create.in.create_disposition = NTCREATEX_DISP_OVERWRITE_IF;
4530 create.in.fname = sname;
4532 status = smb2_create(tree, mem_ctx, &create);
4533 torture_assert_ntstatus_ok_goto(tctx, status, ret, done,
4534 "smb2_create failed\n");
4535 h1 = create.out.file.handle;
4537 status = smb2_util_write(tree, h1, infobuf, 0, AFP_INFO_SIZE);
4538 torture_assert_ntstatus_ok_goto(tctx, status, ret, done,
4539 "smb2_util_write failed\n");
4542 * Get stream information on open handle, must return only default
4543 * stream, the AFP_AfpInfo stream must not be returned.
4546 ZERO_STRUCT(getfinfo);
4547 getfinfo.generic.level = RAW_FILEINFO_STREAM_INFORMATION;
4548 getfinfo.generic.in.file.handle = baseh;
4550 status = smb2_getinfo_file(tree, tctx, &getfinfo);
4551 torture_assert_ntstatus_ok_goto(tctx, status, ret, done,
4552 "get stream info\n");
4554 torture_assert_int_equal_goto(tctx, getfinfo.stream_info.out.num_streams,
4555 1, ret, done, "stream count");
4557 smb2_util_close(tree, baseh);
4558 ZERO_STRUCT(baseh);
4561 * Try to set some file-basic-info (time) on the stream. This catches
4562 * naive implementation mistakes that simply deleted the backing store
4563 * from the filesystem in the zero-out step.
4566 ZERO_STRUCT(setfinfo);
4567 unix_to_nt_time(&setfinfo.basic_info.in.write_time, time(NULL));
4568 setfinfo.basic_info.in.attrib = 0x20;
4569 setfinfo.generic.level = RAW_SFILEINFO_BASIC_INFORMATION;
4570 setfinfo.generic.in.file.handle = h1;
4572 status = smb2_setinfo_file(tree, &setfinfo);
4573 torture_assert_ntstatus_ok_goto(tctx, status, ret, done,
4574 "smb2_getinfo_file failed\n");
4576 ret = check_stream_list(tree, tctx, fname, 1, streams_basic, false);
4577 torture_assert_goto(tctx, ret == true, ret, done, "check_stream_list");
4579 smb2_util_close(tree, h1);
4580 ZERO_STRUCT(h1);
4582 ret = check_stream_list(tree, tctx, fname, 1, streams_basic, false);
4583 torture_assert_goto(tctx, ret == true, ret, done, "Bad streams");
4585 done:
4586 if (!smb2_util_handle_empty(h1)) {
4587 smb2_util_close(tree, h1);
4589 if (!smb2_util_handle_empty(baseh)) {
4590 smb2_util_close(tree, baseh);
4592 smb2_util_unlink(tree, fname);
4593 smb2_util_rmdir(tree, BASEDIR);
4594 return ret;
4597 static bool test_create_delete_on_close_resource(struct torture_context *tctx,
4598 struct smb2_tree *tree)
4600 bool ret = true;
4601 NTSTATUS status;
4602 struct smb2_create create;
4603 struct smb2_handle h1;
4604 TALLOC_CTX *mem_ctx = talloc_new(tctx);
4605 const char *fname = BASEDIR "\\file";
4606 const char *sname = BASEDIR "\\file" AFPRESOURCE_STREAM_NAME;
4607 const char *streams_basic[] = {
4608 "::$DATA"
4610 const char *streams_afpresource[] = {
4611 "::$DATA",
4612 AFPRESOURCE_STREAM
4615 torture_assert_goto(tctx, mem_ctx != NULL, ret, done, "talloc_new");
4617 torture_comment(tctx, "Checking whether create with delete-on-close is ignored for AFP_AfpResource\n");
4619 smb2_deltree(tree, BASEDIR);
4620 status = torture_smb2_testdir(tree, BASEDIR, &h1);
4621 torture_assert_ntstatus_ok(tctx, status, "torture_smb2_testdir");
4622 smb2_util_close(tree, h1);
4623 ret = torture_setup_file(mem_ctx, tree, fname, false);
4624 torture_assert_goto(tctx, ret == true, ret, done, "torture_setup_file");
4626 torture_comment(tctx, "Opening not existing AFP_AfpResource\n");
4628 ZERO_STRUCT(create);
4629 create.in.create_disposition = NTCREATEX_DISP_OPEN;
4630 create.in.desired_access = SEC_FILE_READ_ATTRIBUTE; /* stat open */
4631 create.in.fname = sname;
4633 status = smb2_create(tree, mem_ctx, &create);
4634 torture_assert_ntstatus_equal_goto(tctx, status, NT_STATUS_OBJECT_NAME_NOT_FOUND,
4635 ret, done, "Got unexpected AFP_AfpResource stream");
4637 ZERO_STRUCT(create);
4638 create.in.create_disposition = NTCREATEX_DISP_OPEN;
4639 create.in.desired_access = SEC_FILE_ALL;
4640 create.in.fname = sname;
4642 status = smb2_create(tree, mem_ctx, &create);
4643 torture_assert_ntstatus_equal_goto(tctx, status, NT_STATUS_OBJECT_NAME_NOT_FOUND,
4644 ret, done, "Got unexpected AFP_AfpResource stream");
4646 ret = check_stream_list(tree, tctx, fname, 1, streams_basic, false);
4647 torture_assert_goto(tctx, ret == true, ret, done, "Bad streams");
4649 torture_comment(tctx, "Trying to delete AFP_AfpResource via create with delete-on-close\n");
4651 ret = write_stream(tree, __location__, tctx, mem_ctx,
4652 fname, AFPRESOURCE_STREAM_NAME,
4653 0, 10, "1234567890");
4654 torture_assert_goto(tctx, ret == true, ret, done, "Writing to AFP_AfpResource failed");
4656 ret = check_stream(tree, __location__, tctx, mem_ctx, fname, AFPRESOURCE_STREAM_NAME,
4657 0, 10, 0, 10, "1234567890");
4658 torture_assert_goto(tctx, ret == true, ret, done, "Bad content from AFP_AfpResource");
4660 ret = check_stream_list(tree, tctx, fname, 2, streams_afpresource, false);
4661 torture_assert_goto(tctx, ret == true, ret, done, "Bad streams");
4663 ZERO_STRUCT(create);
4664 create.in.create_disposition = NTCREATEX_DISP_OPEN;
4665 create.in.create_options = NTCREATEX_OPTIONS_DELETE_ON_CLOSE;
4666 create.in.desired_access = SEC_FILE_READ_ATTRIBUTE | SEC_STD_SYNCHRONIZE | SEC_STD_DELETE;
4667 create.in.impersonation_level = NTCREATEX_IMPERSONATION_IMPERSONATION;
4668 create.in.fname = sname;
4669 create.in.file_attributes = FILE_ATTRIBUTE_NORMAL;
4671 status = smb2_create(tree, mem_ctx, &create);
4672 torture_assert_ntstatus_ok_goto(tctx, status, ret, done, "smb2_create failed");
4674 h1 = create.out.file.handle;
4675 smb2_util_close(tree, h1);
4677 ret = check_stream_list(tree, tctx, fname, 2, streams_afpresource, false);
4678 torture_assert_goto(tctx, ret == true, ret, done, "Bad streams");
4680 ret = check_stream(tree, __location__, tctx, mem_ctx, fname, AFPRESOURCE_STREAM_NAME,
4681 0, 10, 0, 10, "1234567890");
4682 torture_assert_goto(tctx, ret == true, ret, done, "Bad content from AFP_AfpResource");
4684 done:
4685 smb2_util_unlink(tree, fname);
4686 smb2_util_rmdir(tree, BASEDIR);
4687 return ret;
4690 static bool test_setinfo_delete_on_close_resource(struct torture_context *tctx,
4691 struct smb2_tree *tree)
4693 bool ret = true;
4694 NTSTATUS status;
4695 struct smb2_create create;
4696 union smb_setfileinfo sfinfo;
4697 struct smb2_handle h1;
4698 TALLOC_CTX *mem_ctx = talloc_new(tctx);
4699 const char *fname = BASEDIR "\\file";
4700 const char *sname = BASEDIR "\\file" AFPRESOURCE_STREAM_NAME;
4701 const char *streams_afpresource[] = {
4702 "::$DATA",
4703 AFPRESOURCE_STREAM
4706 torture_assert_goto(tctx, mem_ctx != NULL, ret, done, "talloc_new");
4708 torture_comment(tctx, "Trying to delete AFP_AfpResource via setinfo with delete-on-close\n");
4710 smb2_deltree(tree, BASEDIR);
4711 status = torture_smb2_testdir(tree, BASEDIR, &h1);
4712 torture_assert_ntstatus_ok_goto(tctx, status, ret, done, "torture_smb2_testdir");
4713 smb2_util_close(tree, h1);
4714 ret = torture_setup_file(mem_ctx, tree, fname, false);
4715 torture_assert_goto(tctx, ret == true, ret, done, "torture_setup_file");
4717 ret = write_stream(tree, __location__, tctx, mem_ctx,
4718 fname, AFPRESOURCE_STREAM_NAME,
4719 10, 10, "1234567890");
4720 torture_assert_goto(tctx, ret == true, ret, done, "Writing to AFP_AfpResource failed");
4722 ZERO_STRUCT(create);
4723 create.in.create_disposition = NTCREATEX_DISP_OPEN;
4724 create.in.desired_access = SEC_FILE_READ_ATTRIBUTE | SEC_STD_SYNCHRONIZE | SEC_STD_DELETE;
4725 create.in.fname = sname;
4726 create.in.file_attributes = FILE_ATTRIBUTE_NORMAL;
4727 create.in.impersonation_level = NTCREATEX_IMPERSONATION_IMPERSONATION;
4729 status = smb2_create(tree, mem_ctx, &create);
4730 torture_assert_ntstatus_ok_goto(tctx, status, ret, done, "smb2_create failed");
4732 h1 = create.out.file.handle;
4734 /* Try to delete stream via setinfo delete-on-close */
4735 ZERO_STRUCT(sfinfo);
4736 sfinfo.disposition_info.in.delete_on_close = 1;
4737 sfinfo.generic.level = RAW_SFILEINFO_DISPOSITION_INFORMATION;
4738 sfinfo.generic.in.file.handle = h1;
4739 status = smb2_setinfo_file(tree, &sfinfo);
4740 torture_assert_ntstatus_ok_goto(tctx, status, ret, done, "set delete-on-close failed");
4742 smb2_util_close(tree, h1);
4744 ret = check_stream_list(tree, tctx, fname, 2, streams_afpresource, false);
4745 torture_assert_goto(tctx, ret == true, ret, done, "Bad streams");
4747 ZERO_STRUCT(create);
4748 create.in.create_disposition = NTCREATEX_DISP_OPEN;
4749 create.in.desired_access = SEC_FILE_ALL;
4750 create.in.fname = sname;
4751 create.in.file_attributes = FILE_ATTRIBUTE_NORMAL;
4752 create.in.impersonation_level = NTCREATEX_IMPERSONATION_IMPERSONATION;
4753 status = smb2_create(tree, mem_ctx, &create);
4754 torture_assert_ntstatus_ok_goto(tctx, status, ret, done,
4755 "Got unexpected AFP_AfpResource stream");
4757 done:
4758 smb2_util_unlink(tree, fname);
4759 smb2_util_rmdir(tree, BASEDIR);
4760 return ret;
4763 static bool test_setinfo_eof_resource(struct torture_context *tctx,
4764 struct smb2_tree *tree)
4766 bool ret = true;
4767 NTSTATUS status;
4768 struct smb2_create create;
4769 union smb_setfileinfo sfinfo;
4770 union smb_fileinfo finfo;
4771 struct smb2_handle h1;
4772 TALLOC_CTX *mem_ctx = talloc_new(tctx);
4773 const char *fname = BASEDIR "\\file";
4774 const char *sname = BASEDIR "\\file" AFPRESOURCE_STREAM_NAME;
4775 const char *streams_basic[] = {
4776 "::$DATA"
4779 torture_assert_goto(tctx, mem_ctx != NULL, ret, done, "talloc_new");
4781 ret = enable_aapl(tctx, tree);
4782 torture_assert_goto(tctx, ret == true, ret, done, "enable_aapl failed");
4784 torture_comment(tctx, "Set AFP_AfpResource EOF to 1 and 0\n");
4786 smb2_deltree(tree, BASEDIR);
4787 status = torture_smb2_testdir(tree, BASEDIR, &h1);
4788 torture_assert_ntstatus_ok_goto(tctx, status, ret, done, "torture_smb2_testdir");
4789 smb2_util_close(tree, h1);
4790 ret = torture_setup_file(mem_ctx, tree, fname, false);
4791 torture_assert_goto(tctx, ret == true, ret, done, "torture_setup_file");
4793 ret = write_stream(tree, __location__, tctx, mem_ctx,
4794 fname, AFPRESOURCE_STREAM_NAME,
4795 10, 10, "1234567890");
4796 torture_assert_goto(tctx, ret == true, ret, done, "Writing to AFP_AfpResource failed");
4798 ZERO_STRUCT(create);
4799 create.in.create_disposition = NTCREATEX_DISP_OPEN;
4800 create.in.desired_access = SEC_FILE_ALL;
4801 create.in.fname = sname;
4802 create.in.file_attributes = FILE_ATTRIBUTE_NORMAL;
4803 create.in.impersonation_level = NTCREATEX_IMPERSONATION_IMPERSONATION;
4805 status = smb2_create(tree, mem_ctx, &create);
4806 torture_assert_ntstatus_ok_goto(tctx, status, ret, done, "smb2_create failed");
4808 h1 = create.out.file.handle;
4810 torture_comment(tctx, "Set AFP_AfpResource EOF to 1\n");
4812 /* Test setinfo end-of-file info */
4813 ZERO_STRUCT(sfinfo);
4814 sfinfo.generic.in.file.handle = h1;
4815 sfinfo.generic.level = RAW_SFILEINFO_END_OF_FILE_INFORMATION;
4816 sfinfo.position_information.in.position = 1;
4817 status = smb2_setinfo_file(tree, &sfinfo);
4818 torture_assert_ntstatus_ok_goto(tctx, status,
4819 ret, done, "set eof 1 failed");
4821 smb2_util_close(tree, h1);
4823 /* Check size == 1 */
4824 ZERO_STRUCT(create);
4825 create.in.fname = sname;
4826 create.in.create_disposition = NTCREATEX_DISP_OPEN;
4827 create.in.desired_access = SEC_FILE_ALL;
4828 create.in.file_attributes = FILE_ATTRIBUTE_NORMAL;
4829 create.in.impersonation_level = NTCREATEX_IMPERSONATION_IMPERSONATION;
4830 status = smb2_create(tree, mem_ctx, &create);
4831 torture_assert_ntstatus_ok_goto(tctx, status, ret, done, "smb2_create failed");
4833 h1 = create.out.file.handle;
4835 ZERO_STRUCT(finfo);
4836 finfo.generic.level = RAW_FILEINFO_SMB2_ALL_INFORMATION;
4837 finfo.generic.in.file.handle = h1;
4838 status = smb2_getinfo_file(tree, mem_ctx, &finfo);
4839 torture_assert_ntstatus_ok_goto(tctx, status, ret, done, "smb2_getinfo_file failed");
4841 smb2_util_close(tree, h1);
4843 torture_assert_goto(tctx, finfo.all_info.out.size == 1, ret, done, "size != 1");
4845 ZERO_STRUCT(create);
4846 create.in.create_disposition = NTCREATEX_DISP_OPEN;
4847 create.in.desired_access = SEC_FILE_ALL;
4848 create.in.fname = sname;
4849 create.in.file_attributes = FILE_ATTRIBUTE_NORMAL;
4850 create.in.impersonation_level = NTCREATEX_IMPERSONATION_IMPERSONATION;
4852 status = smb2_create(tree, mem_ctx, &create);
4853 torture_assert_ntstatus_ok_goto(tctx, status, ret, done, "smb2_create failed");
4855 h1 = create.out.file.handle;
4858 * Delete stream via setinfo end-of-file info to 0, this
4859 * should delete the stream.
4861 ZERO_STRUCT(sfinfo);
4862 sfinfo.generic.in.file.handle = h1;
4863 sfinfo.generic.level = RAW_SFILEINFO_END_OF_FILE_INFORMATION;
4864 sfinfo.position_information.in.position = 0;
4865 status = smb2_setinfo_file(tree, &sfinfo);
4866 torture_assert_ntstatus_ok_goto(tctx, status, ret, done, "set eof 0 failed");
4868 smb2_util_close(tree, h1);
4870 ret = check_stream_list(tree, tctx, fname, 1, streams_basic, false);
4871 torture_assert_goto(tctx, ret == true, ret, done, "Bad streams");
4873 ZERO_STRUCT(create);
4874 create.in.create_disposition = NTCREATEX_DISP_OPEN;
4875 create.in.desired_access = SEC_FILE_ALL;
4876 create.in.fname = sname;
4877 create.in.file_attributes = FILE_ATTRIBUTE_NORMAL;
4878 create.in.impersonation_level = NTCREATEX_IMPERSONATION_IMPERSONATION;
4880 status = smb2_create(tree, mem_ctx, &create);
4881 torture_assert_ntstatus_equal_goto(tctx, status, NT_STATUS_OBJECT_NAME_NOT_FOUND,
4882 ret, done, "smb2_create failed");
4884 done:
4885 smb2_util_unlink(tree, fname);
4886 smb2_util_rmdir(tree, BASEDIR);
4887 return ret;
4891 * This tests that right after creating the AFP_AfpInfo stream,
4892 * reading from the stream returns an empty, default metadata blob of
4893 * 60 bytes.
4895 * NOTE: against OS X SMB server this only works if the read request
4896 * is compounded with the create that created the stream, is fails
4897 * otherwise. We don't care...
4899 static bool test_null_afpinfo(struct torture_context *tctx,
4900 struct smb2_tree *tree)
4902 TALLOC_CTX *mem_ctx = talloc_new(tctx);
4903 const char *fname = "test_null_afpinfo";
4904 const char *sname = "test_null_afpinfo" AFPINFO_STREAM_NAME;
4905 NTSTATUS status;
4906 bool ret = true;
4907 struct smb2_request *req[3];
4908 struct smb2_handle handle;
4909 struct smb2_create create;
4910 struct smb2_read read;
4911 AfpInfo *afpinfo = NULL;
4912 char *afpinfo_buf = NULL;
4913 const char *type_creator = "SMB,OLE!";
4914 struct smb2_handle handle2;
4915 struct smb2_read r;
4917 torture_comment(tctx, "Checking create of AfpInfo stream\n");
4919 smb2_util_unlink(tree, fname);
4921 ret = torture_setup_file(mem_ctx, tree, fname, false);
4922 torture_assert_goto(tctx, ret == true, ret, done, "torture_setup_file failed");
4924 ZERO_STRUCT(create);
4925 create.in.desired_access = SEC_FILE_READ_DATA|SEC_FILE_WRITE_DATA;
4926 create.in.share_access = FILE_SHARE_READ | FILE_SHARE_DELETE;
4927 create.in.file_attributes = FILE_ATTRIBUTE_NORMAL;
4928 create.in.impersonation_level = SMB2_IMPERSONATION_IMPERSONATION;
4929 create.in.create_disposition = NTCREATEX_DISP_OPEN_IF;
4930 create.in.fname = sname;
4932 smb2_transport_compound_start(tree->session->transport, 2);
4934 req[0] = smb2_create_send(tree, &create);
4936 handle.data[0] = UINT64_MAX;
4937 handle.data[1] = UINT64_MAX;
4939 smb2_transport_compound_set_related(tree->session->transport, true);
4941 ZERO_STRUCT(read);
4942 read.in.file.handle = handle;
4943 read.in.length = AFP_INFO_SIZE;
4944 req[1] = smb2_read_send(tree, &read);
4946 status = smb2_create_recv(req[0], tree, &create);
4947 torture_assert_ntstatus_ok_goto(tctx, status, ret, done, "smb2_create_recv failed");
4949 handle = create.out.file.handle;
4951 status = smb2_read_recv(req[1], tree, &read);
4952 torture_assert_ntstatus_ok_goto(tctx, status, ret, done, "smb2_read_recv failed");
4954 status = torture_smb2_testfile_access(tree, sname, &handle2,
4955 SEC_FILE_READ_DATA);
4956 torture_assert_ntstatus_ok_goto(tctx, status, ret, done,
4957 "torture_smb2_testfile failed\n");
4958 r = (struct smb2_read) {
4959 .in.file.handle = handle2,
4960 .in.length = AFP_INFO_SIZE,
4963 status = smb2_read(tree, tree, &r);
4964 torture_assert_ntstatus_ok_goto(tctx, status, ret, done,
4965 "torture_smb2_testfile failed\n");
4966 smb2_util_close(tree, handle2);
4968 afpinfo = torture_afpinfo_new(mem_ctx);
4969 torture_assert_goto(tctx, afpinfo != NULL, ret, done, "torture_afpinfo_new failed");
4971 memcpy(afpinfo->afpi_FinderInfo, type_creator, 8);
4973 afpinfo_buf = torture_afpinfo_pack(tctx, afpinfo);
4974 torture_assert_goto(tctx, afpinfo_buf != NULL, ret, done, "torture_afpinfo_new failed");
4976 status = smb2_util_write(tree, handle, afpinfo_buf, 0, AFP_INFO_SIZE);
4977 torture_assert_ntstatus_ok_goto(tctx, status, ret, done, "smb2_util_write failed");
4979 smb2_util_close(tree, handle);
4981 ret = check_stream(tree, __location__, tctx, mem_ctx, fname, AFPINFO_STREAM,
4982 0, 60, 16, 8, type_creator);
4983 torture_assert_goto(tctx, ret == true, ret, done, "check_stream failed");
4985 done:
4986 smb2_util_unlink(tree, fname);
4987 talloc_free(mem_ctx);
4988 return ret;
4991 static bool test_delete_file_with_rfork(struct torture_context *tctx,
4992 struct smb2_tree *tree)
4994 const char *fname = "torture_write_rfork_io";
4995 const char *rfork_content = "1234567890";
4996 NTSTATUS status;
4997 bool ret = true;
4999 smb2_util_unlink(tree, fname);
5001 torture_comment(tctx, "Test deleting file with resource fork\n");
5003 ret = torture_setup_file(tctx, tree, fname, false);
5004 torture_assert_goto(tctx, ret == true, ret, done, "torture_setup_file failed\n");
5006 ret = write_stream(tree, __location__, tctx, tctx,
5007 fname, AFPRESOURCE_STREAM_NAME,
5008 10, 10, rfork_content);
5009 torture_assert_goto(tctx, ret == true, ret, done, "write_stream failed\n");
5011 ret = check_stream(tree, __location__, tctx, tctx,
5012 fname, AFPRESOURCE_STREAM_NAME,
5013 0, 20, 10, 10, rfork_content);
5014 torture_assert_goto(tctx, ret == true, ret, done, "check_stream failed\n");
5016 status = smb2_util_unlink(tree, fname);
5017 torture_assert_ntstatus_ok_goto(tctx, status, ret, done, "check_stream failed\n");
5019 done:
5020 return ret;
5023 static bool test_rename_and_read_rsrc(struct torture_context *tctx,
5024 struct smb2_tree *tree)
5026 bool ret = true;
5027 NTSTATUS status;
5028 struct smb2_create create, create2;
5029 struct smb2_handle h1, h2;
5030 const char *fname = "test_rename_openfile";
5031 const char *sname = "test_rename_openfile" AFPRESOURCE_STREAM_NAME;
5032 const char *fname_renamed = "test_rename_openfile_renamed";
5033 const char *data = "1234567890";
5034 union smb_setfileinfo sinfo;
5035 bool server_is_macos = torture_setting_bool(tctx, "osx", false);
5036 NTSTATUS expected_status;
5038 ret = enable_aapl(tctx, tree);
5039 torture_assert_goto(tctx, ret == true, ret, done, "enable_aapl failed");
5041 torture_comment(tctx, "Create file with resource fork\n");
5043 ret = torture_setup_file(tctx, tree, fname, false);
5044 torture_assert_goto(tctx, ret == true, ret, done, "torture_setup_file");
5046 ret = write_stream(tree, __location__, tctx, tctx,
5047 fname, AFPRESOURCE_STREAM_NAME, 0, 10, data);
5048 torture_assert_goto(tctx, ret == true, ret, done, "write_stream failed");
5050 torture_comment(tctx, "Open resource fork\n");
5052 ZERO_STRUCT(create);
5053 create.in.desired_access = SEC_FILE_ALL;
5054 create.in.share_access = NTCREATEX_SHARE_ACCESS_MASK;
5055 create.in.file_attributes = FILE_ATTRIBUTE_NORMAL;
5056 create.in.create_disposition = NTCREATEX_DISP_OPEN;
5057 create.in.impersonation_level = SMB2_IMPERSONATION_IMPERSONATION;
5058 create.in.fname = sname;
5060 status = smb2_create(tree, tctx, &create);
5061 torture_assert_ntstatus_ok_goto(tctx, status, ret, done, "smb2_create failed");
5063 h1 = create.out.file.handle;
5065 torture_comment(tctx, "Rename base file\n");
5067 ZERO_STRUCT(create2);
5068 create2.in.desired_access = SEC_FILE_ALL;
5069 create2.in.file_attributes = FILE_ATTRIBUTE_NORMAL;
5070 create2.in.share_access = NTCREATEX_SHARE_ACCESS_MASK;
5071 create2.in.create_disposition = NTCREATEX_DISP_OPEN;
5072 create2.in.impersonation_level = SMB2_IMPERSONATION_IMPERSONATION;
5073 create2.in.fname = fname;
5075 status = smb2_create(tree, tctx, &create2);
5076 torture_assert_ntstatus_ok_goto(tctx, status, ret, done, "smb2_create failed");
5078 h2 = create2.out.file.handle;
5080 ZERO_STRUCT(sinfo);
5081 sinfo.rename_information.level = RAW_SFILEINFO_RENAME_INFORMATION;
5082 sinfo.rename_information.in.file.handle = h2;
5083 sinfo.rename_information.in.overwrite = 0;
5084 sinfo.rename_information.in.root_fid = 0;
5085 sinfo.rename_information.in.new_name = fname_renamed;
5087 if (server_is_macos) {
5088 expected_status = NT_STATUS_SHARING_VIOLATION;
5089 } else {
5090 expected_status = NT_STATUS_ACCESS_DENIED;
5093 status = smb2_setinfo_file(tree, &sinfo);
5094 torture_assert_ntstatus_equal_goto(
5095 tctx, status, expected_status, ret, done,
5096 "smb2_setinfo_file failed");
5098 smb2_util_close(tree, h2);
5100 status = smb2_util_write(tree, h1, "foo", 0, 3);
5101 torture_assert_ntstatus_ok_goto(tctx, status, ret, done,
5102 "write failed\n");
5104 smb2_util_close(tree, h1);
5106 done:
5107 smb2_util_unlink(tree, fname);
5108 smb2_util_unlink(tree, fname_renamed);
5110 return ret;
5113 static bool test_readdir_attr_illegal_ntfs(struct torture_context *tctx,
5114 struct smb2_tree *tree)
5116 TALLOC_CTX *mem_ctx = talloc_new(tctx);
5117 const char *name = "test" "\xef\x80\xa2" "aapl"; /* "test:aapl" */
5118 const char *fname = BASEDIR "\\test" "\xef\x80\xa2" "aapl"; /* "test:aapl" */
5119 NTSTATUS status;
5120 struct smb2_handle testdirh;
5121 bool ret = true;
5122 struct smb2_create io;
5123 AfpInfo *info;
5124 const char *type_creator = "SMB,OLE!";
5125 struct smb2_find f;
5126 unsigned int count;
5127 union smb_search_data *d;
5128 uint64_t rfork_len;
5129 unsigned int i;
5131 smb2_deltree(tree, BASEDIR);
5133 status = torture_smb2_testdir(tree, BASEDIR, &testdirh);
5134 torture_assert_ntstatus_ok_goto(tctx, status, ret, done, "torture_smb2_testdir failed");
5135 smb2_util_close(tree, testdirh);
5137 torture_comment(tctx, "Enabling AAPL\n");
5139 ret = enable_aapl(tctx, tree);
5140 torture_assert_goto(tctx, ret == true, ret, done, "enable_aapl failed");
5143 * Now that Requested AAPL extensions are enabled, setup some
5144 * Mac files with metadata and resource fork
5147 torture_comment(tctx, "Preparing file\n");
5149 ret = torture_setup_file(mem_ctx, tree, fname, false);
5150 torture_assert_goto(tctx, ret == true, ret, done, "torture_setup_file failed");
5152 info = torture_afpinfo_new(mem_ctx);
5153 torture_assert_not_null_goto(tctx, info, ret, done, "torture_afpinfo_new failed");
5155 memcpy(info->afpi_FinderInfo, type_creator, 8);
5156 ret = torture_write_afpinfo(tree, tctx, mem_ctx, fname, info);
5157 torture_assert_goto(tctx, ret == true, ret, done, "torture_write_afpinfo failed");
5159 ret = write_stream(tree, __location__, tctx, mem_ctx,
5160 fname, AFPRESOURCE_STREAM_NAME,
5161 0, 3, "foo");
5162 torture_assert_goto(tctx, ret == true, ret, done, "write_stream failed");
5165 * Ok, file is prepared, now call smb2/find
5168 torture_comment(tctx, "Issue find\n");
5170 ZERO_STRUCT(io);
5171 io.in.desired_access = SEC_RIGHTS_DIR_READ;
5172 io.in.create_options = NTCREATEX_OPTIONS_DIRECTORY;
5173 io.in.file_attributes = FILE_ATTRIBUTE_DIRECTORY;
5174 io.in.share_access = (NTCREATEX_SHARE_ACCESS_READ |
5175 NTCREATEX_SHARE_ACCESS_WRITE |
5176 NTCREATEX_SHARE_ACCESS_DELETE);
5177 io.in.create_disposition = NTCREATEX_DISP_OPEN;
5178 io.in.fname = BASEDIR;
5179 status = smb2_create(tree, tctx, &io);
5180 torture_assert_ntstatus_ok_goto(tctx, status, ret, done, "smb2_create failed");
5182 ZERO_STRUCT(f);
5183 f.in.file.handle = io.out.file.handle;
5184 f.in.pattern = "*";
5185 f.in.max_response_size = 0x1000;
5186 f.in.level = SMB2_FIND_ID_BOTH_DIRECTORY_INFO;
5188 status = smb2_find_level(tree, tree, &f, &count, &d);
5189 torture_assert_ntstatus_ok_goto(tctx, status, ret, done, "smb2_find_level failed");
5191 status = smb2_util_close(tree, io.out.file.handle);
5192 torture_assert_ntstatus_ok_goto(tctx, status, ret, done, "smb2_util_close failed");
5194 torture_comment(tctx, "Checking find response with enriched macOS metadata\n");
5196 for (i = 0; i < count; i++) {
5197 const char *found = d[i].id_both_directory_info.name.s;
5199 if (!strcmp(found, ".") || !strcmp(found, ".."))
5200 continue;
5201 if (strncmp(found, "._", 2) == 0) {
5202 continue;
5204 break;
5207 torture_assert_str_equal_goto(tctx,
5208 d[i].id_both_directory_info.name.s, name,
5209 ret, done, "bad name");
5211 rfork_len = BVAL(d[i].id_both_directory_info.short_name_buf, 0);
5212 torture_assert_int_equal_goto(tctx, rfork_len, 3, ret, done, "bad resource fork length");
5214 torture_assert_mem_equal_goto(tctx, type_creator,
5215 d[i].id_both_directory_info.short_name_buf + 8,
5216 8, ret, done, "Bad FinderInfo");
5217 done:
5218 smb2_util_unlink(tree, fname);
5219 smb2_deltree(tree, BASEDIR);
5220 talloc_free(mem_ctx);
5221 return ret;
5224 static bool test_invalid_afpinfo(struct torture_context *tctx,
5225 struct smb2_tree *tree1,
5226 struct smb2_tree *tree2)
5228 const char *fname = "filtest_invalid_afpinfo";
5229 const char *sname = "filtest_invalid_afpinfo" AFPINFO_STREAM_NAME;
5230 struct smb2_create create;
5231 const char *streams_basic[] = {
5232 "::$DATA"
5234 const char *streams_afpinfo[] = {
5235 "::$DATA",
5236 AFPINFO_STREAM
5238 NTSTATUS status;
5239 bool ret = true;
5241 if (tree2 == NULL) {
5242 torture_skip_goto(tctx, done, "need second share without fruit\n");
5245 torture_comment(tctx, "Testing invalid AFP_AfpInfo stream\n");
5247 ret = torture_setup_file(tctx, tree2, fname, false);
5248 torture_assert_goto(tctx, ret == true, ret, done, "torture_setup_file");
5250 ret = write_stream(tree2, __location__, tctx, tctx,
5251 fname, AFPINFO_STREAM_NAME,
5252 0, 3, "foo");
5253 torture_assert_goto(tctx, ret == true, ret, done, "write_stream failed");
5255 ret = check_stream_list(tree2, tctx, fname, 2, streams_afpinfo, false);
5256 torture_assert_goto(tctx, ret == true, ret, done, "Bad streams");
5258 torture_comment(tctx, "Listing streams, bad AFPINFO stream must not be present\n");
5260 ret = check_stream_list(tree1, tctx, fname, 1, streams_basic, false);
5261 torture_assert_goto(tctx, ret == true, ret, done, "Bad streams");
5263 torture_comment(tctx, "Try to open AFPINFO stream, must fail\n");
5265 ZERO_STRUCT(create);
5266 create.in.desired_access = SEC_FILE_ALL;
5267 create.in.share_access = NTCREATEX_SHARE_ACCESS_MASK;
5268 create.in.file_attributes = FILE_ATTRIBUTE_NORMAL;
5269 create.in.create_disposition = NTCREATEX_DISP_OPEN;
5270 create.in.impersonation_level = SMB2_IMPERSONATION_IMPERSONATION;
5271 create.in.fname = sname;
5273 status = smb2_create(tree1, tctx, &create);
5274 torture_assert_ntstatus_equal_goto(tctx, status, NT_STATUS_OBJECT_NAME_NOT_FOUND,
5275 ret, done, "Stream still around?");
5277 done:
5278 smb2_util_unlink(tree1, fname);
5279 return ret;
5282 static bool test_writing_afpinfo(struct torture_context *tctx,
5283 struct smb2_tree *tree)
5285 const char *fname = "filtest_invalid_afpinfo";
5286 const char *sname = "filtest_invalid_afpinfo" AFPINFO_STREAM;
5287 const char *streams_afpinfo[] = {
5288 "::$DATA",
5289 AFPINFO_STREAM
5291 bool ret = true;
5292 static AfpInfo *afpi = NULL;
5293 char *buf = NULL;
5294 char *afpi_buf = NULL;
5295 char *zero_buf = NULL;
5296 bool broken_osx = torture_setting_bool(tctx, "broken_osx_45759458", false);
5297 off_t min_offset_for_2streams = 16;
5298 int i;
5299 NTSTATUS status;
5300 struct test_sizes {
5301 off_t offset;
5302 size_t size;
5303 bool expected_result;
5304 } test_sizes[] = {
5305 { 0, 1, false},
5306 { 0, 2, false},
5307 { 0, 3, true},
5308 { 0, 4, true},
5309 { 0, 14, true},
5310 { 0, 15, true},
5311 { 0, 16, true},
5312 { 0, 24, true},
5313 { 0, 34, true},
5314 { 0, 44, true},
5315 { 0, 54, true},
5316 { 0, 55, true},
5317 { 0, 56, true},
5318 { 0, 57, true},
5319 { 0, 58, true},
5320 { 0, 59, true},
5321 { 0, 60, true},
5322 { 0, 61, true},
5323 { 0, 64, true},
5324 { 0, 1024, true},
5325 { 0, 10064, true},
5327 { 1, 1, false},
5328 { 1, 2, false},
5329 { 1, 3, false},
5330 { 1, 4, false},
5331 { 1, 14, false},
5332 { 1, 15, false},
5333 { 1, 16, false},
5334 { 1, 24, false},
5335 { 1, 34, false},
5336 { 1, 44, false},
5337 { 1, 54, false},
5338 { 1, 55, false},
5339 { 1, 56, false},
5340 { 1, 57, false},
5341 { 1, 58, false},
5342 { 1, 59, false},
5343 { 1, 60, true},
5344 { 1, 61, true},
5345 { 1, 1024, true},
5346 { 1, 10064, true},
5348 { 30, 1, false},
5349 { 30, 2, false},
5350 { 30, 3, false},
5351 { 30, 4, false},
5352 { 30, 14, false},
5353 { 30, 15, false},
5354 { 30, 16, false},
5355 { 30, 24, false},
5356 { 30, 34, false},
5357 { 30, 44, false},
5358 { 30, 54, false},
5359 { 30, 55, false},
5360 { 30, 56, false},
5361 { 30, 57, false},
5362 { 30, 58, false},
5363 { 30, 59, false},
5364 { 30, 60, true},
5365 { 30, 61, true},
5366 { 30, 1024, true},
5367 { 30, 10064, true},
5369 { 58, 1, false},
5370 { 58, 2, false},
5371 { 58, 3, false},
5372 { 58, 4, false},
5373 { 58, 14, false},
5374 { 58, 15, false},
5375 { 58, 16, false},
5376 { 58, 24, false},
5377 { 58, 34, false},
5378 { 58, 44, false},
5379 { 58, 54, false},
5380 { 58, 55, false},
5381 { 58, 56, false},
5382 { 58, 57, false},
5383 { 58, 58, false},
5384 { 58, 59, false},
5385 { 58, 60, true},
5386 { 58, 61, true},
5387 { 58, 1024, true},
5388 { 58, 10064, true},
5390 { 59, 1, false},
5391 { 59, 2, false},
5392 { 59, 3, false},
5393 { 59, 4, false},
5394 { 59, 14, false},
5395 { 59, 15, false},
5396 { 59, 16, false},
5397 { 59, 24, false},
5398 { 59, 34, false},
5399 { 59, 44, false},
5400 { 59, 54, false},
5401 { 59, 55, false},
5402 { 59, 56, false},
5403 { 59, 57, false},
5404 { 59, 58, false},
5405 { 59, 59, false},
5406 { 59, 60, true},
5407 { 59, 61, true},
5408 { 59, 1024, true},
5409 { 59, 10064, true},
5411 { 60, 1, false},
5412 { 60, 2, false},
5413 { 60, 3, false},
5414 { 60, 4, false},
5415 { 60, 14, false},
5416 { 60, 15, false},
5417 { 60, 16, false},
5418 { 60, 24, false},
5419 { 60, 34, false},
5420 { 60, 44, false},
5421 { 60, 54, false},
5422 { 60, 55, false},
5423 { 60, 56, false},
5424 { 60, 57, false},
5425 { 60, 58, false},
5426 { 60, 59, false},
5427 { 60, 60, true},
5428 { 60, 61, true},
5429 { 60, 1024, true},
5430 { 60, 10064, true},
5432 { 61, 1, false},
5433 { 61, 2, false},
5434 { 61, 3, false},
5435 { 61, 4, false},
5436 { 61, 14, false},
5437 { 61, 15, false},
5438 { 61, 16, false},
5439 { 61, 24, false},
5440 { 61, 34, false},
5441 { 61, 44, false},
5442 { 61, 54, false},
5443 { 61, 55, false},
5444 { 61, 56, false},
5445 { 61, 57, false},
5446 { 61, 58, false},
5447 { 61, 59, false},
5448 { 61, 60, true},
5449 { 61, 61, true},
5450 { 61, 1024, true},
5451 { 61, 10064, true},
5453 { 10000, 1, false},
5454 { 10000, 2, false},
5455 { 10000, 3, false},
5456 { 10000, 4, false},
5457 { 10000, 14, false},
5458 { 10000, 15, false},
5459 { 10000, 16, false},
5460 { 10000, 24, false},
5461 { 10000, 34, false},
5462 { 10000, 44, false},
5463 { 10000, 54, false},
5464 { 10000, 55, false},
5465 { 10000, 56, false},
5466 { 10000, 57, false},
5467 { 10000, 58, false},
5468 { 10000, 59, false},
5469 { 10000, 60, true},
5470 { 10000, 61, true},
5471 { 10000, 1024, true},
5472 { 10000, 10064, true},
5474 { -1, 0, false},
5477 afpi = torture_afpinfo_new(tctx);
5478 torture_assert_not_null_goto(tctx, afpi, ret, done,
5479 "torture_afpinfo_new failed\n");
5481 memcpy(afpi->afpi_FinderInfo, "FOO BAR ", 8);
5483 buf = torture_afpinfo_pack(afpi, afpi);
5484 torture_assert_not_null_goto(tctx, buf, ret, done,
5485 "torture_afpinfo_pack failed\n");
5487 afpi_buf = talloc_zero_array(tctx, char, 10064);
5488 torture_assert_not_null_goto(tctx, afpi_buf, ret, done,
5489 "talloc_zero_array failed\n");
5490 memcpy(afpi_buf, buf, 60);
5492 zero_buf = talloc_zero_array(tctx, char, 10064);
5493 torture_assert_not_null_goto(tctx, zero_buf, ret, done,
5494 "talloc_zero_array failed\n");
5496 ret = torture_setup_file(tctx, tree, fname, false);
5497 torture_assert_goto(tctx, ret == true, ret, done,
5498 "torture_setup_file\n");
5500 for (i = 0; test_sizes[i].offset != -1; i++) {
5501 struct smb2_handle h;
5502 struct smb2_create c;
5503 int expected_num_streams;
5504 size_t fi_check_size;
5506 torture_comment(tctx,
5507 "Test %d: offset=%jd size=%zu result=%s\n",
5509 (intmax_t)test_sizes[i].offset,
5510 test_sizes[i].size,
5511 test_sizes[i].expected_result ? "true":"false");
5514 c = (struct smb2_create) {
5515 .in.desired_access = SEC_FILE_WRITE_DATA,
5516 .in.file_attributes = FILE_ATTRIBUTE_NORMAL,
5517 .in.create_disposition = NTCREATEX_DISP_OPEN_IF,
5518 .in.fname = sname,
5521 status = smb2_create(tree, tree, &c);
5522 torture_assert_ntstatus_ok_goto(tctx, status, ret, done,
5523 "smb2_create\n");
5524 h = c.out.file.handle;
5526 status = smb2_util_write(tree,
5528 zero_buf,
5529 test_sizes[i].offset,
5530 test_sizes[i].size);
5531 torture_assert_ntstatus_equal_goto(
5532 tctx, status, NT_STATUS_INVALID_PARAMETER,
5533 ret, done, "smb2_util_write\n");
5535 status = smb2_util_write(tree,
5537 afpi_buf,
5538 test_sizes[i].offset,
5539 test_sizes[i].size);
5540 smb2_util_close(tree, h);
5541 if (test_sizes[i].expected_result == true) {
5542 torture_assert_ntstatus_ok_goto(tctx, status, ret, done,
5543 "smb2_util_write\n");
5544 } else {
5545 torture_assert_ntstatus_equal_goto(
5546 tctx, status, NT_STATUS_INVALID_PARAMETER,
5547 ret, done, "smb2_util_write\n");
5550 if (broken_osx) {
5552 * Currently macOS has a bug (Radar #45759458) where it
5553 * writes more bytes then requested from uninitialized
5554 * memory to the filesystem. That means it will likely
5555 * write data to FinderInfo so the stream is not empty
5556 * and thus listed when the number of streams is
5557 * queried.
5559 min_offset_for_2streams = 2;
5562 if ((test_sizes[i].expected_result == true) &&
5563 (test_sizes[i].size > min_offset_for_2streams))
5565 expected_num_streams = 2;
5566 } else {
5567 expected_num_streams = 1;
5570 ret = check_stream_list(tree, tctx, fname,
5571 expected_num_streams,
5572 streams_afpinfo, false);
5573 torture_assert_goto(tctx, ret == true, ret, done,
5574 "Bad streams\n");
5576 if (test_sizes[i].expected_result == false) {
5577 continue;
5580 if (test_sizes[i].size <= 16) {
5582 * FinderInfo with the "FOO BAR " string we wrote above
5583 * would start at offset 16. Check whether this test
5584 * wrote 1 byte or more.
5586 goto next;
5589 fi_check_size = test_sizes[i].size - 16;
5590 fi_check_size = MIN(fi_check_size, 8);
5592 ret = check_stream(tree, __location__,
5593 tctx, tctx,
5594 fname, AFPINFO_STREAM,
5595 0, 60, 16, fi_check_size, "FOO BAR ");
5596 torture_assert_goto(tctx, ret == true, ret, done,
5597 "Bad streams\n");
5599 next:
5600 status = smb2_util_unlink(tree, sname);
5601 if (NT_STATUS_EQUAL(status, NT_STATUS_OBJECT_NAME_NOT_FOUND)) {
5602 bool missing_ok;
5604 missing_ok = test_sizes[i].expected_result == false;
5605 missing_ok |= test_sizes[i].size <= 16;
5607 torture_assert_goto(tctx, missing_ok,
5608 ret, done, "smb2_util_unlink\n");
5612 done:
5613 smb2_util_unlink(tree, fname);
5614 return ret;
5617 static bool test_zero_file_id(struct torture_context *tctx,
5618 struct smb2_tree *tree)
5620 const char *fname = "filtest_file_id";
5621 struct smb2_create create = {0};
5622 NTSTATUS status;
5623 bool ret = true;
5624 uint8_t zero_file_id[8] = {0};
5626 torture_comment(tctx, "Testing zero file id\n");
5628 ret = torture_setup_file(tctx, tree, fname, false);
5629 torture_assert_goto(tctx, ret == true, ret, done, "torture_setup_file");
5631 ZERO_STRUCT(create);
5632 create.in.desired_access = SEC_FILE_READ_ATTRIBUTE;
5633 create.in.share_access = NTCREATEX_SHARE_ACCESS_MASK;
5634 create.in.file_attributes = FILE_ATTRIBUTE_NORMAL;
5635 create.in.create_disposition = NTCREATEX_DISP_OPEN;
5636 create.in.fname = fname;
5637 create.in.query_on_disk_id = true;
5639 status = smb2_create(tree, tctx, &create);
5640 torture_assert_ntstatus_equal_goto(tctx, status, NT_STATUS_OK, ret,
5641 done,
5642 "test file could not be opened");
5643 torture_assert_mem_not_equal_goto(tctx, create.out.on_disk_id,
5644 zero_file_id, 8, ret, done,
5645 "unexpected zero file id");
5647 smb2_util_close(tree, create.out.file.handle);
5649 ret = enable_aapl(tctx, tree);
5650 torture_assert(tctx, ret == true, "enable_aapl failed");
5652 ZERO_STRUCT(create);
5653 create.in.desired_access = SEC_FILE_READ_ATTRIBUTE;
5654 create.in.share_access = NTCREATEX_SHARE_ACCESS_MASK;
5655 create.in.file_attributes = FILE_ATTRIBUTE_NORMAL;
5656 create.in.create_disposition = NTCREATEX_DISP_OPEN;
5657 create.in.fname = fname;
5658 create.in.query_on_disk_id = true;
5660 status = smb2_create(tree, tctx, &create);
5661 torture_assert_ntstatus_equal_goto(
5662 tctx, status, NT_STATUS_OK, ret, done,
5663 "test file could not be opened with AAPL");
5664 torture_assert_mem_equal_goto(tctx, create.out.on_disk_id, zero_file_id,
5665 8, ret, done, "non-zero file id");
5667 smb2_util_close(tree, create.out.file.handle);
5669 done:
5670 smb2_util_unlink(tree, fname);
5671 return ret;
5674 static bool copy_one_stream(struct torture_context *torture,
5675 struct smb2_tree *tree,
5676 TALLOC_CTX *tmp_ctx,
5677 const char *src_sname,
5678 const char *dst_sname)
5680 struct smb2_handle src_h = {{0}};
5681 struct smb2_handle dest_h = {{0}};
5682 NTSTATUS status;
5683 union smb_ioctl io;
5684 struct srv_copychunk_copy cc_copy;
5685 struct srv_copychunk_rsp cc_rsp;
5686 enum ndr_err_code ndr_ret;
5687 bool ok = false;
5689 ok = test_setup_copy_chunk(torture, tree, tmp_ctx,
5690 1, /* 1 chunk */
5691 src_sname,
5692 &src_h, 256, /* fill 256 byte src file */
5693 SEC_FILE_READ_DATA | SEC_FILE_WRITE_DATA,
5694 dst_sname,
5695 &dest_h, 0, /* 0 byte dest file */
5696 SEC_FILE_READ_DATA | SEC_FILE_WRITE_DATA,
5697 &cc_copy,
5698 &io);
5699 torture_assert_goto(torture, ok == true, ok, done,
5700 "setup copy chunk error\n");
5702 /* copy all src file data (via a single chunk desc) */
5703 cc_copy.chunks[0].source_off = 0;
5704 cc_copy.chunks[0].target_off = 0;
5705 cc_copy.chunks[0].length = 256;
5707 ndr_ret = ndr_push_struct_blob(
5708 &io.smb2.in.out, tmp_ctx, &cc_copy,
5709 (ndr_push_flags_fn_t)ndr_push_srv_copychunk_copy);
5711 torture_assert_ndr_success_goto(torture, ndr_ret, ok, done,
5712 "ndr_push_srv_copychunk_copy\n");
5714 status = smb2_ioctl(tree, tmp_ctx, &io.smb2);
5715 torture_assert_ntstatus_ok_goto(torture, status, ok, done,
5716 "FSCTL_SRV_COPYCHUNK\n");
5718 ndr_ret = ndr_pull_struct_blob(
5719 &io.smb2.out.out, tmp_ctx, &cc_rsp,
5720 (ndr_pull_flags_fn_t)ndr_pull_srv_copychunk_rsp);
5722 torture_assert_ndr_success_goto(torture, ndr_ret, ok, done,
5723 "ndr_pull_srv_copychunk_rsp\n");
5725 ok = check_copy_chunk_rsp(torture, &cc_rsp,
5726 1, /* chunks written */
5727 0, /* chunk bytes unsuccessfully written */
5728 256); /* total bytes written */
5729 torture_assert_goto(torture, ok == true, ok, done,
5730 "bad copy chunk response data\n");
5732 ok = check_pattern(torture, tree, tmp_ctx, dest_h, 0, 256, 0);
5733 if (!ok) {
5734 torture_fail(torture, "inconsistent file data\n");
5737 done:
5738 if (!smb2_util_handle_empty(src_h)) {
5739 smb2_util_close(tree, src_h);
5741 if (!smb2_util_handle_empty(dest_h)) {
5742 smb2_util_close(tree, dest_h);
5745 return ok;
5748 static bool copy_finderinfo_stream(struct torture_context *torture,
5749 struct smb2_tree *tree,
5750 TALLOC_CTX *tmp_ctx,
5751 const char *src_name,
5752 const char *dst_name)
5754 struct smb2_handle src_h = {{0}};
5755 struct smb2_handle dest_h = {{0}};
5756 NTSTATUS status;
5757 union smb_ioctl io;
5758 struct srv_copychunk_copy cc_copy;
5759 struct srv_copychunk_rsp cc_rsp;
5760 enum ndr_err_code ndr_ret;
5761 const char *type_creator = "SMB,OLE!";
5762 AfpInfo *info = NULL;
5763 const char *src_name_afpinfo = NULL;
5764 const char *dst_name_afpinfo = NULL;
5765 bool ok = false;
5767 src_name_afpinfo = talloc_asprintf(tmp_ctx, "%s%s", src_name,
5768 AFPINFO_STREAM);
5769 torture_assert_not_null_goto(torture, src_name_afpinfo, ok, done,
5770 "talloc_asprintf failed\n");
5772 dst_name_afpinfo = talloc_asprintf(tmp_ctx, "%s%s", dst_name,
5773 AFPINFO_STREAM);
5774 torture_assert_not_null_goto(torture, dst_name_afpinfo, ok, done,
5775 "talloc_asprintf failed\n");
5777 info = torture_afpinfo_new(tmp_ctx);
5778 torture_assert_not_null_goto(torture, info, ok, done,
5779 "torture_afpinfo_new failed\n");
5781 memcpy(info->afpi_FinderInfo, type_creator, 8);
5782 ok = torture_write_afpinfo(tree, torture, tmp_ctx, src_name, info);
5783 torture_assert_goto(torture, ok == true, ok, done,
5784 "torture_write_afpinfo failed\n");
5786 ok = test_setup_copy_chunk(torture, tree, tmp_ctx,
5787 1, /* 1 chunk */
5788 src_name_afpinfo,
5789 &src_h, 0,
5790 SEC_FILE_READ_DATA | SEC_FILE_WRITE_DATA,
5791 dst_name_afpinfo,
5792 &dest_h, 0,
5793 SEC_FILE_READ_DATA | SEC_FILE_WRITE_DATA,
5794 &cc_copy,
5795 &io);
5796 torture_assert_goto(torture, ok == true, ok, done,
5797 "setup copy chunk error\n");
5799 /* copy all src file data (via a single chunk desc) */
5800 cc_copy.chunks[0].source_off = 0;
5801 cc_copy.chunks[0].target_off = 0;
5802 cc_copy.chunks[0].length = 60;
5804 ndr_ret = ndr_push_struct_blob(
5805 &io.smb2.in.out, tmp_ctx, &cc_copy,
5806 (ndr_push_flags_fn_t)ndr_push_srv_copychunk_copy);
5808 torture_assert_ndr_success_goto(torture, ndr_ret, ok, done,
5809 "ndr_push_srv_copychunk_copy\n");
5811 status = smb2_ioctl(tree, tmp_ctx, &io.smb2);
5812 torture_assert_ntstatus_ok_goto(torture, status, ok, done,
5813 "FSCTL_SRV_COPYCHUNK\n");
5815 ndr_ret = ndr_pull_struct_blob(
5816 &io.smb2.out.out, tmp_ctx, &cc_rsp,
5817 (ndr_pull_flags_fn_t)ndr_pull_srv_copychunk_rsp);
5819 torture_assert_ndr_success_goto(torture, ndr_ret, ok, done,
5820 "ndr_pull_srv_copychunk_rsp\n");
5822 smb2_util_close(tree, src_h);
5823 ZERO_STRUCT(src_h);
5824 smb2_util_close(tree, dest_h);
5825 ZERO_STRUCT(dest_h);
5827 ok = check_copy_chunk_rsp(torture, &cc_rsp,
5828 1, /* chunks written */
5829 0, /* chunk bytes unsuccessfully written */
5830 60); /* total bytes written */
5831 torture_assert_goto(torture, ok == true, ok, done,
5832 "bad copy chunk response data\n");
5834 ok = check_stream(tree, __location__, torture, tmp_ctx,
5835 dst_name, AFPINFO_STREAM,
5836 0, 60, 16, 8, type_creator);
5837 torture_assert_goto(torture, ok == true, ok, done, "check_stream failed\n");
5839 done:
5840 if (!smb2_util_handle_empty(src_h)) {
5841 smb2_util_close(tree, src_h);
5843 if (!smb2_util_handle_empty(dest_h)) {
5844 smb2_util_close(tree, dest_h);
5847 return ok;
5850 static bool test_copy_chunk_streams(struct torture_context *torture,
5851 struct smb2_tree *tree)
5853 const char *src_name = "src";
5854 const char *dst_name = "dst";
5855 struct names {
5856 const char *src_sname;
5857 const char *dst_sname;
5858 } names[] = {
5859 { "src:foo", "dst:foo" },
5860 { "src" AFPRESOURCE_STREAM, "dst" AFPRESOURCE_STREAM }
5862 size_t i;
5863 TALLOC_CTX *tmp_ctx = NULL;
5864 bool ok = false;
5866 tmp_ctx = talloc_new(tree);
5867 torture_assert_not_null_goto(torture, tmp_ctx, ok, done,
5868 "torture_setup_file\n");
5870 smb2_util_unlink(tree, src_name);
5871 smb2_util_unlink(tree, dst_name);
5873 ok = torture_setup_file(torture, tree, src_name, false);
5874 torture_assert_goto(torture, ok == true, ok, done, "torture_setup_file\n");
5875 ok = torture_setup_file(torture, tree, dst_name, false);
5876 torture_assert_goto(torture, ok == true, ok, done, "torture_setup_file\n");
5878 for (i = 0; i < ARRAY_SIZE(names); i++) {
5879 ok = copy_one_stream(torture, tree, tmp_ctx,
5880 names[i].src_sname,
5881 names[i].dst_sname);
5882 torture_assert_goto(torture, ok == true, ok, done,
5883 "copy_one_stream failed\n");
5886 ok = copy_finderinfo_stream(torture, tree, tmp_ctx,
5887 src_name, dst_name);
5888 torture_assert_goto(torture, ok == true, ok, done,
5889 "copy_finderinfo_stream failed\n");
5891 done:
5892 smb2_util_unlink(tree, src_name);
5893 smb2_util_unlink(tree, dst_name);
5894 talloc_free(tmp_ctx);
5895 return ok;
5899 * Ensure this security descriptor has exactly one mode, uid
5900 * and gid.
5903 static NTSTATUS check_nfs_sd(const struct security_descriptor *psd)
5905 uint32_t i;
5906 bool got_one_mode = false;
5907 bool got_one_uid = false;
5908 bool got_one_gid = false;
5910 if (psd->dacl == NULL) {
5911 return NT_STATUS_INVALID_SECURITY_DESCR;
5914 for (i = 0; i < psd->dacl->num_aces; i++) {
5915 if (dom_sid_compare_domain(&global_sid_Unix_NFS_Mode,
5916 &psd->dacl->aces[i].trustee) == 0) {
5917 if (got_one_mode == true) {
5918 /* Can't have more than one. */
5919 return NT_STATUS_INVALID_SECURITY_DESCR;
5921 got_one_mode = true;
5924 for (i = 0; i < psd->dacl->num_aces; i++) {
5925 if (dom_sid_compare_domain(&global_sid_Unix_NFS_Users,
5926 &psd->dacl->aces[i].trustee) == 0) {
5927 if (got_one_uid == true) {
5928 /* Can't have more than one. */
5929 return NT_STATUS_INVALID_SECURITY_DESCR;
5931 got_one_uid = true;
5934 for (i = 0; i < psd->dacl->num_aces; i++) {
5935 if (dom_sid_compare_domain(&global_sid_Unix_NFS_Groups,
5936 &psd->dacl->aces[i].trustee) == 0) {
5937 if (got_one_gid == true) {
5938 /* Can't have more than one. */
5939 return NT_STATUS_INVALID_SECURITY_DESCR;
5941 got_one_gid = true;
5944 /* Must have at least one of each. */
5945 if (got_one_mode == false ||
5946 got_one_uid == false ||
5947 got_one_gid == false) {
5948 return NT_STATUS_INVALID_SECURITY_DESCR;
5950 return NT_STATUS_OK;
5953 static bool test_nfs_aces(struct torture_context *tctx,
5954 struct smb2_tree *tree)
5956 TALLOC_CTX *mem_ctx = talloc_new(tctx);
5957 struct security_ace ace;
5958 struct dom_sid sid;
5959 const char *fname = BASEDIR "\\nfs_aces.txt";
5960 struct smb2_handle h = {{0}};
5961 union smb_fileinfo finfo2;
5962 union smb_setfileinfo set;
5963 struct security_descriptor *psd = NULL;
5964 NTSTATUS status;
5965 bool ret = true;
5966 bool is_osx = torture_setting_bool(tctx, "osx", false);
5968 if (is_osx) {
5969 torture_skip(tctx, "Test only works with Samba\n");
5972 ret = enable_aapl(tctx, tree);
5973 torture_assert(tctx, ret == true, "enable_aapl failed");
5975 /* clean slate ...*/
5976 smb2_util_unlink(tree, fname);
5977 smb2_deltree(tree, fname);
5978 smb2_deltree(tree, BASEDIR);
5980 status = torture_smb2_testdir(tree, BASEDIR, &h);
5981 CHECK_STATUS(status, NT_STATUS_OK);
5982 smb2_util_close(tree, h);
5984 /* Create a test file. */
5985 status = torture_smb2_testfile_access(tree,
5986 fname,
5988 SEC_STD_READ_CONTROL |
5989 SEC_STD_WRITE_DAC |
5990 SEC_RIGHTS_FILE_ALL);
5991 CHECK_STATUS(status, NT_STATUS_OK);
5993 /* Get the ACL. */
5994 finfo2.query_secdesc.in.secinfo_flags =
5995 SECINFO_OWNER |
5996 SECINFO_GROUP |
5997 SECINFO_DACL;
5998 finfo2.generic.level = RAW_FILEINFO_SEC_DESC;
5999 finfo2.generic.in.file.handle = h;
6000 status = smb2_getinfo_file(tree, tctx, &finfo2);
6001 CHECK_STATUS(status, NT_STATUS_OK);
6003 psd = finfo2.query_secdesc.out.sd;
6005 /* Ensure we have only single mode/uid/gid NFS entries. */
6006 status = check_nfs_sd(psd);
6007 if (!NT_STATUS_IS_OK(status)) {
6008 NDR_PRINT_DEBUG(
6009 security_descriptor,
6010 discard_const_p(struct security_descriptor, psd));
6012 CHECK_STATUS(status, NT_STATUS_OK);
6014 /* Add a couple of extra NFS uids and gids. */
6015 sid_compose(&sid, &global_sid_Unix_NFS_Users, 27);
6016 init_sec_ace(&ace, &sid, SEC_ACE_TYPE_ACCESS_DENIED, 0, 0);
6017 status = security_descriptor_dacl_add(psd, &ace);
6018 CHECK_STATUS(status, NT_STATUS_OK);
6019 status = security_descriptor_dacl_add(psd, &ace);
6020 CHECK_STATUS(status, NT_STATUS_OK);
6022 sid_compose(&sid, &global_sid_Unix_NFS_Groups, 300);
6023 init_sec_ace(&ace, &sid, SEC_ACE_TYPE_ACCESS_DENIED, 0, 0);
6024 status = security_descriptor_dacl_add(psd, &ace);
6025 CHECK_STATUS(status, NT_STATUS_OK);
6026 status = security_descriptor_dacl_add(psd, &ace);
6027 CHECK_STATUS(status, NT_STATUS_OK);
6029 /* Now set on the file handle. */
6030 set.set_secdesc.level = RAW_SFILEINFO_SEC_DESC;
6031 set.set_secdesc.in.file.handle = h;
6032 set.set_secdesc.in.secinfo_flags = SECINFO_DACL;
6033 set.set_secdesc.in.sd = psd;
6034 status = smb2_setinfo_file(tree, &set);
6035 CHECK_STATUS(status, NT_STATUS_OK);
6037 /* Get the ACL again. */
6038 finfo2.query_secdesc.in.secinfo_flags =
6039 SECINFO_OWNER |
6040 SECINFO_GROUP |
6041 SECINFO_DACL;
6042 finfo2.generic.level = RAW_FILEINFO_SEC_DESC;
6043 finfo2.generic.in.file.handle = h;
6044 status = smb2_getinfo_file(tree, tctx, &finfo2);
6045 CHECK_STATUS(status, NT_STATUS_OK);
6047 psd = finfo2.query_secdesc.out.sd;
6049 /* Ensure we have only single mode/uid/gid NFS entries. */
6050 status = check_nfs_sd(psd);
6051 if (!NT_STATUS_IS_OK(status)) {
6052 NDR_PRINT_DEBUG(
6053 security_descriptor,
6054 discard_const_p(struct security_descriptor, psd));
6056 CHECK_STATUS(status, NT_STATUS_OK);
6058 done:
6059 if (!smb2_util_handle_empty(h)) {
6060 smb2_util_close(tree, h);
6062 smb2_util_unlink(tree, fname);
6063 smb2_deltree(tree, fname);
6064 smb2_deltree(tree, BASEDIR);
6065 talloc_free(mem_ctx);
6066 return ret;
6069 static bool test_setinfo_stream_eof(struct torture_context *tctx,
6070 struct smb2_tree *tree)
6072 bool ret = true;
6073 NTSTATUS status;
6074 struct smb2_create create;
6075 union smb_setfileinfo sfinfo;
6076 union smb_fileinfo finfo;
6077 struct smb2_handle h1;
6078 TALLOC_CTX *mem_ctx = talloc_new(tctx);
6079 const char *fname = BASEDIR "\\file";
6080 const char *sname = BASEDIR "\\file:foo";
6082 torture_assert_goto(tctx, mem_ctx != NULL, ret, done,
6083 "talloc_new failed\n");
6085 ret = enable_aapl(tctx, tree);
6086 torture_assert(tctx, ret == true, "enable_aapl failed");
6088 torture_comment(tctx, "Test setting EOF on a stream\n");
6090 smb2_deltree(tree, BASEDIR);
6091 status = torture_smb2_testdir(tree, BASEDIR, &h1);
6092 torture_assert_ntstatus_ok_goto(tctx, status, ret, done,
6093 "torture_smb2_testdir\n");
6094 smb2_util_close(tree, h1);
6096 status = torture_smb2_testfile(tree, fname, &h1);
6097 torture_assert_ntstatus_ok_goto(tctx, status, ret, done,
6098 "torture_smb2_testfile failed\n");
6099 smb2_util_close(tree, h1);
6101 status = torture_smb2_testfile_access(tree, sname, &h1,
6102 SEC_FILE_WRITE_DATA);
6103 torture_assert_ntstatus_ok_goto(tctx, status, ret, done,
6104 "torture_smb2_testfile failed\n");
6106 status = smb2_util_write(tree, h1, "1234567890", 0, 10);
6107 torture_assert_ntstatus_ok_goto(tctx, status, ret, done,
6108 "smb2_util_write failed\n");
6109 smb2_util_close(tree, h1);
6112 * Test setting EOF to 21
6115 torture_comment(tctx, "Setting stream EOF to 21\n");
6117 status = torture_smb2_testfile_access(tree, sname, &h1,
6118 SEC_FILE_WRITE_DATA);
6119 torture_assert_ntstatus_ok_goto(tctx, status, ret, done,
6120 "torture_smb2_testfile failed\n");
6122 ZERO_STRUCT(sfinfo);
6123 sfinfo.generic.in.file.handle = h1;
6124 sfinfo.generic.level = RAW_SFILEINFO_END_OF_FILE_INFORMATION;
6125 sfinfo.position_information.in.position = 21;
6126 status = smb2_setinfo_file(tree, &sfinfo);
6127 torture_assert_ntstatus_ok_goto(tctx, status,
6128 ret, done, "set EOF 21 failed\n");
6130 smb2_util_close(tree, h1);
6132 status = torture_smb2_testfile_access(tree, sname, &h1,
6133 SEC_FILE_WRITE_DATA);
6134 torture_assert_ntstatus_ok_goto(tctx, status, ret, done,
6135 "torture_smb2_testfile failed\n");
6137 ZERO_STRUCT(finfo);
6138 finfo.generic.level = RAW_FILEINFO_STANDARD_INFORMATION;
6139 finfo.generic.in.file.handle = h1;
6140 status = smb2_getinfo_file(tree, mem_ctx, &finfo);
6141 torture_assert_ntstatus_ok_goto(tctx, status, ret, done,
6142 "smb2_getinfo_file failed");
6144 smb2_util_close(tree, h1);
6146 torture_assert_goto(tctx, finfo.standard_info.out.size == 21,
6147 ret, done, "size != 21\n");
6150 * Test setting EOF to 0
6153 torture_comment(tctx, "Setting stream EOF to 0\n");
6155 status = torture_smb2_testfile_access(tree, sname, &h1,
6156 SEC_FILE_WRITE_DATA);
6157 torture_assert_ntstatus_ok_goto(tctx, status, ret, done,
6158 "torture_smb2_testfile failed\n");
6160 ZERO_STRUCT(sfinfo);
6161 sfinfo.generic.in.file.handle = h1;
6162 sfinfo.generic.level = RAW_SFILEINFO_END_OF_FILE_INFORMATION;
6163 sfinfo.position_information.in.position = 0;
6164 status = smb2_setinfo_file(tree, &sfinfo);
6165 torture_assert_ntstatus_ok_goto(tctx, status, ret, done,
6166 "set eof 0 failed\n");
6168 ZERO_STRUCT(create);
6169 create.in.desired_access = SEC_FILE_READ_ATTRIBUTE;
6170 create.in.share_access = NTCREATEX_SHARE_ACCESS_MASK;
6171 create.in.file_attributes = FILE_ATTRIBUTE_NORMAL;
6172 create.in.create_disposition = NTCREATEX_DISP_OPEN;
6173 create.in.fname = sname;
6175 status = smb2_create(tree, tctx, &create);
6176 torture_assert_ntstatus_equal_goto(
6177 tctx, status, NT_STATUS_OBJECT_NAME_NOT_FOUND, ret, done,
6178 "Unexpected status\n");
6180 smb2_util_close(tree, h1);
6182 ZERO_STRUCT(create);
6183 create.in.desired_access = SEC_FILE_READ_ATTRIBUTE;
6184 create.in.share_access = NTCREATEX_SHARE_ACCESS_MASK;
6185 create.in.file_attributes = FILE_ATTRIBUTE_NORMAL;
6186 create.in.create_disposition = NTCREATEX_DISP_OPEN;
6187 create.in.fname = sname;
6189 status = smb2_create(tree, tctx, &create);
6190 torture_assert_ntstatus_equal_goto(
6191 tctx, status, NT_STATUS_OBJECT_NAME_NOT_FOUND, ret, done,
6192 "Unexpected status\n");
6194 status = torture_smb2_testfile_access(tree, sname, &h1,
6195 SEC_FILE_WRITE_DATA);
6196 torture_assert_ntstatus_ok_goto(tctx, status, ret, done,
6197 "torture_smb2_testfile failed\n");
6199 ZERO_STRUCT(finfo);
6200 finfo.generic.level = RAW_FILEINFO_STANDARD_INFORMATION;
6201 finfo.generic.in.file.handle = h1;
6202 status = smb2_getinfo_file(tree, mem_ctx, &finfo);
6203 torture_assert_ntstatus_ok_goto(tctx, status, ret, done,
6204 "smb2_getinfo_file failed\n");
6206 smb2_util_close(tree, h1);
6208 torture_assert_goto(tctx, finfo.standard_info.out.size == 0,
6209 ret, done, "size != 0\n");
6212 * Test setinfo end-of-file info to 1
6215 torture_comment(tctx, "Setting stream EOF to 1\n");
6217 status = torture_smb2_testfile_access(tree, sname, &h1,
6218 SEC_FILE_WRITE_DATA);
6219 torture_assert_ntstatus_ok_goto(tctx, status, ret, done,
6220 "torture_smb2_testfile failed\n");
6222 ZERO_STRUCT(sfinfo);
6223 sfinfo.generic.in.file.handle = h1;
6224 sfinfo.generic.level = RAW_SFILEINFO_END_OF_FILE_INFORMATION;
6225 sfinfo.position_information.in.position = 1;
6226 status = smb2_setinfo_file(tree, &sfinfo);
6227 torture_assert_ntstatus_ok_goto(tctx, status, ret, done,
6228 "set EOF 1 failed\n");
6230 smb2_util_close(tree, h1);
6232 status = torture_smb2_testfile_access(tree, sname, &h1,
6233 SEC_FILE_WRITE_DATA);
6234 torture_assert_ntstatus_ok_goto(tctx, status, ret, done,
6235 "torture_smb2_testfile failed\n");
6237 ZERO_STRUCT(finfo);
6238 finfo.generic.level = RAW_FILEINFO_STANDARD_INFORMATION;
6239 finfo.generic.in.file.handle = h1;
6240 status = smb2_getinfo_file(tree, mem_ctx, &finfo);
6241 torture_assert_ntstatus_ok_goto(tctx, status, ret, done,
6242 "smb2_getinfo_file failed\n");
6244 smb2_util_close(tree, h1);
6246 torture_assert_goto(tctx, finfo.standard_info.out.size == 1,
6247 ret, done, "size != 1\n");
6250 * Test setting EOF to 0 with AAPL enabled, should delete stream
6253 torture_comment(tctx, "Enabling AAPL extensions\n");
6255 ret = enable_aapl(tctx, tree);
6256 torture_assert(tctx, ret == true, "enable_aapl failed\n");
6258 torture_comment(tctx, "Setting stream EOF to 0\n");
6259 status = torture_smb2_testfile_access(tree, sname, &h1,
6260 SEC_FILE_WRITE_DATA);
6261 torture_assert_ntstatus_ok_goto(tctx, status, ret, done,
6262 "torture_smb2_testfile failed\n");
6264 ZERO_STRUCT(sfinfo);
6265 sfinfo.generic.in.file.handle = h1;
6266 sfinfo.generic.level = RAW_SFILEINFO_END_OF_FILE_INFORMATION;
6267 sfinfo.position_information.in.position = 0;
6268 status = smb2_setinfo_file(tree, &sfinfo);
6269 torture_assert_ntstatus_ok_goto(tctx, status, ret, done,
6270 "set eof 0 failed\n");
6272 ZERO_STRUCT(create);
6273 create.in.desired_access = SEC_FILE_READ_ATTRIBUTE;
6274 create.in.share_access = NTCREATEX_SHARE_ACCESS_MASK;
6275 create.in.file_attributes = FILE_ATTRIBUTE_NORMAL;
6276 create.in.create_disposition = NTCREATEX_DISP_OPEN;
6277 create.in.fname = sname;
6279 status = smb2_create(tree, tctx, &create);
6280 torture_assert_ntstatus_equal_goto(
6281 tctx, status, NT_STATUS_OBJECT_NAME_NOT_FOUND, ret, done,
6282 "Unexpected status\n");
6284 smb2_util_close(tree, h1);
6286 ZERO_STRUCT(create);
6287 create.in.desired_access = SEC_FILE_READ_ATTRIBUTE;
6288 create.in.share_access = NTCREATEX_SHARE_ACCESS_MASK;
6289 create.in.file_attributes = FILE_ATTRIBUTE_NORMAL;
6290 create.in.create_disposition = NTCREATEX_DISP_OPEN;
6291 create.in.fname = sname;
6293 status = smb2_create(tree, tctx, &create);
6294 torture_assert_ntstatus_equal_goto(
6295 tctx, status, NT_STATUS_OBJECT_NAME_NOT_FOUND, ret, done,
6296 "Unexpected status\n");
6298 torture_comment(
6299 tctx, "Setting main file EOF to 1 to force 0-truncate\n");
6301 status = torture_smb2_testfile_access(
6302 tree,
6303 fname,
6304 &h1,
6305 SEC_FILE_WRITE_DATA);
6306 torture_assert_ntstatus_ok_goto(tctx, status, ret, done,
6307 "torture_smb2_testfile failed\n");
6309 ZERO_STRUCT(sfinfo);
6310 sfinfo.generic.in.file.handle = h1;
6311 sfinfo.generic.level = RAW_SFILEINFO_END_OF_FILE_INFORMATION;
6312 sfinfo.position_information.in.position = 1;
6313 status = smb2_setinfo_file(tree, &sfinfo);
6314 torture_assert_ntstatus_ok_goto(
6315 tctx,
6316 status,
6317 ret,
6318 done,
6319 "set eof 1 failed\n");
6321 sfinfo.position_information.in.position = 0;
6322 status = smb2_setinfo_file(tree, &sfinfo);
6323 torture_assert_ntstatus_ok_goto(
6324 tctx,
6325 status,
6326 ret,
6327 done,
6328 "set eof 0 failed\n");
6330 smb2_util_close(tree, h1);
6332 ZERO_STRUCT(create);
6333 create.in.desired_access = SEC_FILE_READ_ATTRIBUTE;
6334 create.in.share_access = NTCREATEX_SHARE_ACCESS_MASK;
6335 create.in.file_attributes = FILE_ATTRIBUTE_NORMAL;
6336 create.in.create_disposition = NTCREATEX_DISP_OPEN;
6337 create.in.fname = fname;
6339 status = smb2_create(tree, tctx, &create);
6340 torture_assert_ntstatus_ok_goto(tctx, status, ret, done,
6341 "torture_smb2_testfile failed\n");
6342 smb2_util_close(tree, h1);
6344 torture_comment(tctx, "Writing to stream after setting EOF to 0\n");
6345 status = torture_smb2_testfile_access(tree, sname, &h1,
6346 SEC_FILE_WRITE_DATA);
6347 torture_assert_ntstatus_ok_goto(tctx, status, ret, done,
6348 "torture_smb2_testfile failed\n");
6350 status = smb2_util_write(tree, h1, "1234567890", 0, 10);
6351 torture_assert_ntstatus_ok_goto(tctx, status, ret, done,
6352 "smb2_util_write failed\n");
6354 ZERO_STRUCT(sfinfo);
6355 sfinfo.generic.in.file.handle = h1;
6356 sfinfo.generic.level = RAW_SFILEINFO_END_OF_FILE_INFORMATION;
6357 sfinfo.position_information.in.position = 0;
6358 status = smb2_setinfo_file(tree, &sfinfo);
6359 torture_assert_ntstatus_ok_goto(tctx, status, ret, done,
6360 "set eof 0 failed\n");
6362 status = smb2_util_write(tree, h1, "1234567890", 0, 10);
6363 torture_assert_ntstatus_ok_goto(tctx, status, ret, done,
6364 "smb2_util_write failed\n");
6366 smb2_util_close(tree, h1);
6368 done:
6369 smb2_util_unlink(tree, fname);
6370 smb2_util_rmdir(tree, BASEDIR);
6371 return ret;
6374 #define MAX_STREAMS 16
6376 struct tcase {
6377 const char *name;
6378 uint32_t access;
6379 const char *write_data;
6380 size_t write_size;
6381 struct tcase_results {
6382 size_t size;
6383 NTSTATUS initial_status;
6384 NTSTATUS final_status;
6385 int num_streams_open_handle;
6386 const char *streams_open_handle[MAX_STREAMS];
6387 int num_streams_closed_handle;
6388 const char *streams_closed_handle[MAX_STREAMS];
6389 } create, write, overwrite, eof, doc;
6392 typedef enum {T_CREATE, T_WRITE, T_OVERWRITE, T_EOF, T_DOC} subtcase_t;
6394 static bool test_empty_stream_do_checks(
6395 struct torture_context *tctx,
6396 struct smb2_tree *tree,
6397 struct smb2_tree *tree2,
6398 struct tcase *tcase,
6399 TALLOC_CTX *mem_ctx,
6400 struct smb2_handle baseh,
6401 struct smb2_handle streamh,
6402 subtcase_t subcase)
6404 bool ret = false;
6405 NTSTATUS status;
6406 struct smb2_handle h1;
6407 union smb_fileinfo finfo;
6408 struct tcase_results *tcase_results = NULL;
6410 switch (subcase) {
6411 case T_CREATE:
6412 tcase_results = &tcase->create;
6413 break;
6414 case T_OVERWRITE:
6415 tcase_results = &tcase->overwrite;
6416 break;
6417 case T_WRITE:
6418 tcase_results = &tcase->write;
6419 break;
6420 case T_EOF:
6421 tcase_results = &tcase->eof;
6422 break;
6423 case T_DOC:
6424 tcase_results = &tcase->doc;
6425 break;
6428 finfo = (union smb_fileinfo) {
6429 .generic.level = RAW_FILEINFO_STANDARD_INFORMATION,
6430 .generic.in.file.handle = streamh,
6434 * Test: check size, same client
6437 status = smb2_getinfo_file(tree, mem_ctx, &finfo);
6438 torture_assert_ntstatus_ok_goto(tctx, status, ret, done,
6439 "torture_smb2_testfile failed\n");
6441 torture_assert_int_equal_goto(tctx, finfo.standard_info.out.size,
6442 tcase_results->size,
6443 ret, done, "Wrong size\n");
6446 * Test: open, same client
6449 status = torture_smb2_open(tree, tcase->name,
6450 SEC_FILE_READ_ATTRIBUTE, &h1);
6451 torture_assert_ntstatus_equal_goto(tctx, status,
6452 tcase_results->initial_status,
6453 ret, done,
6454 "smb2_create failed\n");
6455 if (NT_STATUS_IS_OK(status)) {
6456 status = smb2_util_close(tree, h1);
6457 torture_assert_ntstatus_ok_goto(tctx, status, ret, done,
6458 "smb2_util_close failed\n");
6462 * Test: check streams, same client
6465 ret = check_stream_list_handle(tree, tctx, baseh,
6466 tcase_results->num_streams_open_handle,
6467 tcase_results->streams_open_handle,
6468 false);
6469 torture_assert_goto(tctx, ret == true, ret, done, "Bad streams");
6472 * Test: open, different client
6475 status = torture_smb2_open(tree2, tcase->name,
6476 SEC_FILE_READ_ATTRIBUTE, &h1);
6477 torture_assert_ntstatus_equal_goto(tctx, status,
6478 tcase_results->initial_status,
6479 ret, done,
6480 "smb2_create failed\n");
6481 if (NT_STATUS_IS_OK(status)) {
6482 finfo = (union smb_fileinfo) {
6483 .generic.level = RAW_FILEINFO_STANDARD_INFORMATION,
6484 .generic.in.file.handle = h1,
6488 * Test: check size, different client
6491 status = smb2_getinfo_file(tree2, mem_ctx, &finfo);
6492 torture_assert_ntstatus_ok_goto(tctx, status, ret, done,
6493 "smb2_getinfo_file failed\n");
6495 torture_assert_int_equal_goto(tctx, finfo.standard_info.out.size,
6496 tcase_results->size,
6497 ret, done, "Wrong size\n");
6500 * Test: check streams, different client
6503 ret = check_stream_list(tree2, tctx, BASEDIR "\\file",
6504 tcase_results->num_streams_open_handle,
6505 tcase_results->streams_open_handle,
6506 false);
6507 torture_assert_goto(tctx, ret == true, ret, done, "Bad streams");
6509 status = smb2_util_close(tree2, h1);
6510 torture_assert_ntstatus_ok_goto(tctx, status, ret, done,
6511 "smb2_util_close failed\n");
6514 status = smb2_util_close(tree, streamh);
6515 torture_assert_ntstatus_ok_goto(tctx, status, ret, done,
6516 "smb2_util_close failed\n");
6519 * Test: open after close, same client
6522 status = torture_smb2_open(tree, tcase->name,
6523 SEC_FILE_READ_DATA, &h1);
6524 torture_assert_ntstatus_equal_goto(tctx, status,
6525 tcase_results->final_status,
6526 ret, done,
6527 "smb2_create failed\n");
6528 if (NT_STATUS_IS_OK(status)) {
6529 status = smb2_util_close(tree, h1);
6530 torture_assert_ntstatus_ok_goto(tctx, status, ret, done,
6531 "smb2_util_close failed\n");
6535 * Test: open after close, different client
6538 status = torture_smb2_open(tree2, tcase->name,
6539 SEC_FILE_READ_DATA, &h1);
6540 torture_assert_ntstatus_equal_goto(tctx, status,
6541 tcase_results->final_status,
6542 ret, done,
6543 "smb2_create failed\n");
6544 if (NT_STATUS_IS_OK(status)) {
6545 status = smb2_util_close(tree2, h1);
6546 torture_assert_ntstatus_ok_goto(tctx, status, ret, done,
6547 "smb2_util_close failed\n");
6551 * Test: check streams after close, same client
6554 ret = check_stream_list_handle(tree, tctx, baseh,
6555 tcase_results->num_streams_closed_handle,
6556 tcase_results->streams_closed_handle,
6557 false);
6558 torture_assert_goto(tctx, ret == true, ret, done, "Bad streams");
6560 ret = true;
6562 done:
6563 smb2_util_close(tree, streamh);
6564 smb2_util_close(tree, baseh);
6565 return ret;
6568 static bool test_empty_stream_do_one(
6569 struct torture_context *tctx,
6570 struct smb2_tree *tree,
6571 struct smb2_tree *tree2,
6572 struct tcase *tcase)
6574 bool ret = false;
6575 NTSTATUS status;
6576 struct smb2_handle baseh = {{0}};
6577 struct smb2_handle streamh;
6578 struct smb2_create create;
6579 union smb_setfileinfo sfinfo;
6580 TALLOC_CTX *mem_ctx = talloc_new(tctx);
6582 torture_comment(tctx, "Testing stream [%s]\n", tcase->name);
6584 torture_assert_goto(tctx, mem_ctx != NULL, ret, done, "talloc_new\n");
6587 * Subtest: create
6589 torture_comment(tctx, "Subtest: T_CREATE\n");
6591 status = smb2_util_unlink(tree, BASEDIR "\\file");
6592 torture_assert_ntstatus_ok_goto(tctx, status, ret, done,
6593 "smb2_util_unlink failed\n");
6595 status = torture_smb2_testfile_access(tree, BASEDIR "\\file",
6596 &baseh, SEC_FILE_ALL);
6597 torture_assert_ntstatus_ok_goto(tctx, status, ret, done,
6598 "torture_smb2_testfile_access failed\n");
6600 status = torture_smb2_testfile_access(tree, tcase->name, &streamh,
6601 tcase->access);
6602 torture_assert_ntstatus_ok_goto(tctx, status, ret, done,
6603 "torture_smb2_testfile_access failed\n");
6605 ret = test_empty_stream_do_checks(tctx, tree, tree2, tcase,
6606 mem_ctx, baseh, streamh, T_CREATE);
6607 torture_assert_goto(tctx, ret, ret, done, "test failed\n");
6609 if (!(tcase->access & SEC_FILE_WRITE_DATA)) {
6611 * All subsequent tests require write access
6613 ret = true;
6614 goto done;
6618 * Subtest: create and write
6620 torture_comment(tctx, "Subtest: T_WRITE\n");
6622 status = smb2_util_unlink(tree, BASEDIR "\\file");
6623 torture_assert_ntstatus_ok_goto(tctx, status, ret, done,
6624 "smb2_util_unlink failed\n");
6626 status = torture_smb2_testfile_access(tree, BASEDIR "\\file",
6627 &baseh, SEC_FILE_ALL);
6628 torture_assert_ntstatus_ok_goto(tctx, status, ret, done,
6629 "torture_smb2_testfile_access failed\n");
6631 status = torture_smb2_testfile_access(tree, tcase->name, &streamh,
6632 tcase->access);
6633 torture_assert_ntstatus_ok_goto(tctx, status, ret, done,
6634 "torture_smb2_testfile_access failed\n");
6636 status = smb2_util_write(tree, streamh, tcase->write_data, 0,
6637 tcase->write_size);
6638 torture_assert_ntstatus_ok_goto(tctx, status, ret, done,
6639 "torture_smb2_open failed\n");
6641 ret = test_empty_stream_do_checks(tctx, tree, tree2, tcase,
6642 mem_ctx, baseh, streamh, T_WRITE);
6643 torture_assert_goto(tctx, ret, ret, done, "test failed\n");
6646 * Subtest: overwrite
6648 torture_comment(tctx, "Subtest: T_OVERWRITE\n");
6650 status = smb2_util_unlink(tree, BASEDIR "\\file");
6651 torture_assert_ntstatus_ok_goto(tctx, status, ret, done,
6652 "smb2_util_unlink failed\n");
6654 status = torture_smb2_testfile_access(tree, BASEDIR "\\file",
6655 &baseh, SEC_FILE_ALL);
6656 torture_assert_ntstatus_ok_goto(tctx, status, ret, done,
6657 "torture_smb2_testfile_access failed\n");
6659 create = (struct smb2_create) {
6660 .in.desired_access = SEC_FILE_ALL,
6661 .in.share_access = NTCREATEX_SHARE_ACCESS_MASK,
6662 .in.file_attributes = FILE_ATTRIBUTE_NORMAL,
6663 .in.create_disposition = NTCREATEX_DISP_OVERWRITE_IF,
6664 .in.fname = tcase->name,
6667 status = smb2_create(tree, tctx, &create);
6668 torture_assert_ntstatus_ok_goto(tctx, status, ret, done,
6669 "torture_smb2_testfile failed\n");
6670 streamh = create.out.file.handle;
6672 ret = test_empty_stream_do_checks(tctx, tree, tree2, tcase,
6673 mem_ctx, baseh, streamh, T_OVERWRITE);
6674 torture_assert_goto(tctx, ret, ret, done, "test failed\n");
6677 * Subtest: setinfo EOF 0
6679 torture_comment(tctx, "Subtest: T_EOF\n");
6681 status = smb2_util_unlink(tree, BASEDIR "\\file");
6682 torture_assert_ntstatus_ok_goto(tctx, status, ret, done,
6683 "smb2_util_unlink failed\n");
6685 status = torture_smb2_testfile_access(tree, BASEDIR "\\file",
6686 &baseh, SEC_FILE_ALL);
6687 torture_assert_ntstatus_ok_goto(tctx, status, ret, done,
6688 "torture_smb2_testfile_access failed\n");
6690 status = torture_smb2_testfile_access(tree, tcase->name, &streamh,
6691 tcase->access);
6692 torture_assert_ntstatus_ok_goto(tctx, status, ret, done,
6693 "torture_smb2_testfile_access failed\n");
6695 status = smb2_util_write(tree, streamh, tcase->write_data, 0,
6696 tcase->write_size);
6697 torture_assert_ntstatus_ok_goto(tctx, status, ret, done,
6698 "torture_smb2_open failed\n");
6700 sfinfo = (union smb_setfileinfo) {
6701 .end_of_file_info.level = RAW_SFILEINFO_END_OF_FILE_INFORMATION,
6702 .end_of_file_info.in.file.handle = streamh,
6703 .end_of_file_info.in.size = 0,
6705 status = smb2_setinfo_file(tree, &sfinfo);
6706 torture_assert_ntstatus_ok_goto(tctx, status, ret, done,
6707 "set eof 0 failed\n");
6709 ret = test_empty_stream_do_checks(tctx, tree, tree2, tcase,
6710 mem_ctx, baseh, streamh, T_EOF);
6711 torture_assert_goto(tctx, ret, ret, done, "test failed\n");
6714 * Subtest: delete-on-close
6716 torture_comment(tctx, "Subtest: T_DOC\n");
6718 status = smb2_util_unlink(tree, BASEDIR "\\file");
6719 torture_assert_ntstatus_ok_goto(tctx, status, ret, done,
6720 "smb2_util_unlink failed\n");
6722 status = torture_smb2_testfile_access(tree, BASEDIR "\\file",
6723 &baseh, SEC_FILE_ALL);
6724 torture_assert_ntstatus_ok_goto(tctx, status, ret, done,
6725 "torture_smb2_testfile_access failed\n");
6727 status = torture_smb2_testfile_access(tree, tcase->name, &streamh,
6728 tcase->access);
6729 torture_assert_ntstatus_ok_goto(tctx, status, ret, done,
6730 "torture_smb2_testfile_access failed\n");
6732 status = smb2_util_write(tree, streamh, tcase->write_data, 0,
6733 tcase->write_size);
6734 torture_assert_ntstatus_ok_goto(tctx, status, ret, done,
6735 "torture_smb2_open failed\n");
6737 sfinfo = (union smb_setfileinfo) {
6738 .disposition_info.level = RAW_SFILEINFO_DISPOSITION_INFORMATION,
6739 .disposition_info.in.file.handle = streamh,
6740 .disposition_info.in.delete_on_close = true,
6742 status = smb2_setinfo_file(tree, &sfinfo);
6743 torture_assert_ntstatus_ok_goto(tctx, status, ret, done,
6744 "set eof 0 failed\n");
6746 ret = test_empty_stream_do_checks(tctx, tree, tree2, tcase,
6747 mem_ctx, baseh, streamh,
6748 T_DOC);
6749 torture_assert_goto(tctx, ret, ret, done, "test failed\n");
6751 ret = true;
6753 done:
6754 smb2_util_close(tree, baseh);
6755 TALLOC_FREE(mem_ctx);
6756 return ret;
6759 static bool test_empty_stream(struct torture_context *tctx,
6760 struct smb2_tree *tree)
6762 struct smb2_tree *tree2 = NULL;
6763 struct tcase *tcase = NULL;
6764 const char *fname = BASEDIR "\\file";
6765 struct smb2_handle h1;
6766 bool ret = true;
6767 NTSTATUS status;
6768 AfpInfo ai = (AfpInfo) {
6769 .afpi_Signature = AFP_Signature,
6770 .afpi_Version = AFP_Version,
6771 .afpi_BackupTime = AFP_BackupTime,
6772 .afpi_FinderInfo = "FOO BAR ",
6774 char *ai_blob = torture_afpinfo_pack(tctx, &ai);
6775 struct tcase tcase_afpinfo_ro = (struct tcase) {
6776 .name = BASEDIR "\\file" AFPINFO_STREAM,
6777 .access = SEC_FILE_READ_DATA|SEC_FILE_READ_ATTRIBUTE,
6778 .create = {
6779 .size = 60,
6780 .initial_status = NT_STATUS_OBJECT_NAME_NOT_FOUND,
6781 .final_status = NT_STATUS_OBJECT_NAME_NOT_FOUND,
6782 .num_streams_open_handle = 1,
6783 .num_streams_closed_handle = 1,
6784 .streams_open_handle = {"::$DATA"},
6785 .streams_closed_handle = {"::$DATA"},
6788 struct tcase tcase_afpinfo_rw = (struct tcase) {
6789 .name = BASEDIR "\\file" AFPINFO_STREAM,
6790 .access = SEC_FILE_READ_DATA|SEC_FILE_READ_ATTRIBUTE|SEC_FILE_WRITE_DATA|SEC_STD_DELETE,
6791 .write_data = ai_blob,
6792 .write_size = AFP_INFO_SIZE,
6793 .create = {
6794 .size = 60,
6795 .initial_status = NT_STATUS_OBJECT_NAME_NOT_FOUND,
6796 .final_status = NT_STATUS_OBJECT_NAME_NOT_FOUND,
6797 .num_streams_open_handle = 1,
6798 .num_streams_closed_handle = 1,
6799 .streams_open_handle = {"::$DATA"},
6800 .streams_closed_handle = {"::$DATA"},
6802 .write = {
6803 .size = 60,
6804 .initial_status = NT_STATUS_OK,
6805 .final_status = NT_STATUS_OK,
6806 .num_streams_open_handle = 2,
6807 .num_streams_closed_handle = 2,
6808 .streams_open_handle = {"::$DATA", AFPINFO_STREAM},
6809 .streams_closed_handle = {"::$DATA", AFPINFO_STREAM},
6811 .overwrite = {
6812 .size = 60,
6813 .initial_status = NT_STATUS_OBJECT_NAME_NOT_FOUND,
6814 .final_status = NT_STATUS_OBJECT_NAME_NOT_FOUND,
6815 .num_streams_open_handle = 1,
6816 .num_streams_closed_handle = 1,
6817 .streams_open_handle = {"::$DATA"},
6818 .streams_closed_handle = {"::$DATA"},
6820 .eof = {
6821 .size = 60,
6822 .initial_status = NT_STATUS_OK,
6823 .final_status = NT_STATUS_OK,
6824 .num_streams_open_handle = 2,
6825 .num_streams_closed_handle = 2,
6826 .streams_open_handle = {"::$DATA", AFPINFO_STREAM},
6827 .streams_closed_handle = {"::$DATA", AFPINFO_STREAM},
6829 .doc = {
6830 .size = 60,
6831 .initial_status = NT_STATUS_DELETE_PENDING,
6832 .final_status = NT_STATUS_OBJECT_NAME_NOT_FOUND,
6833 .num_streams_open_handle = 2,
6834 .num_streams_closed_handle = 1,
6835 .streams_open_handle = {"::$DATA", AFPINFO_STREAM},
6836 .streams_closed_handle = {"::$DATA"},
6840 struct tcase tcase_afpresource_ro = (struct tcase) {
6841 .name = BASEDIR "\\file" AFPRESOURCE_STREAM,
6842 .access = SEC_FILE_READ_DATA|SEC_FILE_READ_ATTRIBUTE,
6843 .create = {
6844 .size = 0,
6845 .initial_status = NT_STATUS_OBJECT_NAME_NOT_FOUND,
6846 .final_status = NT_STATUS_OBJECT_NAME_NOT_FOUND,
6847 .num_streams_open_handle = 1,
6848 .num_streams_closed_handle = 1,
6849 .streams_open_handle = {"::$DATA"},
6850 .streams_closed_handle = {"::$DATA"},
6853 struct tcase tcase_afpresource_rw = (struct tcase) {
6854 .name = BASEDIR "\\file" AFPRESOURCE_STREAM,
6855 .access = SEC_FILE_READ_DATA|SEC_FILE_READ_ATTRIBUTE|SEC_FILE_WRITE_DATA|SEC_STD_DELETE,
6856 .write_data = "foo",
6857 .write_size = 3,
6858 .create = {
6859 .size = 0,
6860 .initial_status = NT_STATUS_OBJECT_NAME_NOT_FOUND,
6861 .final_status = NT_STATUS_OBJECT_NAME_NOT_FOUND,
6862 .num_streams_open_handle = 1,
6863 .num_streams_closed_handle = 1,
6864 .streams_open_handle = {"::$DATA"},
6865 .streams_closed_handle = {"::$DATA"},
6867 .write = {
6868 .size = 3,
6869 .initial_status = NT_STATUS_OK,
6870 .final_status = NT_STATUS_OK,
6871 .num_streams_open_handle = 2,
6872 .num_streams_closed_handle = 2,
6873 .streams_open_handle = {"::$DATA", AFPRESOURCE_STREAM},
6874 .streams_closed_handle = {"::$DATA", AFPRESOURCE_STREAM},
6876 .overwrite = {
6877 .size = 0,
6878 .initial_status = NT_STATUS_OBJECT_NAME_NOT_FOUND,
6879 .final_status = NT_STATUS_OBJECT_NAME_NOT_FOUND,
6880 .num_streams_open_handle = 1,
6881 .num_streams_closed_handle = 1,
6882 .streams_open_handle = {"::$DATA"},
6883 .streams_closed_handle = {"::$DATA"},
6885 .eof = {
6886 .size = 0,
6887 .initial_status = NT_STATUS_OBJECT_NAME_NOT_FOUND,
6888 .final_status = NT_STATUS_OBJECT_NAME_NOT_FOUND,
6889 .num_streams_open_handle = 1,
6890 .num_streams_closed_handle = 1,
6891 .streams_open_handle = {"::$DATA"},
6892 .streams_closed_handle = {"::$DATA"},
6894 .doc = {
6895 .size = 3,
6896 .initial_status = NT_STATUS_DELETE_PENDING,
6897 .final_status = NT_STATUS_OK,
6898 .num_streams_open_handle = 2,
6899 .num_streams_closed_handle = 2,
6900 .streams_open_handle = {"::$DATA", AFPRESOURCE_STREAM},
6901 .streams_closed_handle = {"::$DATA", AFPRESOURCE_STREAM},
6905 struct tcase tcase_foo_ro = (struct tcase) {
6906 .name = BASEDIR "\\file:foo",
6907 .access = SEC_FILE_READ_DATA|SEC_FILE_READ_ATTRIBUTE,
6908 .write_data = "foo",
6909 .write_size = 3,
6910 .create = {
6911 .size = 0,
6912 .initial_status = NT_STATUS_OBJECT_NAME_NOT_FOUND,
6913 .final_status = NT_STATUS_OBJECT_NAME_NOT_FOUND,
6914 .num_streams_open_handle = 1,
6915 .num_streams_closed_handle = 1,
6916 .streams_open_handle = {"::$DATA"},
6917 .streams_closed_handle = {"::$DATA"},
6921 struct tcase tcase_foo_rw = (struct tcase) {
6922 .name = BASEDIR "\\file:foo",
6923 .access = SEC_FILE_READ_DATA|SEC_FILE_READ_ATTRIBUTE|SEC_FILE_WRITE_DATA|SEC_STD_DELETE,
6924 .write_data = "foo",
6925 .write_size = 3,
6926 .create = {
6927 .size = 0,
6928 .initial_status = NT_STATUS_OBJECT_NAME_NOT_FOUND,
6929 .final_status = NT_STATUS_OBJECT_NAME_NOT_FOUND,
6930 .num_streams_open_handle = 1,
6931 .num_streams_closed_handle = 1,
6932 .streams_open_handle = {"::$DATA"},
6933 .streams_closed_handle = {"::$DATA"},
6935 .write = {
6936 .size = 3,
6937 .initial_status = NT_STATUS_OK,
6938 .final_status = NT_STATUS_OK,
6939 .num_streams_open_handle = 2,
6940 .num_streams_closed_handle = 2,
6941 .streams_open_handle = {"::$DATA", ":foo:$DATA"},
6942 .streams_closed_handle = {"::$DATA", ":foo:$DATA"},
6944 .overwrite = {
6945 .size = 0,
6946 .initial_status = NT_STATUS_OBJECT_NAME_NOT_FOUND,
6947 .final_status = NT_STATUS_OBJECT_NAME_NOT_FOUND,
6948 .num_streams_open_handle = 1,
6949 .num_streams_closed_handle = 1,
6950 .streams_open_handle = {"::$DATA"},
6951 .streams_closed_handle = {"::$DATA"},
6953 .eof = {
6954 .size = 0,
6955 .initial_status = NT_STATUS_OBJECT_NAME_NOT_FOUND,
6956 .final_status = NT_STATUS_OBJECT_NAME_NOT_FOUND,
6957 .num_streams_open_handle = 1,
6958 .num_streams_closed_handle = 1,
6959 .streams_open_handle = {"::$DATA"},
6960 .streams_closed_handle = {"::$DATA"},
6962 .doc = {
6963 .size = 3,
6964 .initial_status = NT_STATUS_DELETE_PENDING,
6965 .final_status = NT_STATUS_OBJECT_NAME_NOT_FOUND,
6966 .num_streams_open_handle = 2,
6967 .num_streams_closed_handle = 1,
6968 .streams_open_handle = {"::$DATA", ":foo:$DATA"},
6969 .streams_closed_handle = {"::$DATA"},
6973 struct tcase tcases[] = {
6974 tcase_afpinfo_ro,
6975 tcase_afpinfo_rw,
6976 tcase_afpresource_ro,
6977 tcase_afpresource_rw,
6978 tcase_foo_ro,
6979 tcase_foo_rw,
6983 ret = torture_smb2_connection(tctx, &tree2);
6984 torture_assert_goto(tctx, ret == true, ret, done,
6985 "torture_smb2_connection failed\n");
6987 ret = enable_aapl(tctx, tree);
6988 torture_assert(tctx, ret == true, "enable_aapl failed\n");
6990 ret = enable_aapl(tctx, tree2);
6991 torture_assert(tctx, ret == true, "enable_aapl failed\n");
6993 smb2_deltree(tree, BASEDIR);
6995 status = torture_smb2_testdir(tree, BASEDIR, &h1);
6996 torture_assert_ntstatus_ok_goto(tctx, status, ret, done,
6997 "torture_smb2_testdir\n");
6998 smb2_util_close(tree, h1);
7000 for (tcase = &tcases[0]; tcase->name != NULL; tcase++) {
7001 ret = torture_setup_file(tctx, tree, fname, false);
7002 torture_assert_goto(tctx, ret == true, ret, done,
7003 "torture_setup_file failed\n");
7005 ret = test_empty_stream_do_one(tctx, tree, tree2, tcase);
7006 torture_assert_goto(tctx, ret == true, ret, done,
7007 "subtest failed\n");
7009 status = smb2_util_unlink(tree, fname);
7010 torture_assert_ntstatus_ok_goto(tctx, status, ret, done,
7011 "smb2_util_unlink failed\n");
7014 done:
7015 smb2_deltree(tree, BASEDIR);
7016 TALLOC_FREE(tree2);
7017 return ret;
7021 -------------------------------------------------------------------------------
7022 MagicNumber: 00051607 : AppleDouble
7023 Version : 00020000 : Version 2
7024 Filler : 4D 61 63 20 4F 53 20 58 20 20 20 20 20 20 20 20 : Mac OS X
7025 Num. of ent: 0002 : 2
7027 -------------------------------------------------------------------------------
7028 Entry ID : 00000009 : Finder Info
7029 Offset : 00000032 : 50
7030 Length : 00000EB0 : 3760
7032 -DInfo-----:
7033 Rect top : 0000 : 0
7034 Rect left : 0000 : 0
7035 Rect bottom: 0000 : 0
7036 Rect right : 0000 : 0
7037 isAlias : 0
7038 Invisible : 0
7039 hasBundle : 0
7040 nameLocked : 0
7041 Stationery : 0
7042 CustomIcon : 0
7043 Reserved : 0
7044 Inited : 1
7045 NoINITS : 0
7046 Shared : 0
7047 SwitchLaunc: 0
7048 Hidden Ext : 0
7049 color : 000 : none
7050 isOnDesk : 0
7051 Location v : 0000 : 0
7052 Location h : 0000 : 0
7053 View : 0000 : ..
7055 -DXInfo----:
7056 Scroll v : 0000 : 0
7057 Scroll h : 0000 : 0
7058 Rsvd|OpnChn: 00000000 : 0
7059 AreInvalid : 0
7060 unknown bit: 0
7061 unknown bit: 0
7062 unknown bit: 0
7063 unknown bit: 0
7064 unknown bit: 0
7065 unknown bit: 0
7066 CustomBadge: 0
7067 ObjctIsBusy: 0
7068 unknown bit: 0
7069 unknown bit: 0
7070 unknown bit: 0
7071 unknown bit: 0
7072 RoutingInfo: 0
7073 unknown bit: 0
7074 unknown bit: 0
7075 Comment : 0000 : ..
7076 PutAway : 00000000 : 0
7078 -EA--------:
7079 pad : 0000 : ..
7080 magic : 41545452 : ATTR
7081 debug_tag : 0081714C : 8483148
7082 total_size : 00000EE2 : 3810
7083 data_start : 00000098 : 152
7084 data_length: 00000039 : 57
7085 reserved[0]: 00000000 : ....
7086 reserved[1]: 00000000 : ....
7087 reserved[2]: 00000000 : ....
7088 flags : 0000 : ..
7089 num_attrs : 0001 : 1
7090 -EA ENTRY--:
7091 offset : 00000098 : 152
7092 length : 00000039 : 57
7093 flags : 0000 : ..
7094 namelen : 15 : 21
7095 -EA NAME---: 0 1 2 3 4 5 6 7 8 9 A B C D E F : (ASCII)
7096 00000000 : 63 6F 6D 2E 61 70 70 6C 65 2E 71 75 61 72 61 6E : com.apple.quaran
7097 00000010 : 74 69 6E 65 00 : tine.
7098 -EA VALUE--: 0 1 2 3 4 5 6 7 8 9 A B C D E F : (ASCII)
7099 00000000 : 30 30 38 31 3B 36 32 65 61 33 37 66 64 3B 43 68 : 0081;62ea37fd;Ch
7100 00000010 : 72 6F 6D 65 3B 42 35 39 46 42 39 45 44 2D 35 41 : rome;B59FB9ED-5A
7101 00000020 : 32 39 2D 34 45 35 42 2D 38 35 36 43 2D 37 45 44 : 29-4E5B-856C-7ED
7102 00000030 : 30 45 46 45 41 37 30 41 43 : 0EFEA70AC
7104 -RAW DUMP--: 0 1 2 3 4 5 6 7 8 9 A B C D E F : (ASCII)
7105 00000000 : 00 00 00 00 00 00 00 00 01 00 00 00 00 00 00 00 : ................
7106 00000010 : 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 : ................
7107 00000020 : 00 00 41 54 54 52 00 81 71 4C 00 00 0E E2 00 00 : ..ATTR..qL......
7108 00000030 : 00 98 00 00 00 39 00 00 00 00 00 00 00 00 00 00 : .....9..........
7109 00000040 : 00 00 00 00 00 01 00 00 00 98 00 00 00 39 00 00 : .............9..
7110 00000050 : 15 63 6F 6D 2E 61 70 70 6C 65 2E 71 75 61 72 61 : .com.apple.quara
7111 00000060 : 6E 74 69 6E 65 00 30 30 38 31 3B 36 32 65 61 33 : ntine.0081;62ea3
7112 00000070 : 37 66 64 3B 43 68 72 6F 6D 65 3B 42 35 39 46 42 : 7fd;Chrome;B59FB
7113 00000080 : 39 45 44 2D 35 41 32 39 2D 34 45 35 42 2D 38 35 : 9ED-5A29-4E5B-85
7114 00000090 : 36 43 2D 37 45 44 30 45 46 45 41 37 30 41 43 00 : 6C-7ED0EFEA70AC.
7115 000000A0 : 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 : ................
7116 000000B0 : 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 : ................
7117 000000C0 : 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 : ................
7118 000000D0 : 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 : ................
7119 000000E0 : 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 : ................
7120 000000F0 : 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 : ................
7121 00000100 : 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 : ................
7122 00000110 : 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 : ................
7123 00000120 : 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 : ................
7124 00000130 : 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 : ................
7125 00000140 : 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 : ................
7126 00000150 : 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 : ................
7127 00000160 : 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 : ................
7128 00000170 : 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 : ................
7129 00000180 : 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 : ................
7130 00000190 : 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 : ................
7131 000001A0 : 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 : ................
7132 000001B0 : 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 : ................
7133 000001C0 : 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 : ................
7134 000001D0 : 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 : ................
7135 000001E0 : 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 : ................
7136 000001F0 : 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 : ................
7137 00000200 : 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 : ................
7138 00000210 : 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 : ................
7139 00000220 : 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 : ................
7140 00000230 : 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 : ................
7141 00000240 : 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 : ................
7142 00000250 : 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 : ................
7143 00000260 : 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 : ................
7144 00000270 : 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 : ................
7145 00000280 : 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 : ................
7146 00000290 : 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 : ................
7147 000002A0 : 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 : ................
7148 000002B0 : 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 : ................
7149 000002C0 : 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 : ................
7150 000002D0 : 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 : ................
7151 000002E0 : 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 : ................
7152 000002F0 : 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 : ................
7153 00000300 : 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 : ................
7154 00000310 : 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 : ................
7155 00000320 : 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 : ................
7156 00000330 : 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 : ................
7157 00000340 : 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 : ................
7158 00000350 : 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 : ................
7159 00000360 : 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 : ................
7160 00000370 : 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 : ................
7161 00000380 : 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 : ................
7162 00000390 : 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 : ................
7163 000003A0 : 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 : ................
7164 000003B0 : 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 : ................
7165 000003C0 : 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 : ................
7166 000003D0 : 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 : ................
7167 000003E0 : 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 : ................
7168 000003F0 : 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 : ................
7169 00000400 : 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 : ................
7170 00000410 : 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 : ................
7171 00000420 : 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 : ................
7172 00000430 : 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 : ................
7173 00000440 : 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 : ................
7174 00000450 : 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 : ................
7175 00000460 : 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 : ................
7176 00000470 : 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 : ................
7177 00000480 : 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 : ................
7178 00000490 : 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 : ................
7179 000004A0 : 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 : ................
7180 000004B0 : 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 : ................
7181 000004C0 : 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 : ................
7182 000004D0 : 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 : ................
7183 000004E0 : 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 : ................
7184 000004F0 : 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 : ................
7185 00000500 : 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 : ................
7186 00000510 : 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 : ................
7187 00000520 : 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 : ................
7188 00000530 : 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 : ................
7189 00000540 : 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 : ................
7190 00000550 : 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 : ................
7191 00000560 : 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 : ................
7192 00000570 : 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 : ................
7193 00000580 : 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 : ................
7194 00000590 : 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 : ................
7195 000005A0 : 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 : ................
7196 000005B0 : 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 : ................
7197 000005C0 : 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 : ................
7198 000005D0 : 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 : ................
7199 000005E0 : 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 : ................
7200 000005F0 : 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 : ................
7201 00000600 : 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 : ................
7202 00000610 : 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 : ................
7203 00000620 : 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 : ................
7204 00000630 : 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 : ................
7205 00000640 : 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 : ................
7206 00000650 : 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 : ................
7207 00000660 : 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 : ................
7208 00000670 : 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 : ................
7209 00000680 : 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 : ................
7210 00000690 : 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 : ................
7211 000006A0 : 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 : ................
7212 000006B0 : 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 : ................
7213 000006C0 : 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 : ................
7214 000006D0 : 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 : ................
7215 000006E0 : 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 : ................
7216 000006F0 : 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 : ................
7217 00000700 : 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 : ................
7218 00000710 : 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 : ................
7219 00000720 : 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 : ................
7220 00000730 : 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 : ................
7221 00000740 : 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 : ................
7222 00000750 : 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 : ................
7223 00000760 : 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 : ................
7224 00000770 : 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 : ................
7225 00000780 : 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 : ................
7226 00000790 : 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 : ................
7227 000007A0 : 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 : ................
7228 000007B0 : 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 : ................
7229 000007C0 : 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 : ................
7230 000007D0 : 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 : ................
7231 000007E0 : 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 : ................
7232 000007F0 : 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 : ................
7233 00000800 : 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 : ................
7234 00000810 : 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 : ................
7235 00000820 : 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 : ................
7236 00000830 : 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 : ................
7237 00000840 : 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 : ................
7238 00000850 : 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 : ................
7239 00000860 : 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 : ................
7240 00000870 : 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 : ................
7241 00000880 : 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 : ................
7242 00000890 : 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 : ................
7243 000008A0 : 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 : ................
7244 000008B0 : 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 : ................
7245 000008C0 : 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 : ................
7246 000008D0 : 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 : ................
7247 000008E0 : 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 : ................
7248 000008F0 : 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 : ................
7249 00000900 : 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 : ................
7250 00000910 : 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 : ................
7251 00000920 : 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 : ................
7252 00000930 : 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 : ................
7253 00000940 : 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 : ................
7254 00000950 : 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 : ................
7255 00000960 : 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 : ................
7256 00000970 : 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 : ................
7257 00000980 : 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 : ................
7258 00000990 : 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 : ................
7259 000009A0 : 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 : ................
7260 000009B0 : 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 : ................
7261 000009C0 : 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 : ................
7262 000009D0 : 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 : ................
7263 000009E0 : 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 : ................
7264 000009F0 : 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 : ................
7265 00000A00 : 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 : ................
7266 00000A10 : 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 : ................
7267 00000A20 : 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 : ................
7268 00000A30 : 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 : ................
7269 00000A40 : 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 : ................
7270 00000A50 : 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 : ................
7271 00000A60 : 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 : ................
7272 00000A70 : 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 : ................
7273 00000A80 : 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 : ................
7274 00000A90 : 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 : ................
7275 00000AA0 : 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 : ................
7276 00000AB0 : 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 : ................
7277 00000AC0 : 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 : ................
7278 00000AD0 : 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 : ................
7279 00000AE0 : 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 : ................
7280 00000AF0 : 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 : ................
7281 00000B00 : 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 : ................
7282 00000B10 : 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 : ................
7283 00000B20 : 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 : ................
7284 00000B30 : 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 : ................
7285 00000B40 : 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 : ................
7286 00000B50 : 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 : ................
7287 00000B60 : 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 : ................
7288 00000B70 : 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 : ................
7289 00000B80 : 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 : ................
7290 00000B90 : 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 : ................
7291 00000BA0 : 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 : ................
7292 00000BB0 : 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 : ................
7293 00000BC0 : 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 : ................
7294 00000BD0 : 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 : ................
7295 00000BE0 : 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 : ................
7296 00000BF0 : 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 : ................
7297 00000C00 : 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 : ................
7298 00000C10 : 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 : ................
7299 00000C20 : 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 : ................
7300 00000C30 : 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 : ................
7301 00000C40 : 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 : ................
7302 00000C50 : 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 : ................
7303 00000C60 : 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 : ................
7304 00000C70 : 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 : ................
7305 00000C80 : 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 : ................
7306 00000C90 : 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 : ................
7307 00000CA0 : 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 : ................
7308 00000CB0 : 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 : ................
7309 00000CC0 : 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 : ................
7310 00000CD0 : 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 : ................
7311 00000CE0 : 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 : ................
7312 00000CF0 : 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 : ................
7313 00000D00 : 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 : ................
7314 00000D10 : 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 : ................
7315 00000D20 : 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 : ................
7316 00000D30 : 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 : ................
7317 00000D40 : 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 : ................
7318 00000D50 : 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 : ................
7319 00000D60 : 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 : ................
7320 00000D70 : 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 : ................
7321 00000D80 : 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 : ................
7322 00000D90 : 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 : ................
7323 00000DA0 : 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 : ................
7324 00000DB0 : 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 : ................
7325 00000DC0 : 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 : ................
7326 00000DD0 : 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 : ................
7327 00000DE0 : 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 : ................
7328 00000DF0 : 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 : ................
7329 00000E00 : 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 : ................
7330 00000E10 : 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 : ................
7331 00000E20 : 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 : ................
7332 00000E30 : 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 : ................
7333 00000E40 : 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 : ................
7334 00000E50 : 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 : ................
7335 00000E60 : 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 : ................
7336 00000E70 : 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 : ................
7337 00000E80 : 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 : ................
7338 00000E90 : 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 : ................
7339 00000EA0 : 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 : ................
7341 -------------------------------------------------------------------------------
7342 Entry ID : 00000002 : Resource Fork
7343 Offset : 00000EE2 : 3810
7344 Length : 0000011E : 286
7346 -RAW DUMP--: 0 1 2 3 4 5 6 7 8 9 A B C D E F : (ASCII)
7347 00000000 : 00 00 01 00 00 00 01 00 00 00 00 00 00 00 00 1E : ................
7348 00000010 : 54 68 69 73 20 72 65 73 6F 75 72 63 65 20 66 6F : This resource fo
7349 00000020 : 72 6B 20 69 6E 74 65 6E 74 69 6F 6E 61 6C 6C 79 : rk intentionally
7350 00000030 : 20 6C 65 66 74 20 62 6C 61 6E 6B 20 20 20 00 00 : left blank ..
7351 00000040 : 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 : ................
7352 00000050 : 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 : ................
7353 00000060 : 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 : ................
7354 00000070 : 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 : ................
7355 00000080 : 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 : ................
7356 00000090 : 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 : ................
7357 000000A0 : 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 : ................
7358 000000B0 : 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 : ................
7359 000000C0 : 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 : ................
7360 000000D0 : 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 : ................
7361 000000E0 : 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 : ................
7362 000000F0 : 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 : ................
7363 00000100 : 00 00 01 00 00 00 01 00 00 00 00 00 00 00 00 1E : ................
7364 00000110 : 00 00 00 00 00 00 00 00 00 1C 00 1E FF FF : ..............
7367 static char osx_adouble_dir_w_xattr[] = {
7368 0x00, 0x05, 0x16, 0x07, 0x00, 0x02, 0x00, 0x00,
7369 0x4d, 0x61, 0x63, 0x20, 0x4f, 0x53, 0x20, 0x58,
7370 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
7371 0x00, 0x02, 0x00, 0x00, 0x00, 0x09, 0x00, 0x00,
7372 0x00, 0x32, 0x00, 0x00, 0x0e, 0xb0, 0x00, 0x00,
7373 0x00, 0x02, 0x00, 0x00, 0x0e, 0xe2, 0x00, 0x00,
7374 0x01, 0x1e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
7375 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00,
7376 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
7377 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
7378 0x00, 0x00, 0x00, 0x00, 0x41, 0x54, 0x54, 0x52,
7379 0x00, 0x81, 0x71, 0x4c, 0x00, 0x00, 0x0e, 0xe2,
7380 0x00, 0x00, 0x00, 0x98, 0x00, 0x00, 0x00, 0x39,
7381 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
7382 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01,
7383 0x00, 0x00, 0x00, 0x98, 0x00, 0x00, 0x00, 0x39,
7384 0x00, 0x00, 0x15, 0x63, 0x6f, 0x6d, 0x2e, 0x61,
7385 0x70, 0x70, 0x6c, 0x65, 0x2e, 0x71, 0x75, 0x61,
7386 0x72, 0x61, 0x6e, 0x74, 0x69, 0x6e, 0x65, 0x00,
7387 0x30, 0x30, 0x38, 0x31, 0x3b, 0x36, 0x32, 0x65,
7388 0x61, 0x33, 0x37, 0x66, 0x64, 0x3b, 0x43, 0x68,
7389 0x72, 0x6f, 0x6d, 0x65, 0x3b, 0x42, 0x35, 0x39,
7390 0x46, 0x42, 0x39, 0x45, 0x44, 0x2d, 0x35, 0x41,
7391 0x32, 0x39, 0x2d, 0x34, 0x45, 0x35, 0x42, 0x2d,
7392 0x38, 0x35, 0x36, 0x43, 0x2d, 0x37, 0x45, 0x44,
7393 0x30, 0x45, 0x46, 0x45, 0x41, 0x37, 0x30, 0x41,
7394 0x43, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
7395 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
7396 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
7397 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
7398 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
7399 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
7400 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
7401 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
7402 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
7403 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
7404 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
7405 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
7406 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
7407 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
7408 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
7409 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
7410 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
7411 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
7412 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
7413 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
7414 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
7415 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
7416 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
7417 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
7418 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
7419 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
7420 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
7421 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
7422 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
7423 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
7424 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
7425 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
7426 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
7427 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
7428 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
7429 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
7430 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
7431 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
7432 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
7433 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
7434 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
7435 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
7436 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
7437 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
7438 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
7439 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
7440 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
7441 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
7442 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
7443 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
7444 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
7445 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
7446 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
7447 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
7448 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
7449 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
7450 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
7451 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
7452 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
7453 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
7454 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
7455 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
7456 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
7457 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
7458 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
7459 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
7460 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
7461 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
7462 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
7463 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
7464 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
7465 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
7466 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
7467 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
7468 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
7469 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
7470 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
7471 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
7472 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
7473 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
7474 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
7475 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
7476 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
7477 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
7478 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
7479 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
7480 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
7481 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
7482 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
7483 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
7484 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
7485 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
7486 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
7487 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
7488 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
7489 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
7490 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
7491 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
7492 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
7493 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
7494 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
7495 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
7496 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
7497 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
7498 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
7499 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
7500 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
7501 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
7502 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
7503 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
7504 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
7505 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
7506 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
7507 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
7508 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
7509 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
7510 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
7511 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
7512 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
7513 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
7514 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
7515 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
7516 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
7517 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
7518 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
7519 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
7520 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
7521 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
7522 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
7523 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
7524 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
7525 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
7526 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
7527 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
7528 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
7529 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
7530 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
7531 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
7532 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
7533 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
7534 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
7535 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
7536 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
7537 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
7538 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
7539 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
7540 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
7541 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
7542 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
7543 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
7544 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
7545 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
7546 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
7547 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
7548 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
7549 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
7550 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
7551 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
7552 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
7553 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
7554 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
7555 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
7556 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
7557 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
7558 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
7559 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
7560 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
7561 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
7562 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
7563 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
7564 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
7565 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
7566 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
7567 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
7568 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
7569 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
7570 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
7571 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
7572 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
7573 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
7574 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
7575 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
7576 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
7577 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
7578 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
7579 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
7580 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
7581 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
7582 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
7583 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
7584 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
7585 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
7586 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
7587 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
7588 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
7589 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
7590 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
7591 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
7592 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
7593 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
7594 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
7595 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
7596 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
7597 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
7598 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
7599 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
7600 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
7601 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
7602 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
7603 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
7604 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
7605 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
7606 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
7607 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
7608 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
7609 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
7610 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
7611 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
7612 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
7613 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
7614 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
7615 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
7616 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
7617 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
7618 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
7619 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
7620 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
7621 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
7622 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
7623 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
7624 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
7625 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
7626 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
7627 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
7628 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
7629 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
7630 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
7631 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
7632 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
7633 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
7634 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
7635 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
7636 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
7637 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
7638 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
7639 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
7640 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
7641 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
7642 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
7643 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
7644 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
7645 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
7646 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
7647 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
7648 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
7649 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
7650 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
7651 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
7652 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
7653 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
7654 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
7655 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
7656 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
7657 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
7658 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
7659 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
7660 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
7661 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
7662 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
7663 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
7664 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
7665 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
7666 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
7667 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
7668 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
7669 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
7670 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
7671 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
7672 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
7673 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
7674 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
7675 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
7676 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
7677 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
7678 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
7679 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
7680 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
7681 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
7682 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
7683 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
7684 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
7685 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
7686 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
7687 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
7688 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
7689 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
7690 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
7691 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
7692 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
7693 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
7694 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
7695 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
7696 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
7697 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
7698 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
7699 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
7700 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
7701 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
7702 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
7703 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
7704 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
7705 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
7706 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
7707 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
7708 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
7709 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
7710 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
7711 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
7712 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
7713 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
7714 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
7715 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
7716 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
7717 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
7718 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
7719 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
7720 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
7721 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
7722 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
7723 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
7724 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
7725 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
7726 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
7727 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
7728 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
7729 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
7730 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
7731 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
7732 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
7733 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
7734 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
7735 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
7736 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
7737 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
7738 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
7739 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
7740 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
7741 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
7742 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
7743 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
7744 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
7745 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
7746 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
7747 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
7748 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
7749 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
7750 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
7751 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
7752 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
7753 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
7754 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
7755 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
7756 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
7757 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
7758 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
7759 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
7760 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
7761 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
7762 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
7763 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
7764 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
7765 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
7766 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
7767 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
7768 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
7769 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
7770 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
7771 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
7772 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
7773 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
7774 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
7775 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
7776 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
7777 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
7778 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
7779 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
7780 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
7781 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
7782 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
7783 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
7784 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
7785 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
7786 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
7787 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
7788 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
7789 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
7790 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
7791 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
7792 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
7793 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
7794 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
7795 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
7796 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
7797 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
7798 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
7799 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
7800 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
7801 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
7802 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
7803 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
7804 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
7805 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
7806 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
7807 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
7808 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
7809 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
7810 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
7811 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
7812 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
7813 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
7814 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
7815 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
7816 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
7817 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
7818 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
7819 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
7820 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
7821 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
7822 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
7823 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
7824 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
7825 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
7826 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
7827 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
7828 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
7829 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
7830 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
7831 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
7832 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
7833 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
7834 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
7835 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
7836 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
7837 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
7838 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
7839 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
7840 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
7841 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
7842 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
7843 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
7844 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00,
7845 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
7846 0x00, 0x1e, 0x54, 0x68, 0x69, 0x73, 0x20, 0x72,
7847 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x20,
7848 0x66, 0x6f, 0x72, 0x6b, 0x20, 0x69, 0x6e, 0x74,
7849 0x65, 0x6e, 0x74, 0x69, 0x6f, 0x6e, 0x61, 0x6c,
7850 0x6c, 0x79, 0x20, 0x6c, 0x65, 0x66, 0x74, 0x20,
7851 0x62, 0x6c, 0x61, 0x6e, 0x6b, 0x20, 0x20, 0x20,
7852 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
7853 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
7854 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
7855 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
7856 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
7857 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
7858 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
7859 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
7860 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
7861 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
7862 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
7863 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
7864 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
7865 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
7866 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
7867 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
7868 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
7869 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
7870 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
7871 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
7872 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
7873 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
7874 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
7875 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
7876 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00,
7877 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
7878 0x00, 0x1e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
7879 0x00, 0x00, 0x00, 0x1c, 0x00, 0x1e, 0xff, 0xff
7882 static bool test_delete_trigger_convert_sharing_violation(
7883 struct torture_context *tctx,
7884 struct smb2_tree *tree1)
7886 TALLOC_CTX *mem_ctx = talloc_new(tctx);
7887 const char *dirname = BASEDIR "\\dir";
7888 const char *adname = BASEDIR "\\._dir";
7889 struct smb2_handle testdirh;
7890 struct smb2_create create;
7891 AfpInfo *info = NULL;
7892 bool ret = true;
7893 NTSTATUS status;
7895 smb2_deltree(tree1, BASEDIR);
7897 status = torture_smb2_testdir(tree1, BASEDIR, &testdirh);
7898 torture_assert_ntstatus_ok_goto(tctx, status, ret, done,
7899 "torture_smb2_testdir failed\n");
7900 smb2_util_close(tree1, testdirh);
7902 status = torture_smb2_testdir(tree1, dirname, &testdirh);
7903 torture_assert_ntstatus_ok_goto(tctx, status, ret, done,
7904 "torture_smb2_testdir failed\n");
7905 smb2_util_close(tree1, testdirh);
7907 ret = torture_setup_file(tctx, tree1, adname, false);
7908 torture_assert_goto(tctx, ret == true, ret, done,
7909 "torture_setup_file failed\n");
7911 ret = write_stream(tree1, __location__, tctx, mem_ctx,
7912 adname, NULL, 0,
7913 sizeof(osx_adouble_dir_w_xattr),
7914 osx_adouble_dir_w_xattr);
7915 torture_assert_goto(tctx, ret == true, ret, done,
7916 "write_stream failed\n");
7919 * 1) Create a non-empty AFP_AfpInfo stream
7922 info = torture_afpinfo_new(mem_ctx);
7923 torture_assert_goto(tctx, info != NULL, ret, done, "torture_afpinfo_new failed");
7925 /* Set "Inited" flag (any other would do too) */
7926 info->afpi_FinderInfo[8] = 0x01;
7928 ret = torture_write_afpinfo(tree1, tctx, mem_ctx, dirname, info);
7929 torture_assert_goto(tctx, ret == true, ret, done, "torture_write_afpinfo failed");
7931 ret = write_stream(tree1, __location__, tctx, mem_ctx,
7932 adname, NULL, 0,
7933 sizeof(osx_adouble_dir_w_xattr),
7934 osx_adouble_dir_w_xattr);
7935 torture_assert_goto(tctx, ret == true, ret, done,
7936 "write_stream failed\n");
7939 * 2) Create a second stream
7942 ret = write_stream(tree1, __location__, tctx, mem_ctx,
7943 dirname, ":org.samba.boom", 0,
7944 strlen("boom"),
7945 "boom");
7946 torture_assert_goto(tctx, ret == true, ret, done,
7947 "write_stream failed\n");
7949 create = (struct smb2_create) {
7950 .in.desired_access = SEC_STD_DELETE,
7951 .in.create_options = NTCREATEX_OPTIONS_DIRECTORY,
7952 .in.file_attributes = FILE_ATTRIBUTE_DIRECTORY,
7953 .in.share_access = NTCREATEX_SHARE_ACCESS_READ,
7954 .in.create_disposition = NTCREATEX_DISP_OPEN,
7955 .in.impersonation_level = SMB2_IMPERSONATION_ANONYMOUS,
7956 .in.fname = dirname,
7959 status = smb2_create(tree1, tctx, &create);
7960 torture_assert_ntstatus_ok_goto(tctx, status, ret, done,
7961 "smb2_create failed\n");
7963 status = smb2_util_close(tree1, create.out.file.handle);
7964 torture_assert_ntstatus_ok_goto(tctx, status, ret, done,
7965 "smb2_util_close failed");
7967 done:
7968 smb2_deltree(tree1, BASEDIR);
7969 talloc_free(mem_ctx);
7970 return ret;
7974 * Note: This test depends on "vfs objects = catia fruit streams_xattr". For
7975 * some tests torture must be run on the host it tests and takes an additional
7976 * argument with the local path to the share:
7977 * "--option=torture:localdir=<SHAREPATH>".
7979 * When running against an OS X SMB server add "--option=torture:osx=true"
7981 struct torture_suite *torture_vfs_fruit(TALLOC_CTX *ctx)
7983 struct torture_suite *suite = torture_suite_create(
7984 ctx, "fruit");
7986 suite->description = talloc_strdup(suite, "vfs_fruit tests");
7988 torture_suite_add_1smb2_test(suite, "copyfile", test_copyfile);
7989 torture_suite_add_1smb2_test(suite, "read metadata", test_read_afpinfo);
7990 torture_suite_add_1smb2_test(suite, "write metadata", test_write_atalk_metadata);
7991 torture_suite_add_1smb2_test(suite, "resource fork IO", test_write_atalk_rfork_io);
7992 torture_suite_add_1smb2_test(suite, "SMB2/CREATE context AAPL", test_aapl);
7993 torture_suite_add_1smb2_test(suite, "stream names", test_stream_names);
7994 torture_suite_add_1smb2_test(suite, "truncate resource fork to 0 bytes", test_rfork_truncate);
7995 torture_suite_add_1smb2_test(suite, "opening and creating resource fork", test_rfork_create);
7996 torture_suite_add_1smb2_test(suite, "fsync_resource_fork", test_rfork_fsync);
7997 torture_suite_add_1smb2_test(suite, "rename_dir_openfile", test_rename_dir_openfile);
7998 torture_suite_add_1smb2_test(suite, "File without AFP_AfpInfo", test_afpinfo_enoent);
7999 torture_suite_add_1smb2_test(suite, "create delete-on-close AFP_AfpInfo", test_create_delete_on_close);
8000 torture_suite_add_1smb2_test(suite, "setinfo delete-on-close AFP_AfpInfo", test_setinfo_delete_on_close);
8001 torture_suite_add_1smb2_test(suite, "setinfo eof AFP_AfpInfo", test_setinfo_eof);
8002 torture_suite_add_1smb2_test(suite, "delete AFP_AfpInfo by writing all 0", test_afpinfo_all0);
8003 torture_suite_add_1smb2_test(suite, "create delete-on-close AFP_AfpResource", test_create_delete_on_close_resource);
8004 torture_suite_add_1smb2_test(suite, "setinfo delete-on-close AFP_AfpResource", test_setinfo_delete_on_close_resource);
8005 torture_suite_add_1smb2_test(suite, "setinfo eof AFP_AfpResource", test_setinfo_eof_resource);
8006 torture_suite_add_1smb2_test(suite, "setinfo eof stream", test_setinfo_stream_eof);
8007 torture_suite_add_1smb2_test(suite, "null afpinfo", test_null_afpinfo);
8008 torture_suite_add_1smb2_test(suite, "delete", test_delete_file_with_rfork);
8009 torture_suite_add_1smb2_test(suite, "read open rsrc after rename", test_rename_and_read_rsrc);
8010 torture_suite_add_1smb2_test(suite, "readdir_attr with names with illegal ntfs characters", test_readdir_attr_illegal_ntfs);
8011 torture_suite_add_2ns_smb2_test(suite, "invalid AFP_AfpInfo", test_invalid_afpinfo);
8012 torture_suite_add_1smb2_test(suite, "creating rsrc with read-only access", test_rfork_create_ro);
8013 torture_suite_add_1smb2_test(suite, "copy-chunk streams", test_copy_chunk_streams);
8014 torture_suite_add_1smb2_test(suite, "OS X AppleDouble file conversion", test_adouble_conversion);
8015 torture_suite_add_1smb2_test(suite, "NFS ACE entries", test_nfs_aces);
8016 torture_suite_add_1smb2_test(suite, "OS X AppleDouble file conversion without embedded xattr", test_adouble_conversion_wo_xattr);
8017 torture_suite_add_1smb2_test(suite, "empty_stream", test_empty_stream);
8018 torture_suite_add_1smb2_test(suite, "writing_afpinfo", test_writing_afpinfo);
8019 torture_suite_add_1smb2_test(suite, "delete_trigger_convert_sharing_violation", test_delete_trigger_convert_sharing_violation);
8021 return suite;
8024 static bool test_stream_names_local(struct torture_context *tctx,
8025 struct smb2_tree *tree)
8027 TALLOC_CTX *mem_ctx = talloc_new(tctx);
8028 NTSTATUS status;
8029 struct smb2_create create;
8030 struct smb2_handle h;
8031 const char *fname = BASEDIR "\\stream_names.txt";
8032 const char *sname1;
8033 bool ret;
8034 /* UTF8 private use are starts at 0xef 0x80 0x80 (0xf000) */
8035 const char *streams[] = {
8036 ":foo" "\xef\x80\xa2" "bar:$DATA", /* "foo:bar:$DATA" */
8037 ":bar" "\xef\x80\xa2" "baz:$DATA", /* "bar:baz:$DATA" */
8038 "::$DATA"
8040 const char *localdir = NULL;
8042 localdir = torture_setting_string(tctx, "localdir", NULL);
8043 if (localdir == NULL) {
8044 torture_skip(tctx, "Need localdir for test");
8047 sname1 = talloc_asprintf(mem_ctx, "%s%s", fname, streams[0]);
8049 /* clean slate ...*/
8050 smb2_util_unlink(tree, fname);
8051 smb2_deltree(tree, fname);
8052 smb2_deltree(tree, BASEDIR);
8054 status = torture_smb2_testdir(tree, BASEDIR, &h);
8055 CHECK_STATUS(status, NT_STATUS_OK);
8056 smb2_util_close(tree, h);
8058 torture_comment(tctx, "(%s) testing stream names\n", __location__);
8059 ZERO_STRUCT(create);
8060 create.in.desired_access = SEC_FILE_WRITE_DATA;
8061 create.in.file_attributes = FILE_ATTRIBUTE_NORMAL;
8062 create.in.share_access =
8063 NTCREATEX_SHARE_ACCESS_DELETE|
8064 NTCREATEX_SHARE_ACCESS_READ|
8065 NTCREATEX_SHARE_ACCESS_WRITE;
8066 create.in.create_disposition = NTCREATEX_DISP_CREATE;
8067 create.in.impersonation_level = SMB2_IMPERSONATION_ANONYMOUS;
8068 create.in.fname = sname1;
8070 status = smb2_create(tree, mem_ctx, &create);
8071 CHECK_STATUS(status, NT_STATUS_OK);
8073 status = smb2_util_write(tree, create.out.file.handle, "foo", 0, 3);
8074 torture_assert_ntstatus_ok_goto(tctx, status, ret, done,
8075 "smb2_util_write failed\n");
8077 smb2_util_close(tree, create.out.file.handle);
8079 ret = torture_setup_local_xattr(tctx, "localdir", BASEDIR "/stream_names.txt",
8080 "user.DosStream.bar:baz:$DATA",
8081 "data", strlen("data"));
8082 CHECK_VALUE(ret, true);
8084 ret = check_stream_list(tree, tctx, fname, 3, streams, false);
8085 CHECK_VALUE(ret, true);
8087 done:
8088 status = smb2_util_unlink(tree, fname);
8089 smb2_deltree(tree, BASEDIR);
8090 talloc_free(mem_ctx);
8092 return ret;
8095 static bool test_fruit_locking_conflict(struct torture_context *tctx,
8096 struct smb2_tree *tree,
8097 struct smb2_tree *tree2)
8099 TALLOC_CTX *mem_ctx;
8100 struct smb2_create create;
8101 struct smb2_handle h;
8102 struct smb2_lock lck;
8103 struct smb2_lock_element el;
8104 const char *fname = BASEDIR "\\locking_conflict.txt";
8105 NTSTATUS status;
8106 bool ret = false;
8108 mem_ctx = talloc_new(tctx);
8109 torture_assert_not_null(tctx, mem_ctx, "talloc_new failed");
8111 /* clean slate ...*/
8112 smb2_util_unlink(tree, fname);
8113 smb2_deltree(tree, fname);
8114 smb2_deltree(tree, BASEDIR);
8116 status = torture_smb2_testdir(tree, BASEDIR, &h);
8117 CHECK_STATUS(status, NT_STATUS_OK);
8118 smb2_util_close(tree, h);
8120 create = (struct smb2_create) {
8121 .in.desired_access = SEC_RIGHTS_FILE_READ,
8122 .in.file_attributes = FILE_ATTRIBUTE_NORMAL,
8123 .in.share_access =
8124 NTCREATEX_SHARE_ACCESS_READ|
8125 NTCREATEX_SHARE_ACCESS_WRITE,
8126 .in.create_disposition = NTCREATEX_DISP_CREATE,
8127 .in.impersonation_level = SMB2_IMPERSONATION_ANONYMOUS,
8128 .in.fname = fname,
8131 status = smb2_create(tree, mem_ctx, &create);
8132 CHECK_STATUS(status, NT_STATUS_OK);
8133 h = create.out.file.handle;
8135 /* Add AD_FILELOCK_RSRC_DENY_WR lock. */
8136 el = (struct smb2_lock_element) {
8137 .offset = 0xfffffffffffffffc,
8138 .length = 1,
8139 .flags = SMB2_LOCK_FLAG_EXCLUSIVE,
8141 lck = (struct smb2_lock) {
8142 .in.lock_count = 1,
8143 .in.file.handle = h,
8144 .in.locks = &el,
8148 * Lock up to and including:
8149 * AD_FILELOCK_OPEN_WR
8150 * AD_FILELOCK_OPEN_RD
8151 * This is designed to cause a NetAtalk
8152 * locking conflict on the next open,
8153 * even though the share modes are
8154 * compatible.
8156 status = smb2_lock(tree, &lck);
8157 CHECK_STATUS(status, NT_STATUS_OK);
8159 el = (struct smb2_lock_element) {
8160 .offset = 0,
8161 .length = 0x7ffffffffffffff7,
8162 .flags = SMB2_LOCK_FLAG_EXCLUSIVE,
8164 status = smb2_lock(tree, &lck);
8165 CHECK_STATUS(status, NT_STATUS_OK);
8167 create = (struct smb2_create) {
8168 .in.desired_access =
8169 SEC_RIGHTS_FILE_READ|SEC_RIGHTS_FILE_WRITE,
8170 .in.file_attributes = FILE_ATTRIBUTE_NORMAL,
8171 .in.share_access = NTCREATEX_SHARE_ACCESS_READ,
8172 .in.create_disposition = NTCREATEX_DISP_OPEN,
8173 .in.impersonation_level = SMB2_IMPERSONATION_ANONYMOUS,
8174 .in.fname = fname,
8178 * Open on the second tree - ensure we are
8179 * emulating trying to access with a NetATalk
8180 * process with an existing open/deny mode.
8182 status = smb2_create(tree2, mem_ctx, &create);
8183 CHECK_STATUS(status, NT_STATUS_SHARING_VIOLATION);
8186 struct smb2_close cl = {
8187 .level = RAW_CLOSE_SMB2,
8188 .in.file.handle = h,
8190 smb2_close(tree, &cl);
8193 ret = true;
8194 done:
8195 return ret;
8198 struct torture_suite *torture_vfs_fruit_netatalk(TALLOC_CTX *ctx)
8200 struct torture_suite *suite = torture_suite_create(
8201 ctx, "fruit_netatalk");
8203 suite->description = talloc_strdup(suite, "vfs_fruit tests for Netatalk interop that require fruit:metadata=netatalk");
8205 torture_suite_add_1smb2_test(suite, "read netatalk metadata", test_read_netatalk_metadata);
8206 torture_suite_add_1smb2_test(suite, "stream names with locally created xattr", test_stream_names_local);
8207 torture_suite_add_2smb2_test(
8208 suite, "locking conflict", test_fruit_locking_conflict);
8210 return suite;
8213 struct torture_suite *torture_vfs_fruit_file_id(TALLOC_CTX *ctx)
8215 struct torture_suite *suite =
8216 torture_suite_create(ctx, "fruit_file_id");
8218 suite->description =
8219 talloc_strdup(suite, "vfs_fruit tests for on-disk file ID that "
8220 "require fruit:zero_file_id=yes");
8222 torture_suite_add_1smb2_test(suite, "zero file id if AAPL negotiated",
8223 test_zero_file_id);
8225 return suite;
8228 static bool test_timemachine_volsize(struct torture_context *tctx,
8229 struct smb2_tree *tree)
8231 TALLOC_CTX *mem_ctx = talloc_new(tctx);
8232 struct smb2_handle h = {{0}};
8233 union smb_fsinfo fsinfo;
8234 NTSTATUS status;
8235 bool ok = true;
8236 const char *info_plist =
8237 "<dict>\n"
8238 " <key>band-size</key>\n"
8239 " <integer>8192</integer>\n"
8240 "</dict>\n";
8242 smb2_deltree(tree, "test.sparsebundle");
8244 ok = enable_aapl(tctx, tree);
8245 torture_assert_goto(tctx, ok, ok, done, "enable_aapl failed");
8247 status = smb2_util_mkdir(tree, "test.sparsebundle");
8248 torture_assert_ntstatus_ok_goto(tctx, status, ok, done,
8249 "smb2_util_mkdir\n");
8251 ok = write_stream(tree, __location__, tctx, mem_ctx,
8252 "test.sparsebundle/Info.plist", NULL,
8253 0, strlen(info_plist), info_plist);
8254 torture_assert_goto(tctx, ok, ok, done, "write_stream failed\n");
8256 status = smb2_util_mkdir(tree, "test.sparsebundle/bands");
8257 torture_assert_ntstatus_ok_goto(tctx, status, ok, done,
8258 "smb2_util_mkdir\n");
8260 ok = torture_setup_file(tctx, tree, "test.sparsebundle/bands/1", false);
8261 torture_assert_goto(tctx, ok, ok, done, "torture_setup_file failed\n");
8263 ok = torture_setup_file(tctx, tree, "test.sparsebundle/bands/2", false);
8264 torture_assert_goto(tctx, ok, ok, done, "torture_setup_file failed\n");
8266 status = smb2_util_roothandle(tree, &h);
8267 torture_assert_ntstatus_ok(tctx, status, "Unable to create root handle");
8269 ZERO_STRUCT(fsinfo);
8270 fsinfo.generic.level = RAW_QFS_SIZE_INFORMATION;
8271 fsinfo.generic.handle = h;
8273 status = smb2_getinfo_fs(tree, tree, &fsinfo);
8274 torture_assert_ntstatus_ok(tctx, status, "smb2_getinfo_fs failed");
8276 torture_comment(tctx, "sectors_per_unit: %" PRIu32"\n"
8277 "bytes_per_sector: %" PRIu32"\n"
8278 "total_alloc_units: %" PRIu64"\n"
8279 "avail_alloc_units: %" PRIu64"\n",
8280 fsinfo.size_info.out.sectors_per_unit,
8281 fsinfo.size_info.out.bytes_per_sector,
8282 fsinfo.size_info.out.total_alloc_units,
8283 fsinfo.size_info.out.avail_alloc_units);
8286 * Let me explain the numbers:
8288 * - the share is set to "fruit:time machine max size = 32K"
8289 * - we've faked a bandsize of 8 K in the Info.plist file
8290 * - we've created two bands files
8291 * - one allocation unit is made of two sectors with 512 B each
8292 * => we've consumed 16 allocation units, there should be 16 free
8295 torture_assert_goto(tctx, fsinfo.size_info.out.sectors_per_unit == 2,
8296 ok, done, "Bad sectors_per_unit");
8298 torture_assert_goto(tctx, fsinfo.size_info.out.bytes_per_sector == 512,
8299 ok, done, "Bad bytes_per_sector");
8301 torture_assert_goto(tctx, fsinfo.size_info.out.total_alloc_units == 32,
8302 ok, done, "Bad total_alloc_units");
8304 torture_assert_goto(tctx, fsinfo.size_info.out.avail_alloc_units == 16,
8305 ok, done, "Bad avail_alloc_units");
8307 done:
8308 if (!smb2_util_handle_empty(h)) {
8309 smb2_util_close(tree, h);
8311 smb2_deltree(tree, "test.sparsebundle");
8312 talloc_free(mem_ctx);
8313 return ok;
8316 struct torture_suite *torture_vfs_fruit_timemachine(TALLOC_CTX *ctx)
8318 struct torture_suite *suite = torture_suite_create(
8319 ctx, "fruit_timemachine");
8321 suite->description = talloc_strdup(
8322 suite, "vfs_fruit tests for TimeMachine");
8324 torture_suite_add_1smb2_test(suite, "Timemachine-volsize",
8325 test_timemachine_volsize);
8327 return suite;
8330 static bool test_convert_xattr_and_empty_rfork_then_delete(
8331 struct torture_context *tctx,
8332 struct smb2_tree *tree1,
8333 struct smb2_tree *tree2)
8335 TALLOC_CTX *mem_ctx = talloc_new(tctx);
8336 const char *fname = BASEDIR "\\test_adouble_conversion";
8337 const char *adname = BASEDIR "/._test_adouble_conversion";
8338 const char *rfork = BASEDIR "\\test_adouble_conversion" AFPRESOURCE_STREAM_NAME;
8339 NTSTATUS status;
8340 struct smb2_handle testdirh;
8341 bool ret = true;
8342 const char *streams[] = {
8343 "::$DATA",
8344 AFPINFO_STREAM,
8345 ":com.apple.metadata" "\xef\x80\xa2" "_kMDItemUserTags:$DATA",
8346 ":foo" "\xef\x80\xa2" "bar:$DATA", /* "foo:bar:$DATA" */
8348 struct smb2_create create;
8349 struct smb2_find find;
8350 unsigned int count;
8351 union smb_search_data *d;
8352 bool delete_empty_adfiles;
8353 int expected_num_files;
8355 delete_empty_adfiles = torture_setting_bool(tctx,
8356 "delete_empty_adfiles",
8357 false);
8359 smb2_deltree(tree1, BASEDIR);
8361 status = torture_smb2_testdir(tree1, BASEDIR, &testdirh);
8362 torture_assert_ntstatus_ok_goto(tctx, status, ret, done,
8363 "torture_smb2_testdir failed\n");
8364 smb2_util_close(tree1, testdirh);
8366 ret = torture_setup_file(tctx, tree1, fname, false);
8367 torture_assert_goto(tctx, ret == true, ret, done,
8368 "torture_setup_file failed\n");
8370 ret = torture_setup_file(tctx, tree1, adname, false);
8371 torture_assert_goto(tctx, ret == true, ret, done,
8372 "torture_setup_file failed\n");
8374 ret = write_stream(tree1, __location__, tctx, mem_ctx,
8375 adname, NULL,
8376 0, sizeof(osx_adouble_w_xattr), osx_adouble_w_xattr);
8377 torture_assert_goto(tctx, ret == true, ret, done,
8378 "write_stream failed\n");
8380 ret = enable_aapl(tctx, tree2);
8381 torture_assert_goto(tctx, ret == true, ret, done, "enable_aapl failed");
8384 * Issue a smb2_find(), this triggers the server-side conversion
8387 create = (struct smb2_create) {
8388 .in.desired_access = SEC_RIGHTS_DIR_READ,
8389 .in.create_options = NTCREATEX_OPTIONS_DIRECTORY,
8390 .in.file_attributes = FILE_ATTRIBUTE_DIRECTORY,
8391 .in.share_access = NTCREATEX_SHARE_ACCESS_READ,
8392 .in.create_disposition = NTCREATEX_DISP_OPEN,
8393 .in.impersonation_level = SMB2_IMPERSONATION_ANONYMOUS,
8394 .in.fname = BASEDIR,
8397 status = smb2_create(tree2, tctx, &create);
8398 torture_assert_ntstatus_ok_goto(tctx, status, ret, done,
8399 "smb2_create failed\n");
8401 find = (struct smb2_find) {
8402 .in.file.handle = create.out.file.handle,
8403 .in.pattern = "*",
8404 .in.max_response_size = 0x1000,
8405 .in.level = SMB2_FIND_ID_BOTH_DIRECTORY_INFO,
8408 status = smb2_find_level(tree2, tree2, &find, &count, &d);
8409 torture_assert_ntstatus_ok_goto(tctx, status, ret, done,
8410 "smb2_find_level failed\n");
8412 status = smb2_util_close(tree2, create.out.file.handle);
8413 torture_assert_ntstatus_ok_goto(tctx, status, ret, done,
8414 "smb2_util_close failed");
8417 * Check number of streams
8420 ret = check_stream_list(tree2, tctx, fname, 4, streams, false);
8421 torture_assert_goto(tctx, ret == true, ret, done, "check_stream_list");
8424 * Check Resource Fork is gone
8427 create = (struct smb2_create) {
8428 .in.desired_access = SEC_RIGHTS_FILE_READ|SEC_RIGHTS_FILE_WRITE,
8429 .in.file_attributes = FILE_ATTRIBUTE_NORMAL,
8430 .in.share_access = NTCREATEX_SHARE_ACCESS_READ,
8431 .in.create_disposition = NTCREATEX_DISP_OPEN,
8432 .in.impersonation_level = SMB2_IMPERSONATION_ANONYMOUS,
8433 .in.fname = rfork,
8436 status = smb2_create(tree2, mem_ctx, &create);
8437 torture_assert_ntstatus_equal_goto(
8438 tctx, status, NT_STATUS_OBJECT_NAME_NOT_FOUND,
8439 ret, done, "Bad smb2_create return\n");
8442 * Check xattr data has been migrated from the AppleDouble file to
8443 * streams.
8446 ret = check_stream(tree2, __location__, tctx, mem_ctx,
8447 fname, AFPINFO_STREAM,
8448 0, 60, 16, 8, "TESTSLOW");
8449 torture_assert_goto(tctx, ret == true, ret, done,
8450 "check AFPINFO_STREAM failed\n");
8452 ret = check_stream(tree2, __location__, tctx, mem_ctx,
8453 fname, ":foo" "\xef\x80\xa2" "bar", /* foo:bar */
8454 0, 3, 0, 3, "baz");
8455 torture_assert_goto(tctx, ret == true, ret, done,
8456 "check foo stream failed\n");
8459 * Now check number of files. If delete_empty_adfiles is set, the
8460 * AppleDouble files should have been deleted.
8463 create = (struct smb2_create) {
8464 .in.desired_access = SEC_RIGHTS_DIR_READ,
8465 .in.create_options = NTCREATEX_OPTIONS_DIRECTORY,
8466 .in.file_attributes = FILE_ATTRIBUTE_DIRECTORY,
8467 .in.share_access = NTCREATEX_SHARE_ACCESS_READ,
8468 .in.create_disposition = NTCREATEX_DISP_OPEN,
8469 .in.impersonation_level = SMB2_IMPERSONATION_ANONYMOUS,
8470 .in.fname = BASEDIR,
8473 status = smb2_create(tree2, tctx, &create);
8474 torture_assert_ntstatus_ok_goto(tctx, status, ret, done,
8475 "smb2_create failed\n");
8477 find = (struct smb2_find) {
8478 .in.file.handle = create.out.file.handle,
8479 .in.pattern = "*",
8480 .in.max_response_size = 0x1000,
8481 .in.level = SMB2_FIND_ID_BOTH_DIRECTORY_INFO,
8484 status = smb2_find_level(tree2, tree2, &find, &count, &d);
8485 torture_assert_ntstatus_ok_goto(tctx, status, ret, done,
8486 "smb2_find_level failed\n");
8488 status = smb2_util_close(tree2, create.out.file.handle);
8489 torture_assert_ntstatus_ok_goto(tctx, status, ret, done,
8490 "smb2_util_close failed");
8492 if (delete_empty_adfiles) {
8493 expected_num_files = 3;
8494 } else {
8495 expected_num_files = 4;
8497 torture_assert_int_equal_goto(tctx, count, expected_num_files, ret, done,
8498 "Wrong number of files\n");
8500 done:
8501 smb2_deltree(tree1, BASEDIR);
8502 talloc_free(mem_ctx);
8503 return ret;
8506 struct torture_suite *torture_vfs_fruit_conversion(TALLOC_CTX *ctx)
8508 struct torture_suite *suite = torture_suite_create(
8509 ctx, "fruit_conversion");
8511 suite->description = talloc_strdup(
8512 suite, "vfs_fruit conversion tests");
8514 torture_suite_add_2ns_smb2_test(
8515 suite, "convert_xattr_and_empty_rfork_then_delete",
8516 test_convert_xattr_and_empty_rfork_then_delete);
8518 return suite;
8522 * The buf below contains the following AppleDouble encoded data:
8524 * -----------------------------------------------------------------------------
8525 * MagicNumber: 00051607 : AppleDouble
8526 * Version : 00020000 : Version 2
8527 * Filler : 4D 61 63 20 4F 53 20 58 20 20 20 20 20 20 20 20 : Mac OS X
8528 * Num. of ent: 0002 : 2
8530 * -----------------------------------------------------------------------------
8531 * Entry ID : 00000002 : Resource Fork
8532 * Offset : 0000009A : 154
8533 * Length : 00000004 : 4
8535 * -RAW DUMP--: 0 1 2 3 4 5 6 7 8 9 A B C D E F : (ASCII)
8536 * 00000000 : 62 61 72 00 : bar.
8538 * -----------------------------------------------------------------------------
8539 * Entry ID : 00000009 : Finder Info
8540 * Offset : 00000032 : 50
8541 * Length : 00000068 : 104
8543 * -FInfo-----:
8544 * Type : 464F4F20 : FOO
8545 * Creator : 42415220 : BAR
8546 * isAlias : 0
8547 * Invisible : 0
8548 * hasBundle : 0
8549 * nameLocked : 0
8550 * Stationery : 0
8551 * CustomIcon : 0
8552 * Reserved : 0
8553 * Inited : 0
8554 * NoINITS : 0
8555 * Shared : 0
8556 * SwitchLaunc: 0
8557 * Hidden Ext : 0
8558 * color : 000 : none
8559 * isOnDesk : 0
8560 * Location v : 0000 : 0
8561 * Location h : 0000 : 0
8562 * Fldr : 0000 : ..
8564 * -FXInfo----:
8565 * Rsvd|IconID: 0000 : 0
8566 * Rsvd : 0000 : ..
8567 * Rsvd : 0000 : ..
8568 * Rsvd : 0000 : ..
8569 * AreInvalid : 0
8570 * unknown bit: 0
8571 * unknown bit: 0
8572 * unknown bit: 0
8573 * unknown bit: 0
8574 * unknown bit: 0
8575 * unknown bit: 0
8576 * CustomBadge: 0
8577 * ObjctIsBusy: 0
8578 * unknown bit: 0
8579 * unknown bit: 0
8580 * unknown bit: 0
8581 * unknown bit: 0
8582 * RoutingInfo: 0
8583 * unknown bit: 0
8584 * unknown bit: 0
8585 * Rsvd|commnt: 0000 : 0
8586 * PutAway : 00000000 : 0
8588 * -EA--------:
8589 * pad : 0000 :
8590 * magic : 41545452 : ATTR
8591 * debug_tag : 00000000 : 0
8592 * total_size : 0000009A : 154
8593 * data_start : 00000096 : 150
8594 * data_length: 00000004 : 4
8595 * reserved[0]: 00000000 : ....
8596 * reserved[1]: 00000000 : ....
8597 * reserved[2]: 00000000 : ....
8598 * flags : 0000 : ..
8599 * num_attrs : 0001 : 1
8600 * -EA ENTRY--:
8601 * offset : 00000096 : 150
8602 * length : 00000004 : 4
8603 * flags : 0000 : ..
8604 * namelen : 13 : 19
8605 * -EA NAME---: 0 1 2 3 4 5 6 7 8 9 A B C D E F : (ASCII)
8606 * 00000000 : 6F 72 67 2E 73 61 6D 62 61 EF 80 A2 77 6F 6F 68 : org.samba...wooh
8607 * 00000010 : 6F 6F 00 : oo.
8608 * -EA VALUE--: 0 1 2 3 4 5 6 7 8 9 A B C D E F : (ASCII)
8609 * 00000000 : 62 61 72 00 : bar.
8611 * -RAW DUMP--: 0 1 2 3 4 5 6 7 8 9 A B C D E F : (ASCII)
8612 * 00000000 : 46 4F 4F 20 42 41 52 20 00 00 00 00 00 00 00 00 : FOO BAR ........
8613 * 00000010 : 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 : ................
8614 * 00000020 : 00 00 41 54 54 52 00 00 00 00 00 00 00 9A 00 00 : baATTR..........
8615 * 00000030 : 00 96 00 00 00 04 00 00 00 00 00 00 00 00 00 00 : ................
8616 * 00000040 : 00 00 00 00 00 01 00 00 00 96 00 00 00 04 00 00 : ................
8617 * 00000050 : 13 6F 72 67 2E 73 61 6D 62 61 EF 80 A2 77 6F 6F : .org.samba...woo
8618 * 00000060 : 68 6F 6F 00 62 61 72 00 : hoo.bar.
8620 * It was created with:
8622 * $ hexdump -ve '"\t" 7/1 "0x%02x, " 1/1 " 0x%02x," "\n"'
8624 static char unconvert_adfile_data[] = {
8625 0x00, 0x05, 0x16, 0x07, 0x00, 0x02, 0x00, 0x00,
8626 0x4d, 0x61, 0x63, 0x20, 0x4f, 0x53, 0x20, 0x58,
8627 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
8628 0x00, 0x02, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00,
8629 0x00, 0x98, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00,
8630 0x00, 0x09, 0x00, 0x00, 0x00, 0x32, 0x00, 0x00,
8631 0x00, 0x66, 0x46, 0x4f, 0x4f, 0x20, 0x42, 0x41,
8632 0x52, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
8633 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
8634 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
8635 0x00, 0x00, 0x00, 0x00, 0x41, 0x54, 0x54, 0x52,
8636 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x98,
8637 0x00, 0x00, 0x00, 0x94, 0x00, 0x00, 0x00, 0x04,
8638 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
8639 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01,
8640 0x00, 0x00, 0x00, 0x94, 0x00, 0x00, 0x00, 0x04,
8641 0x00, 0x00, 0x11, 0x6f, 0x72, 0x67, 0x2e, 0x73,
8642 0x61, 0x6d, 0x62, 0x61, 0x3a, 0x77, 0x6f, 0x6f,
8643 0x68, 0x6f, 0x6f, 0x00, 0x62, 0x61, 0x72, 0x00,
8644 0x62, 0x61, 0x72, 0x00
8647 static bool test_unconvert(struct torture_context *tctx,
8648 struct smb2_tree *tree1,
8649 struct smb2_tree *tree2)
8651 const char *fname = BASEDIR "\\unconvert";
8652 const char *adname = BASEDIR "\\._unconvert";
8653 const char *net = NULL;
8654 const char *share = NULL;
8655 AfpInfo *afpi = NULL;
8656 char *cmd = NULL;
8657 struct smb2_handle h1;
8658 union smb_fileinfo finfo;
8659 size_t adsize;
8660 NTSTATUS status;
8661 int result;
8662 bool ret = true;
8664 torture_assert_not_null_goto(tctx, tree2, ret, done,
8665 "Need a second share without fruit\n");
8667 net = torture_setting_string(tctx, "net", NULL);
8668 torture_assert_not_null_goto(tctx, net, ret, done,
8669 "Need path to 'net'");
8671 share = torture_setting_string(tctx, "sharename", NULL);
8672 torture_assert_not_null_goto(tctx, share, ret, done,
8673 "Need sharename");
8675 torture_comment(tctx, "Testing unconvert\n");
8677 smb2_deltree(tree1, BASEDIR);
8679 status = torture_smb2_testdir(tree1, BASEDIR, &h1);
8680 torture_assert_ntstatus_ok_goto(tctx, status, ret, done,
8681 "torture_smb2_testdir\n");
8682 smb2_util_close(tree1, h1);
8684 ret = torture_setup_file(tctx, tree1, fname, false);
8685 torture_assert_goto(tctx, ret == true, ret, done, "torture_setup_file");
8687 afpi = torture_afpinfo_new(tctx);
8688 torture_assert_not_null_goto(tctx, afpi, ret, done,
8689 "torture_afpinfo_new failed\n");
8691 memcpy(afpi->afpi_FinderInfo, "FOO BAR ", 8);
8693 ret = torture_write_afpinfo(tree1, tctx, tctx, fname, afpi);
8694 torture_assert_goto(tctx, ret == true, ret, done,
8695 "torture_write_afpinfo failed\n");
8697 ret = write_stream(tree1, __location__, tctx, tctx,
8698 fname,
8700 * \xef\x80\xa2 is ':' mapped to Unicoe private range
8702 ":org.samba" "\xef\x80\xa2" "woohoo",
8703 0, 4, "bar");
8704 torture_assert_goto(tctx, ret == true, ret, done,
8705 "write_stream failed\n");
8707 ret = write_stream(tree1, __location__, tctx, tctx,
8708 fname, AFPRESOURCE_STREAM_NAME,
8709 0, 4, "bar");
8710 torture_assert_goto(tctx, ret == true, ret, done,
8711 "write_stream failed\n");
8713 cmd = talloc_asprintf(tctx,
8714 "%s --recursive vfs stream2adouble %s %s/",
8715 net,
8716 share,
8717 BASEDIR);
8718 torture_assert_not_null_goto(tctx, cmd, ret, done,
8719 "talloc_asprintf failed\n");
8721 torture_comment(tctx, "cmd: %s\n", cmd);
8723 result = system(cmd);
8724 torture_assert_int_equal_goto(tctx, result, 0, ret, done,
8725 "command failed\n");
8727 status = torture_smb2_testfile(tree2, adname, &h1);
8728 torture_assert_ntstatus_ok_goto(tctx, status, ret, done,
8729 "torture_smb2_testfile failed\n");
8731 finfo = (union smb_fileinfo) {
8732 .generic.level = RAW_FILEINFO_ALL_INFORMATION,
8733 .generic.in.file.handle = h1,
8736 status = smb2_getinfo_file(tree2, tctx, &finfo);
8737 torture_assert_ntstatus_ok_goto(tctx, status, ret, done,
8738 "torture_smb2_testdir\n");
8739 smb2_util_close(tree2, h1);
8741 adsize = finfo.all_info.out.size;
8742 torture_assert_int_equal_goto(tctx, adsize,
8743 sizeof(unconvert_adfile_data),
8744 ret, done, "wrong size\n");
8746 ret = check_stream(tree2, __location__, tctx, tctx,
8747 adname, "", 0, adsize, 0, adsize,
8748 unconvert_adfile_data);
8749 torture_assert_goto(tctx, ret == true, ret, done,
8750 "check_stream failed\n");
8752 done:
8753 // smb2_deltree(tree1, BASEDIR);
8754 return ret;
8757 struct torture_suite *torture_vfs_fruit_unfruit(TALLOC_CTX *ctx)
8759 struct torture_suite *suite = torture_suite_create(
8760 ctx, "unfruit");
8762 suite->description = talloc_strdup(
8763 suite, "test converting back to AppleDouble");
8765 torture_suite_add_2ns_smb2_test(suite,
8766 "unconvert",
8767 test_unconvert);
8769 return suite;
8773 * Write an invalid AFP_AfpInfo stream header
8775 bool test_fruit_validate_afpinfo(struct torture_context *tctx,
8776 struct smb2_tree *tree)
8778 bool expect_invalid_param = torture_setting_bool(tctx, "validate_afpinfo", true);
8779 const char *fname = "test_fruit_validate_afpinfo";
8780 const char *sname = "test_fruit_validate_afpinfo" AFPINFO_STREAM_NAME;
8781 struct smb2_handle handle;
8782 AfpInfo *afpinfo = NULL;
8783 char *afpinfo_buf = NULL;
8784 uint8_t valbuf[8];
8785 NTSTATUS status;
8786 bool ret = true;
8788 torture_comment(tctx, "Checking create of AfpInfo stream\n");
8790 smb2_util_unlink(tree, fname);
8792 ret = torture_setup_file(tctx, tree, fname, false);
8793 torture_assert_goto(tctx, ret == true, ret, done, "torture_setup_file failed");
8795 afpinfo = torture_afpinfo_new(tctx);
8796 torture_assert_not_null_goto(tctx, afpinfo, ret, done,
8797 "torture_afpinfo_new failed\n");
8799 memcpy(afpinfo->afpi_FinderInfo, "FOO BAR ", 8);
8801 ret = torture_write_afpinfo(tree, tctx, tctx, fname, afpinfo);
8802 torture_assert_goto(tctx, ret == true, ret, done,
8803 "torture_write_afpinfo failed\n");
8805 afpinfo_buf = talloc_zero_size(tctx, 60);
8806 torture_assert_goto(tctx, afpinfo_buf != NULL, ret, done,
8807 "torture_afpinfo_new failed");
8808 memcpy(afpinfo_buf + 16, "FOO ", 4);
8810 status = torture_smb2_testfile_access(
8811 tree, sname, &handle, SEC_FILE_ALL);
8812 torture_assert_ntstatus_ok_goto(tctx, status, ret, done,
8813 "smb2_create failed\n");
8815 status = smb2_util_write(tree, handle, afpinfo_buf, 0, AFP_INFO_SIZE);
8816 if (expect_invalid_param) {
8817 torture_assert_ntstatus_equal_goto(
8818 tctx, status, NT_STATUS_INVALID_PARAMETER, ret, done,
8819 "write didn't fail as expected\n");
8820 } else {
8821 torture_assert_ntstatus_ok_goto(tctx, status, ret, done,
8822 "smb2_util_write failed");
8825 smb2_util_close(tree, handle);
8828 * Verify the server fixed the header
8830 PUSH_BE_U32(valbuf, 0, AFP_Signature);
8831 PUSH_BE_U32(valbuf + 4, 0, AFP_Version);
8832 ret = check_stream(tree, __location__, tctx, tctx, fname,
8833 AFPINFO_STREAM, 0, 60, 0, 8, (char *)valbuf);
8834 torture_assert_goto(tctx, ret == true, ret, done, "check_stream failed");
8836 done:
8837 smb2_util_unlink(tree, fname);
8838 return ret;