760a2f
From b2cb212a12982cb6c9901ae0e71198c49e915258 Mon Sep 17 00:00:00 2001
760a2f
From: Alexander Bokovoy <abokovoy@redhat.com>
760a2f
Date: Fri, 14 Dec 2018 14:02:26 +0200
760a2f
Subject: [PATCH] ipa-sidgen: make internal fetch_attr helper really internal
760a2f
760a2f
With 389-ds landing a change for
760a2f
https://pagure.io/389-ds-base/issue/49950, fetch_attr() helper function
760a2f
is exposed in slapi-plugin.h. However, in order to be able to build
760a2f
FreeIPA plugins against older 389-ds versions, prefer using a local
760a2f
variant of it.
760a2f
760a2f
Rename fetch_attr() to ipa_sidgen_fetch_attr() so that it doesn't
760a2f
conflict at all.
760a2f
760a2f
Fixes: https://pagure.io/freeipa/issue/7811
760a2f
Reviewed-By: Christian Heimes <cheimes@redhat.com>
760a2f
---
760a2f
 daemons/ipa-slapi-plugins/ipa-sidgen/ipa_sidgen_task.c | 6 +++---
760a2f
 1 file changed, 3 insertions(+), 3 deletions(-)
760a2f
760a2f
diff --git a/daemons/ipa-slapi-plugins/ipa-sidgen/ipa_sidgen_task.c b/daemons/ipa-slapi-plugins/ipa-sidgen/ipa_sidgen_task.c
760a2f
index 9e474e83dd0e1bfc52b2e2da3fda12420d2ea281..007b1c945d0e37c4061f6a33cfdd667c45118c99 100644
760a2f
--- a/daemons/ipa-slapi-plugins/ipa-sidgen/ipa_sidgen_task.c
760a2f
+++ b/daemons/ipa-slapi-plugins/ipa-sidgen/ipa_sidgen_task.c
760a2f
@@ -63,7 +63,7 @@ struct worker_ctx {
760a2f
     struct range_info **ranges;
760a2f
 };
760a2f
 
760a2f
-static const char *fetch_attr(Slapi_Entry *e, const char *attrname,
760a2f
+static const char *ipa_sidgen_fetch_attr(Slapi_Entry *e, const char *attrname,
760a2f
                                               const char *default_val)
760a2f
 {
760a2f
     Slapi_Attr *attr;
760a2f
@@ -242,7 +242,7 @@ int sidgen_task_add(Slapi_PBlock *pb, Slapi_Entry *e,
760a2f
 
760a2f
     worker_ctx->plugin_id = global_sidgen_plugin_id;
760a2f
 
760a2f
-    str = fetch_attr(e, "delay", NULL);
760a2f
+    str = ipa_sidgen_fetch_attr(e, "delay", NULL);
760a2f
     if (str != NULL) {
760a2f
         errno = 0;
760a2f
         worker_ctx->delay = strtol(str, &endptr, 10);
760a2f
@@ -255,7 +255,7 @@ int sidgen_task_add(Slapi_PBlock *pb, Slapi_Entry *e,
760a2f
     }
760a2f
     LOG("delay is [%li].\n", worker_ctx->delay);
760a2f
 
760a2f
-    str = fetch_attr(e, "nsslapd-basedn", NULL);
760a2f
+    str = ipa_sidgen_fetch_attr(e, "nsslapd-basedn", NULL);
760a2f
     if (str == NULL) {
760a2f
         LOG_FATAL("Missing nsslapd-basedn!\n");
760a2f
         *returncode = LDAP_CONSTRAINT_VIOLATION;
760a2f
-- 
760a2f
2.20.1
760a2f