Commit efcb6c5
committed
backup: M4-2b reject encoded reserved-subtree targets (codex P2 round 5 #928)
walkObjectSubdir skips top-level '_orphans/' and
'_incomplete_uploads/' when they contain no sidecars (the dump's
own payload). A KEYMAP entry whose Encoded names a file under
those subtrees (e.g. '_orphans/foo.bin' or
'_incomplete_uploads/records.jsonl') passes the IsRegular check in
verifyKeymapTargetsExist - the dump-control payload genuinely
exists - but the walk never consumes it, so Encode finishes while
silently dropping the intended object.
The companion gate for the decoded original key was already in
validateKeymapReservedRoot; this commit mirrors the same restriction
on the encoded side via validateKeymapEncodedPathWalkerSkipped.
Function structure: validateKeymapEncodedPath now delegates the
walker-skip checks (sidecar suffix, top-level control files,
reserved-subtree roots) to a helper to keep cyclop under 10.
Caller audit: validateKeymapEncodedPath is invoked once from
validateKeymapRecord. No call-site changes.
Regression: TestValidateKeymapEncodedPath_ReservedSubtree with 6
sub-cases - top-level + nested _orphans / _incomplete_uploads
reject; _orphansFoo (longer name, NOT reserved) and prefix/_orphans
(nested, not top-level) accept.1 parent 24e75d3 commit efcb6c5
2 files changed
Lines changed: 69 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
219 | 219 | | |
220 | 220 | | |
221 | 221 | | |
222 | | - | |
223 | | - | |
| 222 | + | |
| 223 | + | |
| 224 | + | |
| 225 | + | |
| 226 | + | |
| 227 | + | |
| 228 | + | |
| 229 | + | |
| 230 | + | |
| 231 | + | |
| 232 | + | |
224 | 233 | | |
225 | 234 | | |
226 | 235 | | |
| |||
233 | 242 | | |
234 | 243 | | |
235 | 244 | | |
| 245 | + | |
| 246 | + | |
| 247 | + | |
| 248 | + | |
| 249 | + | |
| 250 | + | |
| 251 | + | |
| 252 | + | |
| 253 | + | |
| 254 | + | |
| 255 | + | |
| 256 | + | |
| 257 | + | |
236 | 258 | | |
237 | 259 | | |
238 | 260 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
281 | 281 | | |
282 | 282 | | |
283 | 283 | | |
| 284 | + | |
| 285 | + | |
| 286 | + | |
| 287 | + | |
| 288 | + | |
| 289 | + | |
| 290 | + | |
| 291 | + | |
| 292 | + | |
| 293 | + | |
| 294 | + | |
| 295 | + | |
| 296 | + | |
| 297 | + | |
| 298 | + | |
| 299 | + | |
| 300 | + | |
| 301 | + | |
| 302 | + | |
| 303 | + | |
| 304 | + | |
| 305 | + | |
| 306 | + | |
| 307 | + | |
| 308 | + | |
| 309 | + | |
| 310 | + | |
| 311 | + | |
| 312 | + | |
| 313 | + | |
| 314 | + | |
| 315 | + | |
| 316 | + | |
| 317 | + | |
| 318 | + | |
| 319 | + | |
| 320 | + | |
| 321 | + | |
| 322 | + | |
| 323 | + | |
| 324 | + | |
| 325 | + | |
| 326 | + | |
| 327 | + | |
| 328 | + | |
284 | 329 | | |
285 | 330 | | |
286 | 331 | | |
| |||
0 commit comments