From 491d2ae5b99103fc889923c799d1badf18882092 Mon Sep 17 00:00:00 2001 From: Howard Chu Date: Tue, 16 Apr 2002 04:05:51 +0000 Subject: [PATCH] ITS#1720 chk_sasl for Cyrus SASL 2 --- libraries/liblutil/passwd.c | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) 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 -- 2.39.5