X-Git-Url: https://git.sur5r.net/?a=blobdiff_plain;f=servers%2Fslapd%2Fsasl.c;h=f973098617c29da2d0a0d4aa90ff124528fa3492;hb=49b0985c88ea6836a24c314aea2cb2dd0d129544;hp=bdd018990548e0665303ab1b200fd1a097334421;hpb=e30a736354928ed7a3bd9ad84972a46a945be1fc;p=openldap diff --git a/servers/slapd/sasl.c b/servers/slapd/sasl.c index bdd0189905..f973098617 100644 --- a/servers/slapd/sasl.c +++ b/servers/slapd/sasl.c @@ -45,6 +45,10 @@ # endif static sasl_security_properties_t sasl_secprops; + +#define SASL_VERSION_FULL ((SASL_VERSION_MAJOR << 16) |\ + (SASL_VERSION_MINOR << 8) | SASL_VERSION_STEP) + #endif /* HAVE_CYRUS_SASL */ #include "ldap_pvt.h" @@ -319,7 +323,7 @@ typedef struct lookup_info { sasl_server_params_t *sparams; } lookup_info; -static slap_response sasl_ap_lookup, sasl_ap_store, sasl_cb_checkpass; +static slap_response sasl_ap_lookup, sasl_cb_checkpass; static int sasl_ap_lookup( Operation *op, SlapReply *rs ) @@ -468,12 +472,7 @@ slap_auxprop_lookup( } } -static int -sasl_ap_store( Operation *op, SlapReply *rs ) -{ - return 0; -} - +#if SASL_VERSION_FULL >= 0x020110 static int slap_auxprop_store( void *glob_context, @@ -488,7 +487,7 @@ slap_auxprop_store( Connection *conn = NULL; const struct propval *pr; Modifications *modlist = NULL, **modtail = &modlist, *mod; - slap_callback cb = { sasl_ap_store, NULL }; + slap_callback cb = { slap_null_cb, NULL }; char textbuf[SLAP_TEXT_BUFLEN]; const char *text; size_t textlen = sizeof(textbuf); @@ -573,6 +572,7 @@ slap_auxprop_store( slap_mods_free( modlist ); return rc ? SASL_FAIL : SASL_OK; } +#endif /* SASL_VERSION_FULL >= 2.1.16 */ static sasl_auxprop_plug_t slap_auxprop_plugin = { 0, /* Features */ @@ -581,8 +581,12 @@ static sasl_auxprop_plug_t slap_auxprop_plugin = { NULL, /* auxprop_free */ slap_auxprop_lookup, "slapd", /* name */ +#if SASL_VERSION_FULL >= 0x020110 slap_auxprop_store /* the declaration of this member changed * in cyrus SASL from 2.1.15 to 2.1.16 */ +#else + NULL +#endif }; static int @@ -1694,14 +1698,12 @@ done: #endif /* HAVE_CYRUS_SASL */ /* Take any sort of identity string and return a DN with the "dn:" prefix. The - string returned in *dn is in its own allocated memory, and must be free'd - by the calling process. - -Mark Adamson, Carnegie Mellon - - The "dn:" prefix is no longer used anywhere inside slapd. It is only used - on strings passed in directly from SASL. - -Howard Chu, Symas Corp. -*/ + * string returned in *dn is in its own allocated memory, and must be free'd + * by the calling process. -Mark Adamson, Carnegie Mellon + * + * The "dn:" prefix is no longer used anywhere inside slapd. It is only used + * on strings passed in directly from SASL. -Howard Chu, Symas Corp. + */ #define SET_NONE 0 #define SET_DN 1