summaryrefslogtreecommitdiffstats
path: root/debian/patches/sasl-default-path
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-15 17:54:14 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-15 17:54:14 +0000
commit83da7a0ac93decce70c1a02b0739020d8e2b69fd (patch)
tree0c298e82da8861a97aa152863f30eb4af5b80b37 /debian/patches/sasl-default-path
parentAdding upstream version 2.6.7+dfsg. (diff)
downloadopenldap-83da7a0ac93decce70c1a02b0739020d8e2b69fd.tar.xz
openldap-83da7a0ac93decce70c1a02b0739020d8e2b69fd.zip
Adding debian version 2.6.7+dfsg-1~exp1.debian/2.6.7+dfsg-1_exp1
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'debian/patches/sasl-default-path')
-rw-r--r--debian/patches/sasl-default-path59
1 files changed, 59 insertions, 0 deletions
diff --git a/debian/patches/sasl-default-path b/debian/patches/sasl-default-path
new file mode 100644
index 0000000..aced4e5
--- /dev/null
+++ b/debian/patches/sasl-default-path
@@ -0,0 +1,59 @@
+Add /etc/ldap/sasl2 to the SASL configuration search path.
+
+Not submitted upstream. Somewhat Debian-specific and probably not of
+interest upstream.
+
+Index: openldap/include/ldap_defaults.h
+===================================================================
+--- openldap.orig/include/ldap_defaults.h 2022-05-20 17:36:12.337246188 -0400
++++ openldap/include/ldap_defaults.h 2022-05-20 17:36:12.333246185 -0400
+@@ -75,4 +75,6 @@
+ */
+ #define LLOADD_DEFAULT_CONFIGFILE LDAP_SYSCONFDIR LDAP_DIRSEP "lloadd.conf"
+
++#define SASL_CONFIGPATH LDAP_SYSCONFDIR LDAP_DIRSEP "sasl2"
++
+ #endif /* _LDAP_CONFIG_H */
+Index: openldap/servers/slapd/sasl.c
+===================================================================
+--- openldap.orig/servers/slapd/sasl.c 2022-05-20 17:36:12.337246188 -0400
++++ openldap/servers/slapd/sasl.c 2022-05-20 17:36:12.333246185 -0400
+@@ -1231,12 +1231,38 @@
+ slapd_rw_destroy
+ };
+
++static int
++slap_sasl_getconfpath( void * context, char ** path )
++{
++ char * sasl_default_configpath;
++ size_t len;
++
++#if SASL_VERSION_MAJOR >= 2
++ sasl_default_configpath = "/usr/lib/sasl2";
++#else
++ sasl_default_configpath = "/usr/lib/sasl";
++#endif
++
++ len = strlen(SASL_CONFIGPATH) + 1 /* colon */ +
++ strlen(sasl_default_configpath) + 1 /* \0 */;
++ *path = malloc( len );
++ if ( *path == NULL )
++ return SASL_FAIL;
++
++ if (snprintf( *path, len, "%s:%s", SASL_CONFIGPATH,
++ sasl_default_configpath ) != len-1 )
++ return SASL_FAIL;
++
++ return SASL_OK;
++}
++
+ int slap_sasl_init( void )
+ {
+ #ifdef HAVE_CYRUS_SASL
+ int rc;
+ static sasl_callback_t server_callbacks[] = {
+ { SASL_CB_LOG, (slap_sasl_cb_ft)&slap_sasl_log, NULL },
++ { SASL_CB_GETCONFPATH, (slap_sasl_cb_ft)&slap_sasl_getconfpath, NULL },
+ { SASL_CB_GETOPT, (slap_sasl_cb_ft)&slap_sasl_getopt, NULL },
+ { SASL_CB_LIST_END, NULL, NULL }
+ };