Commit 34d9bcf
committed
Fix unguarded vlt lockfile reads to prevent FIFO hangs
Replace bare tokio::fs::read_to_string and tokio::fs::read calls with
guarded read_regular_to_string and read_regular_to_bytes from
socket_patch_core::utils::fs. These guarded readers use O_NONBLOCK
and verify files are regular before reading, preventing indefinite
hangs when a FIFO or device is placed at the lockfile path.
Fixes:
- rollback.rs: vlt-lock.json read during hosted rollback
- repair_vendor.rs: vlt-lock.json and package.json reads during repair1 parent ff2ceb8 commit 34d9bcf
2 files changed
Lines changed: 5 additions & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
56 | 56 | | |
57 | 57 | | |
58 | 58 | | |
59 | | - | |
| 59 | + | |
60 | 60 | | |
61 | 61 | | |
62 | 62 | | |
| |||
1546 | 1546 | | |
1547 | 1547 | | |
1548 | 1548 | | |
1549 | | - | |
| 1549 | + | |
1550 | 1550 | | |
1551 | 1551 | | |
1552 | 1552 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
15 | 15 | | |
16 | 16 | | |
17 | 17 | | |
| 18 | + | |
18 | 19 | | |
19 | 20 | | |
20 | 21 | | |
| |||
1054 | 1055 | | |
1055 | 1056 | | |
1056 | 1057 | | |
1057 | | - | |
1058 | | - | |
| 1058 | + | |
| 1059 | + | |
1059 | 1060 | | |
1060 | 1061 | | |
1061 | 1062 | | |
| |||
0 commit comments