Skip to content

libutil: fix isInDir rejecting paths starting with dot#15241

Merged
Ericson2314 merged 1 commit intoNixOS:masterfrom
obsidiansystems:fix-isindir
Feb 15, 2026
Merged

libutil: fix isInDir rejecting paths starting with dot#15241
Ericson2314 merged 1 commit intoNixOS:masterfrom
obsidiansystems:fix-isindir

Conversation

@amaanq
Copy link
Member

@amaanq amaanq commented Feb 15, 2026

Motivation

The old check rejected any relative path whose first character was a dot, producing false negatives for valid descendants like .ssh or .config. This commit changes the logic such that now it inspects the first path component via path::begin(), only rejects . and .. rather than anything dot-prefixed.

Context


Add 👍 to pull requests you find important.

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

@amaanq amaanq requested a review from edolstra as a code owner February 15, 2026 14:39
@amaanq amaanq changed the title Fix default profile path for root in nix profile documentation @amaanq libutil: fix isInDir rejecting paths starting with dot Feb 15, 2026
@amaanq amaanq changed the title @amaanq libutil: fix isInDir rejecting paths starting with dot libutil: fix isInDir rejecting paths starting with dot Feb 15, 2026
@amaanq amaanq changed the title libutil: fix isInDir rejecting paths starting with dot libutil: fix isInDir rejecting paths starting with dot Feb 15, 2026
Copy link
Member

@Ericson2314 Ericson2314 left a comment

Choose a reason for hiding this comment

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

The old check rejected any relative path whose first character was a
dot, producing false negatives for valid descendants like `.ssh` or
`.config`. This commit changes the logic such that now it inspects the
first path component via `path::begin()`, only rejects `.` and `..`
rather than anything dot-prefixed. Fixes NixOS#15207.
@Ericson2314 Ericson2314 added this pull request to the merge queue Feb 15, 2026
Merged via the queue into NixOS:master with commit 95251a5 Feb 15, 2026
15 checks passed
@Ericson2314 Ericson2314 deleted the fix-isindir branch February 15, 2026 16:41
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.

Issues of the current isInDir implementation

2 participants