Commit 331984a
committed
feat(io-isolated-storage): a directory-qualified search pattern enumerates that directory (#2209)
IsolatedStorageFile::GetFileNames("sub/*") now lists sub's files. Both doors used
to iterate the store root and match the WHOLE pattern against a bare filename, so
it returned nothing although sub/nested.dat existed.
THE TICKET'S BLOCKER IS SIMPLY GONE. It recorded that ".NET exact contract for a
directory-qualified pattern cannot be established here because the /rv reference
tree is absent". /rv is present, and .NET states the contract in its OWN comments,
directly above each method:
// foo\abc*.txt will give all abc*.txt files in foo directory
// foo\data* will give all directory names in foo directory that starts with data
Both delegate to Directory.EnumerateFiles(RootDirectory, searchPattern), and
FileSystemEnumerableFactory.NormalizeInputs:45-56 does the splitting: at the LAST
separator, joining the directory half onto the root and matching only the final
segment. A trailing separator leaves an empty expression that becomes "*", which
that function's own comment spells out.
THE RESULT STAYS A BARE NAME, not a sub-path -- .NET maps each hit through
Path.GetFileName (IsolatedStorageFile.cs:177) precisely because the store exists to
hide its own root, so returning "sub/nested.dat" would leak the layout the type is
there to conceal.
ONE DELIBERATE NARROWING, ON A SECURITY BOUNDARY. .NET does NOT run the search
pattern through its containment helper: GetFileNames and GetDirectoryNames are the
only two doors on IsolatedStorageFile that bypass GetFullPath, so in .NET
GetFileNames("../*") escapes the store and lists its parent. This port resolves the
directory half through the same fullPath() every other door uses. Reproducing .NET
here would mean opening a confinement hole to match a reference that has one. The
port is more RESTRICTIVE, which is the direction SA-8 does not reach, and a test
pins the asymmetry so it stays a decision rather than becoming an accident.
Containment is about where a path LANDS, so "a/../a/*" is still fine.
A SECOND, OLDER DIVERGENCE IS RECORDED RATHER THAN INTRODUCED. .NET rejects a
rooted pattern outright (Arg_Path2IsRooted, FileSystemEnumerableFactory.cs:29-30).
This port's fullPath() strips leading separators at EVERY door, so "/x" has always
meant "x relative to the store"; rejecting it only in the pattern would make the
type inconsistent with itself, which is worse than a divergence that is uniform.
Both rows are pinned. My first cut of the test asserted .NET's behaviour here and
was wrong -- the port's own convention is what it should have asserted.
Two cases added (IsolatedStorage 58 -> 60). Five mutations, all caught: never
split; split at the FIRST separator; return the sub-path instead of the bare name;
skip the confinement check; a trailing separator no longer means "*".
Downstream, measured per SA-2 condition 5: mobile-eggbert uses IsolatedStorageFile
in one file and calls only GetUserStoreForApplication, never either enumeration
door; cna's GetFileNames/GetDirectoryNames are its own StorageContainer's and are
untouched. Zero affected sites in both. Neither was modified.
Gate: 17,306 run, 17,306 passed, 0 failed, 0 skipped across 38 executables, GREEN.
docs/Migration-IsolatedStorageDirectoryQualifiedPattern.md1 parent 9847f9f commit 331984a
6 files changed
Lines changed: 285 additions & 7 deletions
File tree
- docs
- modules/io-isolated-storage
- include/System/IO/IsolatedStorage
- src/System/IO/IsolatedStorage
- tests/System/IO/IsolatedStorage
Large diffs are not rendered by default.
Lines changed: 119 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
Lines changed: 21 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
67 | 67 | | |
68 | 68 | | |
69 | 69 | | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
70 | 91 | | |
71 | 92 | | |
72 | 93 | | |
| |||
Lines changed: 68 additions & 6 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
237 | 237 | | |
238 | 238 | | |
239 | 239 | | |
| 240 | + | |
| 241 | + | |
| 242 | + | |
| 243 | + | |
| 244 | + | |
| 245 | + | |
| 246 | + | |
| 247 | + | |
| 248 | + | |
| 249 | + | |
| 250 | + | |
| 251 | + | |
| 252 | + | |
| 253 | + | |
| 254 | + | |
| 255 | + | |
| 256 | + | |
| 257 | + | |
| 258 | + | |
| 259 | + | |
| 260 | + | |
| 261 | + | |
| 262 | + | |
| 263 | + | |
| 264 | + | |
| 265 | + | |
| 266 | + | |
| 267 | + | |
| 268 | + | |
| 269 | + | |
| 270 | + | |
| 271 | + | |
| 272 | + | |
| 273 | + | |
| 274 | + | |
| 275 | + | |
| 276 | + | |
| 277 | + | |
| 278 | + | |
| 279 | + | |
| 280 | + | |
| 281 | + | |
| 282 | + | |
| 283 | + | |
| 284 | + | |
| 285 | + | |
| 286 | + | |
| 287 | + | |
| 288 | + | |
| 289 | + | |
| 290 | + | |
| 291 | + | |
| 292 | + | |
| 293 | + | |
| 294 | + | |
| 295 | + | |
| 296 | + | |
| 297 | + | |
240 | 298 | | |
241 | 299 | | |
242 | 300 | | |
243 | 301 | | |
244 | | - | |
| 302 | + | |
| 303 | + | |
| 304 | + | |
245 | 305 | | |
246 | | - | |
| 306 | + | |
247 | 307 | | |
248 | 308 | | |
249 | 309 | | |
250 | 310 | | |
251 | 311 | | |
252 | 312 | | |
253 | | - | |
| 313 | + | |
254 | 314 | | |
255 | 315 | | |
256 | 316 | | |
| |||
305 | 365 | | |
306 | 366 | | |
307 | 367 | | |
308 | | - | |
| 368 | + | |
| 369 | + | |
| 370 | + | |
309 | 371 | | |
310 | | - | |
| 372 | + | |
311 | 373 | | |
312 | 374 | | |
313 | 375 | | |
314 | 376 | | |
315 | 377 | | |
316 | 378 | | |
317 | | - | |
| 379 | + | |
318 | 380 | | |
319 | 381 | | |
320 | 382 | | |
| |||
Lines changed: 76 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
835 | 835 | | |
836 | 836 | | |
837 | 837 | | |
| 838 | + | |
| 839 | + | |
| 840 | + | |
| 841 | + | |
| 842 | + | |
| 843 | + | |
| 844 | + | |
| 845 | + | |
| 846 | + | |
| 847 | + | |
| 848 | + | |
| 849 | + | |
| 850 | + | |
| 851 | + | |
| 852 | + | |
| 853 | + | |
| 854 | + | |
| 855 | + | |
| 856 | + | |
| 857 | + | |
| 858 | + | |
| 859 | + | |
| 860 | + | |
| 861 | + | |
| 862 | + | |
| 863 | + | |
| 864 | + | |
| 865 | + | |
| 866 | + | |
| 867 | + | |
| 868 | + | |
| 869 | + | |
| 870 | + | |
| 871 | + | |
| 872 | + | |
| 873 | + | |
| 874 | + | |
| 875 | + | |
| 876 | + | |
| 877 | + | |
| 878 | + | |
| 879 | + | |
| 880 | + | |
| 881 | + | |
| 882 | + | |
| 883 | + | |
| 884 | + | |
| 885 | + | |
| 886 | + | |
| 887 | + | |
| 888 | + | |
| 889 | + | |
| 890 | + | |
| 891 | + | |
| 892 | + | |
| 893 | + | |
| 894 | + | |
| 895 | + | |
| 896 | + | |
| 897 | + | |
| 898 | + | |
| 899 | + | |
| 900 | + | |
| 901 | + | |
| 902 | + | |
| 903 | + | |
| 904 | + | |
| 905 | + | |
| 906 | + | |
| 907 | + | |
| 908 | + | |
| 909 | + | |
| 910 | + | |
| 911 | + | |
| 912 | + | |
| 913 | + | |
838 | 914 | | |
839 | 915 | | |
840 | 916 | | |
| |||
Binary file not shown.
0 commit comments