Commit 8ed5e99
fix(gateway-lock): verify lock owner identity via startTime + reject non-integer ports
- Guard applyGatewayRuntimePortEnvOverride against PID reuse: when a lock
carries startTime, compare it against the current process start time
read from /proc/{pid}/stat before trusting the runtime-port override.
If the times differ the lock is stale (PID recycled) and is ignored.
- Add Number.isInteger check in readLockPayload so malformed locks with
fractional ports (e.g. 18789.5) are treated as missing, preventing
ERR_SOCKET_BAD_PORT from net.createConnection during owner probes.
- Export readLinuxStartTime so it can be used by paths.ts for the
startTime verification above.
Addresses chatgpt-codex-connector[bot] P2 comments on #42496.
Co-Authored-By: Claude Opus 4.6 <[email protected]>1 parent ea8d038 commit 8ed5e99
2 files changed
Lines changed: 13 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
306 | 306 | | |
307 | 307 | | |
308 | 308 | | |
309 | | - | |
| 309 | + | |
310 | 310 | | |
311 | 311 | | |
312 | 312 | | |
313 | | - | |
| 313 | + | |
| 314 | + | |
314 | 315 | | |
315 | 316 | | |
| 317 | + | |
| 318 | + | |
| 319 | + | |
| 320 | + | |
| 321 | + | |
| 322 | + | |
| 323 | + | |
| 324 | + | |
316 | 325 | | |
317 | 326 | | |
318 | 327 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
57 | 57 | | |
58 | 58 | | |
59 | 59 | | |
60 | | - | |
| 60 | + | |
61 | 61 | | |
62 | 62 | | |
63 | 63 | | |
| |||
157 | 157 | | |
158 | 158 | | |
159 | 159 | | |
| 160 | + | |
160 | 161 | | |
161 | 162 | | |
162 | 163 | | |
| |||
0 commit comments