1
0
Fork 0
mirror of https://github.com/NixOS/nix synced 2025-06-25 02:21:16 +02:00

Merge pull request #10666 from tie/derivation-outputs-drv-path

Forbid drvPath in strictDerivation outputs attribute
This commit is contained in:
Robert Hensing 2024-05-12 21:14:32 +02:00 committed by GitHub
commit c940d11fb0
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 145 additions and 65 deletions

View file

@ -1184,11 +1184,11 @@ static void derivationStrictInternal(
.debugThrow();
/* !!! Check whether j is a valid attribute
name. */
/* Derivations cannot be named drv, because
then we'd have an attribute drvPath in
the resulting set. */
if (j == "drv")
state.error<EvalError>("invalid derivation output name 'drv'")
/* Derivations cannot be named drvPath, because
we already have an attribute drvPath in
the resulting set (see state.sDrvPath). */
if (j == "drvPath")
state.error<EvalError>("invalid derivation output name 'drvPath'")
.atPos(v)
.debugThrow();
outputs.insert(j);