diff options
author | Yorick van Pelt <yorick@yorickvanpelt.nl> | 2023-05-26 15:32:28 +0200 |
---|---|---|
committer | Yorick van Pelt <yorick@yorickvanpelt.nl> | 2023-05-26 15:36:47 +0200 |
commit | 2c462486fe0c1bcb5b1142507d2875e98b2418df (patch) | |
tree | 3910b99966387323f21b464f77f25b2010e915a7 /src/libstore/globals.cc | |
parent | a6c78ba367725a81aa631a7df2d0840ddd25faf5 (diff) |
create pathAccessible, use it to infer default dirs
Diffstat (limited to 'src/libstore/globals.cc')
-rw-r--r-- | src/libstore/globals.cc | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/src/libstore/globals.cc b/src/libstore/globals.cc index a196c10e6..32e9a6ea9 100644 --- a/src/libstore/globals.cc +++ b/src/libstore/globals.cc @@ -57,8 +57,6 @@ Settings::Settings() auto sslOverride = getEnv("NIX_SSL_CERT_FILE").value_or(getEnv("SSL_CERT_FILE").value_or("")); if (sslOverride != "") caFile = sslOverride; - else if (caFile == "") - caFile = getDefaultSSLCertFile(); /* Backwards compatibility. */ auto s = getEnv("NIX_REMOTE_SYSTEMS"); @@ -185,7 +183,7 @@ bool Settings::isWSL1() Path Settings::getDefaultSSLCertFile() { for (auto & fn : {"/etc/ssl/certs/ca-certificates.crt", "/nix/var/nix/profiles/default/etc/ssl/certs/ca-bundle.crt"}) - if (pathExists(fn)) return fn; + if (pathAccessible(fn)) return fn; return ""; } |