pgreco / rpms / ipa

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

Blame SOURCES/0026-Fix_compile_issue_with_new_389-ds_rhbz#1659448.patch

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