diff options
| author | Stefan Boberg <[email protected]> | 2026-04-22 09:09:08 +0200 |
|---|---|---|
| committer | GitHub Enterprise <[email protected]> | 2026-04-22 09:09:08 +0200 |
| commit | 9cf0e8812e50f499f401e217c55a442768f03a31 (patch) | |
| tree | f3496804c1c919a676f54f12d518a7b4b947c797 /src/zenutil/zenutil.cpp | |
| parent | changelog version bump (diff) | |
| download | archived-zen-9cf0e8812e50f499f401e217c55a442768f03a31.tar.xz archived-zen-9cf0e8812e50f499f401e217c55a442768f03a31.zip | |
fix NamedEvent ftok() race on Linux/macOS (#1001)
- `ftok()` internally re-`stat()`s the path and fails with `ENOENT` if another owner's destructor unlinks the backing file between our `open()` and `ftok()`; the held fd does not protect against this
- derive the IPC key via `fstat()` on the fd instead, using the same `(ino & 0xffff) | ((dev & 0xff) << 16) | (proj << 24)` formula that glibc and macOS `ftok()` compute internally
- fixes intermittent "Failed to create an SysV IPC key" failures on macOS, where the slower on-disk /tmp widens the race window
Diffstat (limited to 'src/zenutil/zenutil.cpp')
0 files changed, 0 insertions, 0 deletions