aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authoralois31 <alois1@gmx-topmail.de>2024-05-31 16:44:18 +0000
committerGerrit Code Review <gerrit@lix-systems>2024-05-31 16:44:18 +0000
commitff08d954206a557ec7afe7301cdb4bb72114875f (patch)
tree66ab550326cb8e818dd811019e9c9930161eecfb /src
parent0c6cb34de6033d0ceab5de8cbfc37465afeefaa4 (diff)
parentcf756fdf3c1a804af726703a12ed2990ad6c2639 (diff)
Merge "libstore/build: copy ca-certificates too" into main
Diffstat (limited to 'src')
-rw-r--r--src/libstore/build/local-derivation-goal.cc8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/libstore/build/local-derivation-goal.cc b/src/libstore/build/local-derivation-goal.cc
index 99468d420..7066f5c93 100644
--- a/src/libstore/build/local-derivation-goal.cc
+++ b/src/libstore/build/local-derivation-goal.cc
@@ -1847,8 +1847,12 @@ void LocalDerivationGoal::runChild()
copyFile(path, chrootRootDir + path, { .followSymlinks = true });
}
- if (settings.caFile != "")
- pathsInChroot.try_emplace("/etc/ssl/certs/ca-certificates.crt", settings.caFile, true);
+ if (settings.caFile != "" && pathExists(settings.caFile)) {
+ // For the same reasons as above, copy the CA certificates file too.
+ // It should be even less likely to change during the build than resolv.conf.
+ createDirs(chrootRootDir + "/etc/ssl/certs");
+ copyFile(settings.caFile, chrootRootDir + "/etc/ssl/certs/ca-certificates.crt", { .followSymlinks = true });
+ }
}
for (auto & i : ss) pathsInChroot.emplace(i, i);