aboutsummaryrefslogtreecommitdiff
path: root/src/zenutil/zenutil.cpp
diff options
context:
space:
mode:
authorStefan Boberg <[email protected]>2026-04-22 09:09:08 +0200
committerGitHub Enterprise <[email protected]>2026-04-22 09:09:08 +0200
commit9cf0e8812e50f499f401e217c55a442768f03a31 (patch)
treef3496804c1c919a676f54f12d518a7b4b947c797 /src/zenutil/zenutil.cpp
parentchangelog version bump (diff)
downloadarchived-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