Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save bellflower2015/1d6d2ef08619878facec29a314f4a1ff to your computer and use it in GitHub Desktop.
Save bellflower2015/1d6d2ef08619878facec29a314f4a1ff to your computer and use it in GitHub Desktop.
From eb989be4081cf996bd7e7eb6a529bbc1dc483a59 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Ond=C5=99ej=20Kuzn=C3=ADk?= <[email protected]>
Date: Mon, 1 Nov 2021 17:12:35 +0000
Subject: [PATCH] ITS#9733 Only use libltdl when SLAPD_MODULES is defined
---
servers/slapd/overlays/ppolicy.c | 8 ++++++++
1 file changed, 8 insertions(+)
diff --git a/servers/slapd/overlays/ppolicy.c b/servers/slapd/overlays/ppolicy.c
index 7f6ecd03d0..175bc1ac45 100644
--- a/servers/slapd/overlays/ppolicy.c
+++ b/servers/slapd/overlays/ppolicy.c
@@ -63,8 +63,10 @@ typedef struct pp_info {
int send_netscape_controls; /* send netscape password controls */
char *pwdCheckModule; /* name of module to dynamically
load to check password */
+#ifdef SLAPD_MODULES
lt_dlhandle pwdCheckHandle; /* handle from lt_dlopen */
check_func *pwdCheckFunc;
+#endif /* SLAPD_MODULES */
ldap_pvt_thread_mutex_t pwdFailureTime_mutex;
} pp_info;
@@ -489,7 +491,11 @@ static ConfigTable ppolicycfg[] = {
"EQUALITY booleanMatch "
"SYNTAX OMsBoolean SINGLE-VALUE )", NULL, NULL },
{ "ppolicy_check_module", "path", 2, 2, 0,
+#ifdef SLAPD_MODULES
ARG_STRING|ARG_MAGIC|PPOLICY_CHECK_MODULE, ppolicy_cf_checkmod,
+#else
+ ARG_IGNORED, NULL,
+#endif /* SLAPD_MODULES */
"( OLcfgOvAt:12.7 NAME 'olcPPolicyCheckModule' "
"DESC 'Loadable module that instantiates check_password() function' "
"EQUALITY caseExactIA5Match "
@@ -562,6 +568,7 @@ ppolicy_cf_default( ConfigArgs *c )
return rc;
}
+#ifdef SLAPD_MODULES
static int
ppolicy_cf_checkmod( ConfigArgs *c )
{
@@ -616,6 +623,7 @@ ppolicy_cf_checkmod( ConfigArgs *c )
return rc;
}
+#endif /* SLAPD_MODULES */
static time_t
parse_time( char *atm )
--
GitLab
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment