summaryrefslogtreecommitdiffstats
path: root/recipes-support/openldap/openldap-2.4.39/sasl-default-path.patch
diff options
context:
space:
mode:
authorAmy Fong <amy.fong@windriver.com>2014-07-15 17:48:54 -0400
committerBruce Ashfield <bruce.ashfield@windriver.com>2014-07-30 00:54:30 -0400
commitfb81abecb4e8b212f30607bf86d5b1fd769fb19d (patch)
treed7c21313e70db1a96bdb916ccdc741c4729dda1c /recipes-support/openldap/openldap-2.4.39/sasl-default-path.patch
parenta3ce5306cdddb8f737f14d746ac1a892019836e3 (diff)
downloadmeta-cloud-services-fb81abecb4e8b212f30607bf86d5b1fd769fb19d.tar.gz
keystone: package openLDAP 2.4.39
The patches are taken from Debian. Signed-off-by: Amy Fong <amy.fong@windriver.com>
Diffstat (limited to 'recipes-support/openldap/openldap-2.4.39/sasl-default-path.patch')
-rw-r--r--recipes-support/openldap/openldap-2.4.39/sasl-default-path.patch55
1 files changed, 55 insertions, 0 deletions
diff --git a/recipes-support/openldap/openldap-2.4.39/sasl-default-path.patch b/recipes-support/openldap/openldap-2.4.39/sasl-default-path.patch
new file mode 100644
index 0000000..5ea240f
--- /dev/null
+++ b/recipes-support/openldap/openldap-2.4.39/sasl-default-path.patch
@@ -0,0 +1,55 @@
1Add /etc/ldap/sasl2 to the SASL configuration search path.
2
3Not submitted upstream. Somewhat Debian-specific and probably not of
4interest upstream.
5
6--- a/include/ldap_defaults.h
7+++ b/include/ldap_defaults.h
8@@ -63,4 +63,6 @@
9 /* dn of the default "monitor" subentry */
10 #define SLAPD_MONITOR_DN "cn=Monitor"
11
12+#define SASL_CONFIGPATH LDAP_SYSCONFDIR LDAP_DIRSEP "sasl2"
13+
14 #endif /* _LDAP_CONFIG_H */
15--- a/servers/slapd/sasl.c
16+++ b/servers/slapd/sasl.c
17@@ -1103,12 +1103,38 @@ static const rewrite_mapper slapd_mapper
18 };
19 #endif
20
21+static int
22+slap_sasl_getconfpath( void * context, char ** path )
23+{
24+ char * sasl_default_configpath;
25+ size_t len;
26+
27+#if SASL_VERSION_MAJOR >= 2
28+ sasl_default_configpath = "/usr/lib/sasl2";
29+#else
30+ sasl_default_configpath = "/usr/lib/sasl";
31+#endif
32+
33+ len = strlen(SASL_CONFIGPATH) + 1 /* colon */ +
34+ strlen(sasl_default_configpath) + 1 /* \0 */;
35+ *path = malloc( len );
36+ if ( *path == NULL )
37+ return SASL_FAIL;
38+
39+ if (snprintf( *path, len, "%s:%s", SASL_CONFIGPATH,
40+ sasl_default_configpath ) != len-1 )
41+ return SASL_FAIL;
42+
43+ return SASL_OK;
44+}
45+
46 int slap_sasl_init( void )
47 {
48 #ifdef HAVE_CYRUS_SASL
49 int rc;
50 static sasl_callback_t server_callbacks[] = {
51 { SASL_CB_LOG, &slap_sasl_log, NULL },
52+ { SASL_CB_GETCONFPATH, &slap_sasl_getconfpath, NULL },
53 { SASL_CB_GETOPT, &slap_sasl_getopt, NULL },
54 { SASL_CB_LIST_END, NULL, NULL }
55 };