mirror of
https://git.openldap.org/openldap/openldap.git
synced 2025-12-20 22:59:34 -05:00
Added check for Cyrus SASL sasl_version()
This commit is contained in:
parent
4114c96ccd
commit
3cb7a09eb0
3 changed files with 49 additions and 0 deletions
|
|
@ -2194,6 +2194,12 @@ if test $ol_with_cyrus_sasl != no ; then
|
||||||
if test $ol_enable_spasswd != no ; then
|
if test $ol_enable_spasswd != no ; then
|
||||||
ol_link_spasswd=yes
|
ol_link_spasswd=yes
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
ac_save_LIBS="$LIBS"
|
||||||
|
LIBS="$LIBS $ol_link_sasl"
|
||||||
|
AC_CHECK_FUNC(sasl_version, [AC_DEFINE(HAVE_SASL_VERSION,1,
|
||||||
|
[define if your SASL library has sasl_version()])])
|
||||||
|
LIBS="$ac_save_LIBS"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
else
|
else
|
||||||
|
|
|
||||||
|
|
@ -56,6 +56,28 @@ int ldap_int_sasl_init( void )
|
||||||
{ SASL_CB_LIST_END, NULL, NULL }
|
{ SASL_CB_LIST_END, NULL, NULL }
|
||||||
};
|
};
|
||||||
|
|
||||||
|
#ifdef HAVE_SASL_VERSION
|
||||||
|
#define SASL_BUILD_VERSION ((SASL_VERSION_MAJOR << 24) |\
|
||||||
|
(SASL_VERSION_MINOR << 16) | SASL_VERSION_STEP)
|
||||||
|
|
||||||
|
{ int rc;
|
||||||
|
sasl_version( NULL, &rc );
|
||||||
|
if ( ((rc >> 16) != ((SASL_VERSION_MAJOR << 8)|SASL_VERSION_MINOR)) ||
|
||||||
|
(rc & 0xffff) < SASL_VERSION_STEP) {
|
||||||
|
|
||||||
|
#ifdef NEW_LOGGING
|
||||||
|
LDAP_LOG( TRANSPORT, INFO,
|
||||||
|
"ldap_int_sasl_init: SASL version mismatch, got %x, wanted %x.\n",
|
||||||
|
rc, SASL_BUILD_VERSION, 0 );
|
||||||
|
#else
|
||||||
|
Debug( LDAP_DEBUG_ANY,
|
||||||
|
"ldap_int_sasl_init: SASL version mismatch, got %x, wanted %x.\n",
|
||||||
|
rc, SASL_BUILD_VERSION, 0 );
|
||||||
|
#endif
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
#endif
|
||||||
if ( sasl_initialized ) {
|
if ( sasl_initialized ) {
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1091,6 +1091,27 @@ int slap_sasl_init( void )
|
||||||
{ SASL_CB_LIST_END, NULL, NULL }
|
{ SASL_CB_LIST_END, NULL, NULL }
|
||||||
};
|
};
|
||||||
|
|
||||||
|
#ifdef HAVE_SASL_VERSION
|
||||||
|
#define SASL_BUILD_VERSION ((SASL_VERSION_MAJOR << 24) |\
|
||||||
|
(SASL_VERSION_MINOR << 16) | SASL_VERSION_STEP)
|
||||||
|
|
||||||
|
sasl_version( NULL, &rc );
|
||||||
|
if ( ((rc >> 16) != ((SASL_VERSION_MAJOR << 8)|SASL_VERSION_MINOR)) ||
|
||||||
|
(rc & 0xffff) < SASL_VERSION_STEP) {
|
||||||
|
|
||||||
|
#ifdef NEW_LOGGING
|
||||||
|
LDAP_LOG( TRANSPORT, INFO,
|
||||||
|
"slap_sasl_init: SASL version mismatch, got %x, wanted %x.\n",
|
||||||
|
rc, SASL_BUILD_VERSION, 0 );
|
||||||
|
#else
|
||||||
|
Debug( LDAP_DEBUG_ANY,
|
||||||
|
"slap_sasl_init: SASL version mismatch, got %x, wanted %x.\n",
|
||||||
|
rc, SASL_BUILD_VERSION, 0 );
|
||||||
|
#endif
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
sasl_set_alloc(
|
sasl_set_alloc(
|
||||||
ber_memalloc,
|
ber_memalloc,
|
||||||
ber_memcalloc,
|
ber_memcalloc,
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue