libexpr: print flake config warning to stderr
Fixes #1155
Change-Id: Ie63f9200f7c06b1eec6c52518d6f523f6a6a6964
(cherry picked from commit f87d753987)
This commit is contained in:
committed by
eldritch horrors
parent
c08f2336d0
commit
7166c00efc
@@ -0,0 +1,9 @@
|
||||
---
|
||||
synopsis: "flake config warnings are now printed to stderr"
|
||||
issues: [1155]
|
||||
cls: [5379]
|
||||
category: "Fixes"
|
||||
credits: [lheckemann]
|
||||
---
|
||||
|
||||
The settings listed in a flake-config confirmation prompt are now printed to stderr rather than stdout, which allows `nix print-dev-env` to emit valid bash again even in the presence of untrusted settings.
|
||||
@@ -35,12 +35,14 @@ static bool batchAskForSetting(
|
||||
TrustedList & trustedList,
|
||||
std::map<std::string, std::string> & untrustedSettings)
|
||||
{
|
||||
printWarning("The following settings require your decision:");
|
||||
std::string warning("The following settings require your decision:");
|
||||
for (const auto & [name, valueS] : untrustedSettings) {
|
||||
// FIXME: filter ANSI escapes, newlines, \r, etc.
|
||||
logger->cout("- %s = %s", name, valueS);
|
||||
warning += fmt("\n- %s = %s", name, valueS);
|
||||
}
|
||||
|
||||
printWarning("%s", warning);
|
||||
|
||||
auto reply = logger
|
||||
->ask(
|
||||
fmt("Do you want to allow configuration settings to be applied?\nThis may allow the "
|
||||
|
||||
Reference in New Issue
Block a user