From 73fe1994c40ee7dd6a6df78d4a7082e7a9c369e4 Mon Sep 17 00:00:00 2001 From: "W.C.A. Wijngaards" Date: Tue, 1 Apr 2025 13:51:09 +0200 Subject: [PATCH] * Fix RR types NSAP-PTR, GPOS and RESINFO to print unquoted strings. --- Changelog | 1 + host2str.c | 31 +++++++++++++++++++++++++++++++ ldns/host2str.h | 10 ++++++++++ ldns/rdata.h | 3 +++ rdata.c | 3 +++ rr.c | 6 +++--- wire2host.c | 1 + 7 files changed, 52 insertions(+), 3 deletions(-) diff --git a/Changelog b/Changelog index 19cfc4f1..c14a2957 100644 --- a/Changelog +++ b/Changelog @@ -16,6 +16,7 @@ * Add ldns-verify-zone -s option. It checks all signature results, instead of passing by when one RRSIG validates. That prints output for spurious RRSIGs, the failures for them. + * Fix RR types NSAP-PTR, GPOS and RESINFO to print unquoted strings. 1.8.4 2024-07-19 * Fix building documentation in build directory. diff --git a/host2str.c b/host2str.c index deeeaf63..f9dde7c6 100644 --- a/host2str.c +++ b/host2str.c @@ -1224,6 +1224,34 @@ ldns_rdf2buffer_str_eui64(ldns_buffer *output, const ldns_rdf *rdf) return ldns_buffer_status(output); } +ldns_status +ldns_rdf2buffer_str_unquoted(ldns_buffer *output, const ldns_rdf *rdf) +{ + size_t amount, i; + uint8_t ch; + if(ldns_rdf_size(rdf) < 1) { + return LDNS_STATUS_WIRE_RDATA_ERR; + } + if((int)ldns_rdf_size(rdf) < (int)ldns_rdf_data(rdf)[0] + 1) { + return LDNS_STATUS_WIRE_RDATA_ERR; + } + amount = ldns_rdf_data(rdf)[0]; + for(i=0; i