Commit c010d11
committed
fix: address review feedback on RunState.load() TOCTOU fix
- Update docstring to describe the direct open() read instead of the
removed exists() probe, keeping the security rationale accurate.
- Add test_load_not_found_custom_message: verifies the custom
'Run state not found:' error message is raised.
- Add test_load_not_found_no_exists_probe: patches builtins.open to
raise FileNotFoundError and asserts the custom message, proving the
TOCTOU-eliminated code path works correctly.1 parent 7db94eb commit c010d11
2 files changed
Lines changed: 25 additions & 5 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
733 | 733 | | |
734 | 734 | | |
735 | 735 | | |
736 | | - | |
737 | | - | |
738 | | - | |
739 | | - | |
740 | | - | |
| 736 | + | |
| 737 | + | |
| 738 | + | |
| 739 | + | |
741 | 740 | | |
742 | 741 | | |
743 | 742 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
7086 | 7086 | | |
7087 | 7087 | | |
7088 | 7088 | | |
| 7089 | + | |
| 7090 | + | |
| 7091 | + | |
| 7092 | + | |
| 7093 | + | |
| 7094 | + | |
| 7095 | + | |
| 7096 | + | |
| 7097 | + | |
| 7098 | + | |
| 7099 | + | |
| 7100 | + | |
| 7101 | + | |
| 7102 | + | |
| 7103 | + | |
| 7104 | + | |
| 7105 | + | |
| 7106 | + | |
| 7107 | + | |
| 7108 | + | |
| 7109 | + | |
7089 | 7110 | | |
7090 | 7111 | | |
7091 | 7112 | | |
| |||
0 commit comments