Repository navigation
Commit f72dddf
authored
test(input): inject secure-open failures on the primitive the platform uses (#503)
Two cases prove the failed-secure-open contract by patching
skillspector.input_handler.os.open. _HAS_SECURE_DIR_FD is False on
Windows, so _open_regular_file_no_follow dispatches to
_open_regular_file_from_windows_handle and os.open is never called. The
failure is never injected there: the file is read normally, and both
cases fail while asserting the contract they exist to protect.
Deny both primitives so the failure reaches the dispatcher on either
platform. The Windows stub raises _FileOpenError, which is what the real
helper raises when CreateFileW fails.
Signed-off-by: kevin9327 <kevin9327@users.noreply.github.com>
Co-authored-by: kevin9327 <kevin9327@users.noreply.github.com>1 parent 9c546dc commit f72dddf
2 files changed
Lines changed: 18 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1471 | 1471 | | |
1472 | 1472 | | |
1473 | 1473 | | |
| 1474 | + | |
| 1475 | + | |
| 1476 | + | |
1474 | 1477 | | |
| 1478 | + | |
| 1479 | + | |
| 1480 | + | |
1475 | 1481 | | |
1476 | 1482 | | |
1477 | 1483 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
28 | 28 | | |
29 | 29 | | |
30 | 30 | | |
| 31 | + | |
31 | 32 | | |
32 | 33 | | |
33 | 34 | | |
| |||
236 | 237 | | |
237 | 238 | | |
238 | 239 | | |
| 240 | + | |
239 | 241 | | |
240 | | - | |
| 242 | + | |
| 243 | + | |
| 244 | + | |
| 245 | + | |
| 246 | + | |
| 247 | + | |
| 248 | + | |
| 249 | + | |
| 250 | + | |
| 251 | + | |
241 | 252 | | |
242 | 253 | | |
243 | 254 | | |
| |||
0 commit comments