summaryrefslogtreecommitdiff
path: root/src/providers
diff options
context:
space:
mode:
authorJakub Hrozek <jhrozek@redhat.com>2012-04-04 22:08:31 +0200
committerStephen Gallagher <sgallagh@redhat.com>2012-04-18 10:23:55 -0400
commit280a07e60639dfbcfa41c2626e5fe95870b9f473 (patch)
tree5b29795b29a67f5aa72de45b984fffc0819e623e /src/providers
parentbd09ead65cded3207cf228c44a31bbc87c2979bd (diff)
downloadsssd-280a07e60639dfbcfa41c2626e5fe95870b9f473.tar.gz
sssd-280a07e60639dfbcfa41c2626e5fe95870b9f473.tar.bz2
sssd-280a07e60639dfbcfa41c2626e5fe95870b9f473.zip
Do not call sdap_auth if not needed
Diffstat (limited to 'src/providers')
-rw-r--r--src/providers/ldap/sdap_async_connection.c18
1 files changed, 11 insertions, 7 deletions
diff --git a/src/providers/ldap/sdap_async_connection.c b/src/providers/ldap/sdap_async_connection.c
index 02963f32..1f50c198 100644
--- a/src/providers/ldap/sdap_async_connection.c
+++ b/src/providers/ldap/sdap_async_connection.c
@@ -1504,9 +1504,15 @@ static void sdap_cli_auth_step(struct tevent_req *req)
struct tevent_req *subreq;
time_t now;
int expire_timeout;
-
- if (!state->do_auth) {
- /* No authentication requested or GSSAPI auth forced off */
+ const char *sasl_mech = dp_opt_get_string(state->opts->basic,
+ SDAP_SASL_MECH);
+ const char *user_dn = dp_opt_get_string(state->opts->basic,
+ SDAP_DEFAULT_BIND_DN);
+
+ if (!state->do_auth ||
+ (sasl_mech == NULL && user_dn == NULL)) {
+ DEBUG(SSSDBG_TRACE_LIBS,
+ ("No authentication requested or SASL auth forced off\n"));
tevent_req_done(req);
return;
}
@@ -1524,12 +1530,10 @@ static void sdap_cli_auth_step(struct tevent_req *req)
subreq = sdap_auth_send(state,
state->ev,
state->sh,
- dp_opt_get_string(state->opts->basic,
- SDAP_SASL_MECH),
+ sasl_mech,
dp_opt_get_string(state->opts->basic,
SDAP_SASL_AUTHID),
- dp_opt_get_string(state->opts->basic,
- SDAP_DEFAULT_BIND_DN),
+ user_dn,
dp_opt_get_string(state->opts->basic,
SDAP_DEFAULT_AUTHTOK_TYPE),
dp_opt_get_blob(state->opts->basic,