summaryrefslogtreecommitdiffstats
path: root/ldap
diff options
context:
space:
mode:
authorNoriko Hosoi <nhosoi@redhat.com>2005-11-10 22:37:54 +0000
committerNoriko Hosoi <nhosoi@redhat.com>2005-11-10 22:37:54 +0000
commit473436cc27666f88d05a333ad4ca2a82df695295 (patch)
tree04979d2946cc96034375f33aa874f4ac133edf83 /ldap
parent7aded9df4ef96ef4feaab88aaa4e64471cf9478c (diff)
downloadds-473436cc27666f88d05a333ad4ca2a82df695295.tar.gz
ds-473436cc27666f88d05a333ad4ca2a82df695295.tar.xz
ds-473436cc27666f88d05a333ad4ca2a82df695295.zip
[172824] Link SASL library dynamically
i1) For non-RHEL platforms, package cyrus sasl library and the supported plugins. 2) by default, cyrus sasl expects to see the plugins in /usr/lib/sasl2. Instead, tell sasl to search "../../../lib/sasl2" (relative path from ns-slapd) for the plugins.
Diffstat (limited to 'ldap')
-rw-r--r--ldap/cm/Makefile8
-rw-r--r--ldap/servers/slapd/saslbind.c26
2 files changed, 33 insertions, 1 deletions
diff --git a/ldap/cm/Makefile b/ldap/cm/Makefile
index d752f6a4..a2c43266 100644
--- a/ldap/cm/Makefile
+++ b/ldap/cm/Makefile
@@ -423,6 +423,14 @@ endif
endif
endif
+# if not Linux, we need package sasl library and supported plugins
+ifneq ($(ARCH), Linux)
+ $(INSTALL) -m 755 $(SASL_LIBPATH)/*.$(DLL_SUFFIX)* $(RELDIR)/lib
+ -mkdir $(RELDIR)/lib/sasl2
+ $(INSTALL) -m 755 $(SASL_LIBPATH)/sasl2/libdigestmd5.$(DLL_SUFFIX)* $(RELDIR)/lib/sasl2
+ $(INSTALL) -m 755 $(SASL_LIBPATH)/sasl2/libgssapiv2.$(DLL_SUFFIX)* $(RELDIR)/lib/sasl2
+endif
+
# the plugin API
$(INSTALL) -m 644 $(BUILD_DRIVE)$(BUILD_ROOT)/ldap/servers/slapd/slapi-plugin.h $(RELDIR)/plugins/slapd/slapi/include
$(INSTALL) -m 644 $(NSPR_INCDIR)/*.h $(RELDIR)/plugins/slapd/slapi/include
diff --git a/ldap/servers/slapd/saslbind.c b/ldap/servers/slapd/saslbind.c
index 1267b26c..640ccbfb 100644
--- a/ldap/servers/slapd/saslbind.c
+++ b/ldap/servers/slapd/saslbind.c
@@ -551,7 +551,18 @@ static int ids_sasl_canon_user(
return returnvalue;
}
-static sasl_callback_t ids_sasl_callbacks[5] =
+#ifdef CYRUS_SASL
+#if !defined(LINUX)
+static int ids_sasl_getpluginpath(sasl_conn_t *conn, const char **path)
+{
+ static char *pluginpath = "../../../lib/sasl2";
+ *path = pluginpath;
+ return SASL_OK;
+}
+#endif
+#endif
+
+static sasl_callback_t ids_sasl_callbacks[] =
{
{
SASL_CB_GETOPT,
@@ -577,6 +588,19 @@ static sasl_callback_t ids_sasl_callbacks[5] =
(IFP) ids_sasl_canon_user,
NULL
},
+#ifdef CYRUS_SASL
+ /* On Linux: we use system sasl and plugins are found in the default path
+ * /usr/lib/sasl2
+ * On other platforms: we need to tell cyrus sasl where they are localted.
+ */
+#if !defined(LINUX)
+ {
+ SASL_CB_GETPATH,
+ (IFP) ids_sasl_getpluginpath,
+ NULL
+ },
+#endif
+#endif
{
SASL_CB_LIST_END,
(IFP) NULL,