e3ffab
From f0a61fa88284f8872f1496c0c0b24908d70274c8 Mon Sep 17 00:00:00 2001
e3ffab
From: Nathaniel McCallum <npmccallum@redhat.com>
e3ffab
Date: Thu, 29 Jan 2015 16:58:16 -0500
e3ffab
Subject: [PATCH] Fix ipa-pwd-extop global configuration caching
e3ffab
e3ffab
This fix is already upstream as part of the following commit:
e3ffab
        9baa93da1cbf56c2a6f7e82e099bc3ff3f19e2e4
e3ffab
e3ffab
https://bugzilla.redhat.com/show_bug.cgi?id=1187342
e3ffab
---
e3ffab
 daemons/ipa-slapi-plugins/libotp/otp_config.c | 12 ++++++++----
e3ffab
 1 file changed, 8 insertions(+), 4 deletions(-)
e3ffab
e3ffab
diff --git a/daemons/ipa-slapi-plugins/libotp/otp_config.c b/daemons/ipa-slapi-plugins/libotp/otp_config.c
e3ffab
index 1b7c1e658f126e3d1e8eabd129bb69dc5c4ce970..f600789f34ca87bf57ac3ee7d551843680cc86f1 100644
e3ffab
--- a/daemons/ipa-slapi-plugins/libotp/otp_config.c
e3ffab
+++ b/daemons/ipa-slapi-plugins/libotp/otp_config.c
e3ffab
@@ -126,10 +126,14 @@ static uint32_t find_value(const struct otp_config *cfg,
e3ffab
e3ffab
     sdn = make_sdn(spec->prefix, suffix);
e3ffab
     for (struct record *rec = cfg->records; rec != NULL; rec = rec->next) {
e3ffab
-        if (rec->spec == spec) {
e3ffab
-            value = PR_ATOMIC_ADD(&rec->value, 0);
e3ffab
-            break;
e3ffab
-        }
e3ffab
+        if (rec->spec != spec)
e3ffab
+            continue;
e3ffab
+
e3ffab
+        if (slapi_sdn_compare(sdn, rec->sdn) != 0)
e3ffab
+            continue;
e3ffab
+
e3ffab
+        value = PR_ATOMIC_ADD(&rec->value, 0);
e3ffab
+        break;
e3ffab
     }
e3ffab
e3ffab
     slapi_sdn_free(&sdn;;
e3ffab
--
e3ffab
2.1.0
e3ffab