pgreco / rpms / ipa

Forked from forks/areguera/rpms/ipa 4 years ago
Clone

Blame SOURCES/0057-ipa-sidgen-make-internal-fetch_attr-helper-really-in.patch

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