diff options
author | edef <edef@edef.eu> | 2023-10-04 16:50:24 +0000 |
---|---|---|
committer | github-actions[bot] <github-actions[bot]@users.noreply.github.com> | 2023-10-08 12:21:18 +0000 |
commit | 82040664e4cb686011aaff8acf101d1ac33f960b (patch) | |
tree | 279ae3d227f9a41747859d2c475523d67294ffe1 /src/libstore/path-regex.hh | |
parent | f5f4de6a550327b4b1a06123c2e450f1b92c73b6 (diff) |
StorePath: reject names starting with '.'
This has been the behaviour before Nix 2.4. It was dropped in a rewrite
in 759947bf72c134592f0ce23d385e48095bd0a301, allowing the creation of
store paths that aren't considered valid by older Nix versions or other
Nix tooling.
Nix 2.4 didn't ship in NixOS until 22.05, and stdenv.mkDerivation in
nixpkgs drops leading periods since April 2022, so it's unlikely anyone
is relying on the current lax behaviour.
Closes #9091.
Change-Id: I4a57bd9899e1b0dba56870ae5a1b680918a18ce9
(cherry picked from commit 24bda0c7b381e1a017023c6f7cb9661fae8560bd)
Diffstat (limited to 'src/libstore/path-regex.hh')
-rw-r--r-- | src/libstore/path-regex.hh | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/libstore/path-regex.hh b/src/libstore/path-regex.hh index 4f8dc4c1f..a44e6a2eb 100644 --- a/src/libstore/path-regex.hh +++ b/src/libstore/path-regex.hh @@ -3,6 +3,6 @@ namespace nix { -static constexpr std::string_view nameRegexStr = R"([0-9a-zA-Z\+\-\._\?=]+)"; +static constexpr std::string_view nameRegexStr = R"([0-9a-zA-Z\+\-_\?=][0-9a-zA-Z\+\-\._\?=]*)"; } |