Blame SOURCES/bind-dyndb-ldap-tkrizek-0005-Setting-skip-unconfigured-values.patch

29882e
From 41461fc444170ffd9b5459e2f0b2480f3288cc1d Mon Sep 17 00:00:00 2001
29882e
From: Tomas Krizek <tkrizek@redhat.com>
29882e
Date: Fri, 7 Apr 2017 14:48:32 +0200
29882e
Subject: [PATCH 1/2] settings: skip unconfigured values
29882e
29882e
When a value is not configured in settings map, it is skipped.
29882e
If it is the last processed value, the result of ISC_R_NOTFOUND
29882e
would cause the cleanup section of the function fail. Since
29882e
unconfigured values are allowed and expected, override the result
29882e
to ISC_R_SUCCESS in this case to prevent triggerring an error.
29882e
29882e
https://pagure.io/bind-dyndb-ldap/issue/172
29882e
29882e
Reviewed-By: Martin Basti <mbasti@redhat.com>
29882e
---
29882e
 src/settings.c | 7 +++++--
29882e
 1 file changed, 5 insertions(+), 2 deletions(-)
29882e
29882e
diff --git a/src/settings.c b/src/settings.c
29882e
index 37e6e5ccd751bd176f8dbdd4fd505b7e18ded4f4..8beb0d3cd16479c79bdc104a6a6fd28033f403e7 100644
29882e
--- a/src/settings.c
29882e
+++ b/src/settings.c
29882e
@@ -597,8 +597,11 @@ settings_set_fill(const cfg_obj_t *config, settings_set_t *set)
29882e
 	     setting++) {
29882e
 		cfg_value = NULL;
29882e
 		result = cfg_map_get(config, setting->name, &cfg_value);
29882e
-		if (result == ISC_R_NOTFOUND)
29882e
-			continue; /* setting not configured in map */
29882e
+		if (result == ISC_R_NOTFOUND) {
29882e
+			/* setting not configured in map */
29882e
+			result = ISC_R_SUCCESS;
29882e
+			continue;
29882e
+		}
29882e
 		else if (result != ISC_R_SUCCESS)
29882e
 			goto cleanup;
29882e
 		if (cfg_obj_isstring(cfg_value)) {
29882e
-- 
29882e
2.9.3
29882e