]> git.ipfire.org Git - thirdparty/pdns.git/commitdiff
When writing back a text record, emit empty fields as a pair of quotes.
authorMiod Vallat <miod.vallat@powerdns.com>
Fri, 5 Sep 2025 13:14:59 +0000 (15:14 +0200)
committerMiod Vallat <miod.vallat@powerdns.com>
Fri, 5 Sep 2025 13:14:59 +0000 (15:14 +0200)
Addresses: #5208

Signed-off-by: Miod Vallat <miod.vallat@powerdns.com>
pdns/rcpgenerator.cc

index bb1b704aa333b7679102081cc7c874aa167781a3..fee6cc0637acea9d417d2e1aec6b2d1436f6aa73 100644 (file)
@@ -988,7 +988,12 @@ void RecordTextWriter::xfrText(const string& val, bool /* multi */, bool /* lenF
   if(!d_string.empty())
     d_string.append(1,' ');
 
-  d_string.append(val);
+  if (val.empty()) {
+    d_string.append(2, '"');
+  }
+  else {
+    d_string.append(val);
+  }
 }
 
 void RecordTextWriter::xfrUnquotedText(const string& val, bool /* lenField */)