1
0
Fork 0
mirror of https://github.com/NixOS/nix synced 2025-07-07 01:51:47 +02:00

Disallow empty store path names

Fixes #3239.
This commit is contained in:
Eelco Dolstra 2019-11-26 20:12:15 +01:00
parent 89db9353d7
commit c13193017f
No known key found for this signature in database
GPG key ID: 8170B4726D7198DE
3 changed files with 11 additions and 4 deletions

View file

@ -585,6 +585,8 @@ void LocalStore::checkDerivationOutputs(const Path & drvPath, const Derivation &
uint64_t LocalStore::addValidPath(State & state,
const ValidPathInfo & info, bool checkOutputs)
{
checkStoreName(storePathToName(info.path));
if (info.ca != "" && !info.isContentAddressed(*this))
throw Error("cannot add path '%s' to the Nix store because it claims to be content-addressed but isn't", info.path);