mirror of
https://github.com/NixOS/nix
synced 2025-06-27 00:11:17 +02:00
* `nix-store --add-fixed' to preload the outputs of fixed-output
derivations. This is mostly to simplify the implementation of nix-prefetch-{url, svn}, which now work properly in setuid installations. * Enforce valid store names in `nix-store --add / --add-fixed'.
This commit is contained in:
parent
57d023a184
commit
c815aff21b
7 changed files with 152 additions and 57 deletions
|
@ -267,17 +267,7 @@ static Expr primDerivation(EvalState & state, const ATermVector & _args)
|
|||
/* Check the derivation name. It shouldn't contain whitespace,
|
||||
but we are conservative here: we check whether only
|
||||
alphanumerics and some other characters appear. */
|
||||
string validChars = "+-._?=";
|
||||
for (string::iterator i = drvName.begin(); i != drvName.end(); ++i)
|
||||
if (!((*i >= 'A' && *i <= 'Z') ||
|
||||
(*i >= 'a' && *i <= 'z') ||
|
||||
(*i >= '0' && *i <= '9') ||
|
||||
validChars.find(*i) != string::npos))
|
||||
{
|
||||
throw Error(format("invalid character `%1%' in derivation name `%2%'")
|
||||
% *i % drvName);
|
||||
}
|
||||
|
||||
checkStoreName(drvName);
|
||||
if (isDerivation(drvName))
|
||||
throw Error(format("derivation names are not allowed to end in `%1%'")
|
||||
% drvExtension);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue