Disallow build products that are symlinks

Otherwise you can do

  ln -s /etc/passwd $out/foo
  echo "file misc $out/foo" >> $out/nix-support/hydra-build-products

and get Hydra to serve its /etc/passwd file.
This commit is contained in:
Eelco Dolstra
2013-02-23 16:28:44 +01:00
parent aa7ddeb8e9
commit 6658419f69
2 changed files with 3 additions and 3 deletions

View File

@ -173,6 +173,7 @@ sub checkPath {
my $storeDir = $Nix::Config::storeDir . "/";
error($c, "Invalid path in build product.")
if substr($path, 0, length($storeDir)) ne $storeDir || $path =~ /\/\.\./;
error($c, "Path $path is a symbolic link.") if -l $path;
}