Skip to content

Comments

libfetchers/git-utils: Be more correct about validating refnames#14253

Merged
xokdvium merged 1 commit intomasterfrom
libgit2-refname-wa
Oct 15, 2025
Merged

libfetchers/git-utils: Be more correct about validating refnames#14253
xokdvium merged 1 commit intomasterfrom
libgit2-refname-wa

Conversation

@xokdvium
Copy link
Contributor

@xokdvium xokdvium commented Oct 15, 2025

Motivation

Turns out there's a much better API for this that doesn't have the
footguns of the previous method.

isLegalRefName is somewhat of a misnomer, since it's mainly used to
validate user inputs that can be either references, branch names,
psedorefs or tags.

Context

Resolves #14252


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 edolstra as a code owner October 15, 2025 08:37
@xokdvium xokdvium added backport 2.31-maintenance Automatically creates a PR against the branch backport 2.32-maintenance Automatically creates a PR against the branch labels Oct 15, 2025
@github-actions github-actions bot added with-tests Issues related to testing. PRs with tests have some priority fetching Networking with the outside (non-Nix) world, input locking labels Oct 15, 2025
@xokdvium
Copy link
Contributor Author

Needs a bit more work

@Ericson2314

This comment was marked as outdated.

Turns out there's a much better API for this that doesn't have the
footguns of the previous method.

isLegalRefName is somewhat of a misnomer, since it's mainly used to
validate user inputs that can be either references, branch names,
psedorefs or tags.
@xokdvium xokdvium changed the title libfetchers/git-utils: Fixup first segment in refname before passing … libfetchers/git-utils: Be more correct about validating refnames Oct 15, 2025
@xokdvium xokdvium added this pull request to the merge queue Oct 15, 2025
Merged via the queue into master with commit e3232af Oct 15, 2025
24 checks passed
@xokdvium xokdvium deleted the libgit2-refname-wa branch October 15, 2025 20:07
@internal-nix-ci
Copy link

Successfully created backport PR for 2.31-maintenance:

@internal-nix-ci
Copy link

Successfully created backport PR for 2.32-maintenance:

philiptaron added a commit to philiptaron/nixpkgs that referenced this pull request Jan 8, 2026
## Bug fixes (crashes)

