powerdns: redact configure flags from version output to reduce closure size

This commit is contained in:
Nick Cao 2022-03-15 11:13:23 +08:00
parent e85e545dbd
commit fc49bc19ed
No known key found for this signature in database
GPG key ID: 068A56CEF48FA2C1
2 changed files with 15 additions and 0 deletions

View file

@ -11,6 +11,8 @@ stdenv.mkDerivation rec {
url = "https://downloads.powerdns.com/releases/pdns-${version}.tar.bz2";
sha256 = "sha256-eRKxSIfWKEUYX3zktH21gOqnuLiX3LHJVV3+D6xe+uM=";
};
# redact configure flags from version output to reduce closure size
patches = [ ./version.patch ];
nativeBuildInputs = [ pkg-config ];
buildInputs = [

View file

@ -0,0 +1,13 @@
diff --git a/pdns/version.cc b/pdns/version.cc
index d8f5d40..1368481 100644
--- a/pdns/version.cc
+++ b/pdns/version.cc
@@ -155,7 +155,7 @@ void showBuildConfiguration()
#ifdef PDNS_CONFIG_ARGS
#define double_escape(s) #s
#define escape_quotes(s) double_escape(s)
- g_log<<Logger::Warning<<"Configured with: "<<escape_quotes(PDNS_CONFIG_ARGS)<<endl;
+ g_log<<Logger::Warning<<"Configured with: "<<"redacted"<<endl;
#undef escape_quotes
#undef double_escape
#endif