Commit a05d868
committed
fix: mcb_load_policy Windows absolute-path message mismatch (CI-red #3)
Root cause is std::filesystem::path::is_absolute() itself, not the test.
On Windows it requires BOTH a root-name (drive letter/UNC) AND a
root-directory; a POSIX-style rooted path like "/etc/passwd" has a
root-directory but no root-name, so is_absolute() is false there even
though it's exactly the filesystem-root-escape attempt the check exists
to catch. The untrusted policy still rejected such a path on Windows
(the includePathWithinRoot() fallback catches it as "escapes the
document root" instead), just with a different message than
mcb_load_policy's stricter substring assertion expected.
mc3_load_policy/mc3_json_load_policy only assert that loading threw, not
the message text, so they stayed green despite having the identical gap.
Fixed all 3 mirrored is_absolute() checks (McbReader.cpp,
Mc3XmlParser.cpp, Mc3JsonParser.cpp -- same names, same logic by design)
to also treat "has a root-directory but no root-name" as absolute, so
the rejection message is consistent on every platform. has_root_name()
is always false on POSIX, so the added clause is already implied there
by the existing is_absolute() check -- zero behavior change on
Linux/macOS.
Verified: full mc3_*/mcb_*/mc3togltf_* non-render suite (115/118) still
passes unchanged under ASan+UBSan; the 3 failures are the already-known
Blender/numpy environment gap, unrelated. Windows-side reasoning follows
documented std::filesystem semantics, not executable in this sandbox (no
Wine).1 parent 1e7733d commit a05d868
4 files changed
Lines changed: 47 additions & 6 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
176 | 176 | | |
177 | 177 | | |
178 | 178 | | |
179 | | - | |
180 | | - | |
181 | | - | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
| 184 | + | |
| 185 | + | |
| 186 | + | |
| 187 | + | |
| 188 | + | |
| 189 | + | |
| 190 | + | |
| 191 | + | |
| 192 | + | |
| 193 | + | |
| 194 | + | |
| 195 | + | |
| 196 | + | |
| 197 | + | |
| 198 | + | |
| 199 | + | |
| 200 | + | |
| 201 | + | |
| 202 | + | |
| 203 | + | |
| 204 | + | |
182 | 205 | | |
183 | 206 | | |
184 | 207 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
339 | 339 | | |
340 | 340 | | |
341 | 341 | | |
342 | | - | |
| 342 | + | |
| 343 | + | |
| 344 | + | |
| 345 | + | |
| 346 | + | |
| 347 | + | |
| 348 | + | |
343 | 349 | | |
344 | 350 | | |
345 | 351 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1617 | 1617 | | |
1618 | 1618 | | |
1619 | 1619 | | |
1620 | | - | |
| 1620 | + | |
| 1621 | + | |
| 1622 | + | |
| 1623 | + | |
| 1624 | + | |
| 1625 | + | |
| 1626 | + | |
1621 | 1627 | | |
1622 | 1628 | | |
1623 | 1629 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
156 | 156 | | |
157 | 157 | | |
158 | 158 | | |
159 | | - | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
160 | 166 | | |
161 | 167 | | |
162 | 168 | | |
| |||
0 commit comments