- Fix segfaults from `toView()` when compiled with newer nixpkgs (NixOS/nix#14154)
- Fix use-after-move in `DerivationGoal::repairClosure` and `SampleStack` (NixOS/nix#14086)
- Fix assertion failure on partially valid derivation outputs (NixOS/nix#14137)
- Fix `RestrictedStore::addDependency` recursion causing crashes (NixOS/nix#14729)
- Fix crash on flakerefs containing newlines (NixOS/nix#14450)

## Bug fixes (functionality)

- Fix fakeSSH check breaking SSH copies with `user@host` format (NixOS/nix#14150)
- Fix `builtins.dirOf` regression from Nix 2.23 (NixOS/nix#14515)
- Restore missing `isAllowed` check in `ChrootLinuxDerivationBuilder` (NixOS/nix#14531)
- Fix curl with c-ares failing to resolve DNS in sandbox on macOS (NixOS/nix#14792)
- Fix tarball percent decoding for `file://` URIs (NixOS/nix#14729)
- `exportReferencesGraph`: Handle heterogeneous arrays (NixOS/nix#13861)
- Fix filesystem ops in store optimization (NixOS/nix#14676)

## Bug fixes (output)

- Fix double-quoting of paths in logs (NixOS/nix#14210)
- Include path in world-writable error messages (NixOS/nix#14785)

## Improvements

- Better git refnames validation (NixOS/nix#14253)
- Use pure/restricted eval for help pages (NixOS/nix#14156)
- Improve store-reference compatibility with IPv6 ZoneId literals (NixOS/nix#14134)
- Correct `build-dir` error in manual (NixOS/nix#14745)

## Build system

- Add mdbook 0.5 support (NixOS/nix#14690)
- Drop legacy Apple SDK pattern (NixOS/nix#13976)

https://github.com/NixOS/nix/releases/tag/2.31.3
philiptaron added a commit to philiptaron/nixpkgs that referenced this pull request Jan 8, 2026
Changelog of fixes:

## Bug fixes (crashes)

- Fix segfaults from `toView()` when compiled with newer nixpkgs (NixOS/nix#14154)
- Fix use-after-move in `DerivationGoal::repairClosure` and `SampleStack` (NixOS/nix#14086)
- Fix assertion failure on partially valid derivation outputs (NixOS/nix#14137)
- Fix `RestrictedStore::addDependency` recursion causing crashes (NixOS/nix#14729)
- Fix crash on flakerefs containing newlines (NixOS/nix#14450)

## Bug fixes (functionality)

- Fix fakeSSH check breaking SSH copies with `user@host` format (NixOS/nix#14150)
- Fix `builtins.dirOf` regression from Nix 2.23 (NixOS/nix#14515)
- Restore missing `isAllowed` check in `ChrootLinuxDerivationBuilder` (NixOS/nix#14531)
- Fix curl with c-ares failing to resolve DNS in sandbox on macOS (NixOS/nix#14792)
- Fix tarball percent decoding for `file://` URIs (NixOS/nix#14729)
- `exportReferencesGraph`: Handle heterogeneous arrays (NixOS/nix#13861)
- Fix filesystem ops in store optimization (NixOS/nix#14676)

## Bug fixes (output)

- Fix double-quoting of paths in logs (NixOS/nix#14210)
- Include path in world-writable error messages (NixOS/nix#14785)

## Improvements

- Better git refnames validation (NixOS/nix#14253)
- Use pure/restricted eval for help pages (NixOS/nix#14156)
- Improve store-reference compatibility with IPv6 ZoneId literals (NixOS/nix#14134)
- Correct `build-dir` error in manual (NixOS/nix#14745)

## Build system

- Add mdbook 0.5 support (NixOS/nix#14690)
- Drop legacy Apple SDK pattern (NixOS/nix#13976)

https://github.com/NixOS/nix/releases/tag/2.31.3
philiptaron added a commit to philiptaron/nixpkgs that referenced this pull request Jan 15, 2026
Changelog of fixes:

## Bug fixes (crashes)

- Fix segfaults from `toView()` when compiled with newer nixpkgs (NixOS/nix#14154)
- Fix use-after-move in `DerivationGoal::repairClosure` and `SampleStack` (NixOS/nix#14086)
- Fix assertion failure on partially valid derivation outputs (NixOS/nix#14137)
- Fix `RestrictedStore::addDependency` recursion causing crashes (NixOS/nix#14729)
- Fix crash on flakerefs containing newlines (NixOS/nix#14450)

## Bug fixes (functionality)

- Fix fakeSSH check breaking SSH copies with `user@host` format (NixOS/nix#14150)
- Fix `builtins.dirOf` regression from Nix 2.23 (NixOS/nix#14515)
- Restore missing `isAllowed` check in `ChrootLinuxDerivationBuilder` (NixOS/nix#14531)
- Fix curl with c-ares failing to resolve DNS in sandbox on macOS (NixOS/nix#14792)
- Fix tarball percent decoding for `file://` URIs (NixOS/nix#14729)
- `exportReferencesGraph`: Handle heterogeneous arrays (NixOS/nix#13861)
- Fix filesystem ops in store optimization (NixOS/nix#14676)

## Bug fixes (output)

- Fix double-quoting of paths in logs (NixOS/nix#14210)
- Include path in world-writable error messages (NixOS/nix#14785)

## Improvements

- Better git refnames validation (NixOS/nix#14253)
- Use pure/restricted eval for help pages (NixOS/nix#14156)
- Improve store-reference compatibility with IPv6 ZoneId literals (NixOS/nix#14134)
- Correct `build-dir` error in manual (NixOS/nix#14745)

## Build system

- Add mdbook 0.5 support (NixOS/nix#14690)
- Drop legacy Apple SDK pattern (NixOS/nix#13976)

https://github.com/NixOS/nix/releases/tag/2.31.3
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backport 2.31-maintenance Automatically creates a PR against the branch backport 2.32-maintenance Automatically creates a PR against the branch fetching Networking with the outside (non-Nix) world, input locking with-tests Issues related to testing. PRs with tests have some priority

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Regression in Nix 2.31.0 with handling of git refs

3 participants