Skip to content

libutil/file-descriptor: Add safer utilities for opening files relati…#14636

Merged
Ericson2314 merged 2 commits intomasterfrom
openat2-wrapper
Nov 25, 2025
Merged

libutil/file-descriptor: Add safer utilities for opening files relati…#14636
Ericson2314 merged 2 commits intomasterfrom
openat2-wrapper

Conversation

@xokdvium
Copy link
Contributor

…ve to dirFd

Motivation

Implements a safe no symlink following primitive operation for opening file descriptors. This is unix-only for the time being, since windows doesn't really suffer from symlink races, since they are admin-only.

Tested with enosys --syscall openat2 as well.

Context


Add 👍 to pull requests you find important.

The Nix maintainer team uses a GitHub project board to schedule and track reviews.

@xokdvium xokdvium requested a review from Mic92 November 24, 2025 21:06
@xokdvium xokdvium requested a review from edolstra as a code owner November 24, 2025 21:06
{
CanonPath path;

SymlinkNotAllowed(CanonPath path)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

N.B. we might want to reuse this for other things, in future PR.

…ve to dirFd

Implements a safe no symlink following primitive operation for opening file descriptors.
This is unix-only for the time being, since windows doesn't really suffer from symlink
races, since they are admin-only.

Tested with enosys --syscall openat2 as well.
@Ericson2314 Ericson2314 added this pull request to the merge queue Nov 24, 2025
Merged via the queue into master with commit 88c9c6d Nov 25, 2025
20 checks passed
@Ericson2314 Ericson2314 deleted the openat2-wrapper branch November 25, 2025 00:15
@edolstra edolstra mentioned this pull request Dec 9, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants