From: Howard Chu Date: Tue, 16 Apr 2002 04:05:51 +0000 (+0000) Subject: ITS#1720 chk_sasl for Cyrus SASL 2 X-Git-Tag: OPENLDAP_REL_ENG_2_MP~188 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=491d2ae5b99103fc889923c799d1badf18882092;p=openldap ITS#1720 chk_sasl for Cyrus SASL 2 --- diff --git a/libraries/liblutil/passwd.c b/libraries/liblutil/passwd.c index ee9282310c..dba06c9b2b 100644 --- a/libraries/liblutil/passwd.c +++ b/libraries/liblutil/passwd.c @@ -28,7 +28,11 @@ #endif /* SLAPD_LMHASH */ #ifdef SLAPD_SPASSWD -# include +# ifdef HAVE_SASL_SASL_H +# include +# else +# include +# endif #endif #ifdef SLAPD_KPASSWD @@ -659,14 +663,18 @@ static int chk_sasl( #ifdef HAVE_CYRUS_SASL if( lutil_passwd_sasl_conn != NULL ) { - const char *errstr = NULL; int sc; - +# if SASL_VERSION_MAJOR < 2 + const char *errstr = NULL; sc = sasl_checkpass( lutil_passwd_sasl_conn, passwd->bv_val, passwd->bv_len, cred->bv_val, cred->bv_len, &errstr ); - +# else + sc = sasl_checkpass( lutil_passwd_sasl_conn, + passwd->bv_val, passwd->bv_len, + cred->bv_val, cred->bv_len ); +# endif rtn = ( sc != SASL_OK ); } #endif