RDEBUG2("%s SASL bind auth operation as %s", sasl_ctx->rmech ? "Continuing" : "Starting", sasl_ctx->dn);
- ret = ldap_sasl_interactive_bind(sasl_ctx->c->handle, sasl_ctx->dn, sasl_ctx->mechs,
+ ret = ldap_sasl_interactive_bind(sasl_ctx->c->handle, NULL, sasl_ctx->mechs,
NULL, NULL, LDAP_SASL_AUTOMATIC,
_sasl_interact, sasl_ctx, sasl_ctx->result,
&sasl_ctx->rmech, &bind_auth_ctx->msgid);
switch (ret) {
case LDAP_SUCCESS:
+ bind_auth_ctx->ret = LDAP_PROC_SUCCESS;
return UNLANG_ACTION_CALCULATE_RESULT;
case LDAP_SASL_BIND_IN_PROGRESS:
case LDAP_PROC_SUCCESS:
if (bind_auth_ctx->type == LDAP_BIND_SIMPLE) break;
+
+ /*
+ * With SASL binds, we will be here after ldap_sasl_interactive_bind
+ * returned LDAP_SASL_BIND_IN_PROGRESS. That always requires a further
+ * call of ldap_sasl_interactive_bind to get the final result.
+ */
+ bind_auth_ctx->ret = LDAP_PROC_CONTINUE;
FALL_THROUGH;
case LDAP_PROC_CONTINUE:
auth_ctx->password, mod_env->user_sasl_proxy.vb_strvalue,
mod_env->user_sasl_realm.vb_strvalue) < 0) goto fail;
#else
-
RDEBUG("Configuration item 'sasl.mech' is not supported. "
"The linked version of libldap does not provide ldap_sasl_bind( function");
RETURN_MODULE_FAIL;