]> git.sur5r.net Git - openldap/blobdiff - libraries/libldap/sasl.c
moved rdn parsing in a dedicated routine, ldap_str2rdn(), that can be used directly...
[openldap] / libraries / libldap / sasl.c
index 8945d957331159d1a61b272e67128582f27ca23b..a3630e9781bbaa994e99e1909253d6ffee5d807f 100644 (file)
@@ -97,7 +97,7 @@ ldap_sasl_bind(
                return ld->ld_errno;
        }
 
-       assert( BER_VALID( ber ) );
+       assert( LBER_VALID( ber ) );
 
        if( mechanism == LDAP_SASL_SIMPLE ) {
                /* simple bind */
@@ -186,6 +186,12 @@ ldap_sasl_bind_s(
                return( rc );
        }
 
+#ifdef LDAP_CONNECTIONLESS
+       if (LDAP_IS_UDP(ld)) {
+               return( rc );
+       }
+#endif
+
        if ( ldap_result( ld, msgid, 1, NULL, &result ) == -1 ) {
                return( ld->ld_errno ); /* ldap_result sets ld_errno */
        }
@@ -423,7 +429,16 @@ ldap_sasl_interactive_bind_s(
 #if defined( LDAP_R_COMPILE ) && defined( HAVE_CYRUS_SASL )
        ldap_pvt_thread_mutex_lock( &ldap_int_sasl_mutex );
 #endif
-
+#ifdef LDAP_CONNECTIONLESS
+       if( LDAP_IS_UDP(ld) ) {
+               /* Just force it to simple bind, silly to make the user
+                * ask all the time. No, we don't ever actually bind, but I'll
+                * let the final bind handler take care of saving the cdn.
+                */
+               rc = ldap_simple_bind(ld, dn, NULL);
+               return rc < 0 ? rc : 0;
+       } else
+#endif
        if( mechs == NULL || *mechs == '\0' ) {
                char *smechs;