diff --git a/src/libstore/build/local-derivation-goal.cc b/src/libstore/build/local-derivation-goal.cc index b6c7666e5..6448e87cc 100644 --- a/src/libstore/build/local-derivation-goal.cc +++ b/src/libstore/build/local-derivation-goal.cc @@ -1748,11 +1748,19 @@ void LocalDerivationGoal::runChild() if (drv->isBuiltin() && drv->builder == "builtin:fetchurl") { try { netrcData = readFile(settings.netrcFile); +<<<<<<< HEAD } catch (SysError &) { } try { caFileData = readFile(settings.caFile); } catch (SysError &) { } +======= + } catch (SystemError &) { } + + try { + caFileData = readFile(settings.caFile); + } catch (SystemError &) { } +>>>>>>> 9b818f14d (fix passing CA files into builtins:fetchurl sandbox) } #if __linux__ diff --git a/src/libstore/builtins/fetchurl.cc b/src/libstore/builtins/fetchurl.cc index 7558ab494..b68b659d5 100644 --- a/src/libstore/builtins/fetchurl.cc +++ b/src/libstore/builtins/fetchurl.cc @@ -21,6 +21,16 @@ void builtinFetchurl( settings.caFile = "ca-certificates.crt"; writeFile(settings.caFile, caFileData, 0600); +<<<<<<< HEAD +======= + + auto out = get(drv.outputs, "out"); + if (!out) + throw Error("'builtin:fetchurl' requires an 'out' output"); + + if (!(drv.type().isFixed() || drv.type().isImpure())) + throw Error("'builtin:fetchurl' must be a fixed-output or impure derivation"); +>>>>>>> 9b818f14d (fix passing CA files into builtins:fetchurl sandbox) auto getAttr = [&](const std::string & name) { auto i = drv.env.find(name);