summaryrefslogtreecommitdiffstats
path: root/src/providers/ldap/sdap_async_connection.c
diff options
context:
space:
mode:
authorJakub Hrozek <jhrozek@redhat.com>2011-08-23 23:19:57 +0200
committerStephen Gallagher <sgallagh@redhat.com>2011-08-26 16:52:52 -0400
commita2e6bd6ed16c92799d435043450f6156a773a6dc (patch)
treea0234fa507a72afc720848788c625d6437a63671 /src/providers/ldap/sdap_async_connection.c
parent47db32cd9cb2147bb40909352569d7c8274365db (diff)
downloadsssd-a2e6bd6ed16c92799d435043450f6156a773a6dc.tar.gz
sssd-a2e6bd6ed16c92799d435043450f6156a773a6dc.tar.xz
sssd-a2e6bd6ed16c92799d435043450f6156a773a6dc.zip
Add LDAP provider option to set LDAP_OPT_X_SASL_NOCANON
https://fedorahosted.org/sssd/ticket/978
Diffstat (limited to 'src/providers/ldap/sdap_async_connection.c')
-rw-r--r--src/providers/ldap/sdap_async_connection.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/providers/ldap/sdap_async_connection.c b/src/providers/ldap/sdap_async_connection.c
index 6f67700db..b391aa96f 100644
--- a/src/providers/ldap/sdap_async_connection.c
+++ b/src/providers/ldap/sdap_async_connection.c
@@ -151,6 +151,7 @@ static void sdap_sys_connect_done(struct tevent_req *subreq)
int ldap_deref_val;
struct sdap_rebind_proc_params *rebind_proc_params;
int sd;
+ bool sasl_nocanon;
ret = sss_ldap_init_recv(subreq, &state->sh->ldap, &sd);
talloc_zfree(subreq);
@@ -260,6 +261,16 @@ static void sdap_sys_connect_done(struct tevent_req *subreq)
}
+ /* Set host name canonicalization for LDAP SASL bind */
+ sasl_nocanon = !dp_opt_get_bool(state->opts->basic, SDAP_SASL_CANONICALIZE);
+ lret = ldap_set_option(state->sh->ldap, LDAP_OPT_X_SASL_NOCANON,
+ sasl_nocanon ? LDAP_OPT_ON : LDAP_OPT_OFF);
+ if (lret != LDAP_OPT_SUCCESS) {
+ DEBUG(1, ("Failed to set LDAP SASL nocanon option to %s\n",
+ sasl_nocanon ? "true" : "false"));
+ goto fail;
+ }
+
/* if we do not use start_tls the connection is not really connected yet
* just fake an async procedure and leave connection to the bind call */
if (!state->use_start_tls) {