bind/backport-Fix-logging-a-uint32_t-SOA-serial-value-in-dns_catz_update_from_db.patch
zhang-hao-jon 0003f50e3d bind:fix some patches from commity
(cherry picked from commit 65429159526fd046e9fcdd9a0d9c2bd0fd028ec6)
2023-02-27 09:25:18 +08:00

34 lines
1.2 KiB
Diff

From a634488a24f9be05d50a4a67f0d2bf4182161697 Mon Sep 17 00:00:00 2001
From: Aram Sargsyan <aram@isc.org>
Date: Wed, 14 Dec 2022 14:40:31 +0000
Subject: [PATCH] Fix logging a uint32_t SOA serial value in
dns_catz_update_from_db()
The dns_catz_update_from_db() function prints serial number as a signed
number (with "%d" in the format string), but the `vers` variable's type
is 'uint32_t'. This breaks serials bigger than 2^31.
Use PRIu32 instead of "d" in the format string.
(cherry picked from commit 72b1760ea6cd415efe9868aad97c982fea8b0a42)
---
lib/dns/catz.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/lib/dns/catz.c b/lib/dns/catz.c
index 49ad9bf37b..8a552d1259 100644
--- a/lib/dns/catz.c
+++ b/lib/dns/catz.c
@@ -1874,8 +1874,8 @@ dns_catz_update_from_db(dns_db_t *db, dns_catz_zones_t *catzs) {
isc_log_write(dns_lctx, DNS_LOGCATEGORY_GENERAL, DNS_LOGMODULE_MASTER,
ISC_LOG_INFO,
- "catz: updating catalog zone '%s' with serial %d", bname,
- vers);
+ "catz: updating catalog zone '%s' with serial %" PRIu32,
+ bname, vers);
result = dns_catz_new_zone(catzs, &newzone, &db->origin);
if (result != ISC_R_SUCCESS) {
--
2.23.0