]> git.sur5r.net Git - openldap/commitdiff
ITS#1720 chk_sasl for Cyrus SASL 2
authorHoward Chu <hyc@openldap.org>
Tue, 16 Apr 2002 04:05:51 +0000 (04:05 +0000)
committerHoward Chu <hyc@openldap.org>
Tue, 16 Apr 2002 04:05:51 +0000 (04:05 +0000)
libraries/liblutil/passwd.c

index ee9282310cb85f6302e15753d021a00776fdd159..dba06c9b2b1d8e5901726477d4a9755de7e5c901 100644 (file)
 #endif /* SLAPD_LMHASH */
 
 #ifdef SLAPD_SPASSWD
-#      include <sasl.h>
+#      ifdef HAVE_SASL_SASL_H
+#              include <sasl/sasl.h>
+#      else
+#              include <sasl.h>
+#      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