]> git.sur5r.net Git - openldap/commitdiff
Fallback typedef for slap_sasl_cb_ft
authorHallvard Furuseth <h.b.furuseth@usit.uio.no>
Mon, 4 May 2015 18:52:00 +0000 (20:52 +0200)
committerHallvard Furuseth <h.b.furuseth@usit.uio.no>
Mon, 4 May 2015 18:52:00 +0000 (20:52 +0200)
servers/slapd/sasl.c

index d110b8c30b8a8b73335b6c5714c33af85965a1af..32bb691db3ea3c4a45647db96894aa31a66f5dce 100644 (file)
 #define SASL_VERSION_FULL      ((SASL_VERSION_MAJOR << 16) |\
        (SASL_VERSION_MINOR << 8) | SASL_VERSION_STEP)
 
+#if SASL_VERSION_MINOR >= 0x020119 /* 2.1.25 */
+typedef sasl_callback_ft slap_sasl_cb_ft;
+#else
+typedef int (*slap_sasl_cb_ft)();
+#endif
+
 static sasl_security_properties_t sasl_secprops;
 #elif defined( SLAP_BUILTIN_SASL )
 /*
@@ -1232,8 +1238,8 @@ int slap_sasl_init( void )
 #ifdef HAVE_CYRUS_SASL
        int rc;
        static sasl_callback_t server_callbacks[] = {
-               { SASL_CB_LOG, (sasl_callback_ft)&slap_sasl_log, NULL },
-               { SASL_CB_GETOPT, (sasl_callback_ft)&slap_sasl_getopt, NULL },
+               { SASL_CB_LOG, (slap_sasl_cb_ft)&slap_sasl_log, NULL },
+               { SASL_CB_GETOPT, (slap_sasl_cb_ft)&slap_sasl_getopt, NULL },
                { SASL_CB_LIST_END, NULL, NULL }
        };
 #endif
@@ -1384,15 +1390,15 @@ int slap_sasl_open( Connection *conn, int reopen )
                conn->c_sasl_extra = session_callbacks;
 
                session_callbacks[cb=0].id = SASL_CB_LOG;
-               session_callbacks[cb].proc = (sasl_callback_ft)&slap_sasl_log;
+               session_callbacks[cb].proc = (slap_sasl_cb_ft)&slap_sasl_log;
                session_callbacks[cb++].context = conn;
 
                session_callbacks[cb].id = SASL_CB_PROXY_POLICY;
-               session_callbacks[cb].proc = (sasl_callback_ft)&slap_sasl_authorize;
+               session_callbacks[cb].proc = (slap_sasl_cb_ft)&slap_sasl_authorize;
                session_callbacks[cb++].context = conn;
 
                session_callbacks[cb].id = SASL_CB_CANON_USER;
-               session_callbacks[cb].proc = (sasl_callback_ft)&slap_sasl_canonicalize;
+               session_callbacks[cb].proc = (slap_sasl_cb_ft)&slap_sasl_canonicalize;
                session_callbacks[cb++].context = conn;
 
                session_callbacks[cb].id = SASL_CB_LIST_END;