summaryrefslogtreecommitdiffstats
path: root/src/providers
diff options
context:
space:
mode:
authorJan Zeleny <jzeleny@redhat.com>2011-11-21 06:26:44 -0500
committerStephen Gallagher <sgallagh@redhat.com>2011-12-08 12:02:32 -0500
commit8c60644bd8f2d739ff7a58b3717929254d09dfbe (patch)
tree52a062e02fabcec7407c775e29112afffba0b467 /src/providers
parenta63aee266c6d41216c606c2efa459f9477875cc7 (diff)
downloadsssd-8c60644bd8f2d739ff7a58b3717929254d09dfbe.tar.gz
sssd-8c60644bd8f2d739ff7a58b3717929254d09dfbe.tar.xz
sssd-8c60644bd8f2d739ff7a58b3717929254d09dfbe.zip
Add ldap_sasl_minssf option
https://fedorahosted.org/sssd/ticket/1075
Diffstat (limited to 'src/providers')
-rw-r--r--src/providers/ipa/ipa_common.c1
-rw-r--r--src/providers/ipa/ipa_common.h2
-rw-r--r--src/providers/ldap/ldap_common.c1
-rw-r--r--src/providers/ldap/sdap.h1
-rw-r--r--src/providers/ldap/sdap_async_connection.c17
5 files changed, 21 insertions, 1 deletions
diff --git a/src/providers/ipa/ipa_common.c b/src/providers/ipa/ipa_common.c
index 05299931c..de7c20d11 100644
--- a/src/providers/ipa/ipa_common.c
+++ b/src/providers/ipa/ipa_common.c
@@ -75,6 +75,7 @@ struct dp_option ipa_def_ldap_opts[] = {
{ "ldap_sasl_mech", DP_OPT_STRING, { "GSSAPI" } , NULL_STRING },
{ "ldap_sasl_authid", DP_OPT_STRING, NULL_STRING, NULL_STRING },
{ "ldap_sasl_realm", DP_OPT_STRING, NULL_STRING, NULL_STRING },
+ { "ldap_sasl_minssf", DP_OPT_NUMBER, { .number = 56 }, NULL_NUMBER },
{ "ldap_krb5_keytab", DP_OPT_STRING, NULL_STRING, NULL_STRING },
{ "ldap_krb5_init_creds", DP_OPT_BOOL, BOOL_TRUE, BOOL_TRUE },
/* use the same parm name as the krb5 module so we set it only once */
diff --git a/src/providers/ipa/ipa_common.h b/src/providers/ipa/ipa_common.h
index d415d4d01..1ab1983f3 100644
--- a/src/providers/ipa/ipa_common.h
+++ b/src/providers/ipa/ipa_common.h
@@ -35,7 +35,7 @@ struct ipa_service {
/* the following defines are used to keep track of the options in the ldap
* module, so that if they change and ipa is not updated correspondingly
* this will trigger a runtime abort error */
-#define IPA_OPTS_BASIC_TEST 53
+#define IPA_OPTS_BASIC_TEST 54
/* the following define is used to keep track of the options in the krb5
* module, so that if they change and ipa is not updated correspondingly
diff --git a/src/providers/ldap/ldap_common.c b/src/providers/ldap/ldap_common.c
index 6b4e1b95f..170720c3f 100644
--- a/src/providers/ldap/ldap_common.c
+++ b/src/providers/ldap/ldap_common.c
@@ -64,6 +64,7 @@ struct dp_option default_basic_opts[] = {
{ "ldap_sasl_mech", DP_OPT_STRING, NULL_STRING, NULL_STRING },
{ "ldap_sasl_authid", DP_OPT_STRING, NULL_STRING, NULL_STRING },
{ "ldap_sasl_realm", DP_OPT_STRING, NULL_STRING, NULL_STRING },
+ { "ldap_sasl_minssf", DP_OPT_NUMBER, { .number = -1 }, NULL_NUMBER },
{ "ldap_krb5_keytab", DP_OPT_STRING, NULL_STRING, NULL_STRING },
{ "ldap_krb5_init_creds", DP_OPT_BOOL, BOOL_TRUE, BOOL_TRUE },
/* use the same parm name as the krb5 module so we set it only once */
diff --git a/src/providers/ldap/sdap.h b/src/providers/ldap/sdap.h
index d25e87bdf..3ab726aad 100644
--- a/src/providers/ldap/sdap.h
+++ b/src/providers/ldap/sdap.h
@@ -179,6 +179,7 @@ enum sdap_basic_opt {
SDAP_SASL_MECH,
SDAP_SASL_AUTHID,
SDAP_SASL_REALM,
+ SDAP_SASL_MINSSF,
SDAP_KRB5_KEYTAB,
SDAP_KRB5_KINIT,
SDAP_KRB5_KDC,
diff --git a/src/providers/ldap/sdap_async_connection.c b/src/providers/ldap/sdap_async_connection.c
index 1f829f176..38f493036 100644
--- a/src/providers/ldap/sdap_async_connection.c
+++ b/src/providers/ldap/sdap_async_connection.c
@@ -150,6 +150,8 @@ static void sdap_sys_connect_done(struct tevent_req *subreq)
struct sdap_rebind_proc_params *rebind_proc_params;
int sd;
bool sasl_nocanon;
+ const char *sasl_mech;
+ int sasl_minssf;
ret = sss_ldap_init_recv(subreq, &state->sh->ldap, &sd);
talloc_zfree(subreq);
@@ -269,6 +271,21 @@ static void sdap_sys_connect_done(struct tevent_req *subreq)
goto fail;
}
+ sasl_mech = dp_opt_get_string(state->opts->basic, SDAP_SASL_MECH);
+ if (sasl_mech != NULL) {
+ sasl_minssf = dp_opt_get_int(state->opts->basic, SDAP_SASL_MINSSF);
+ if (sasl_minssf >= 0) {
+ lret = ldap_set_option(state->sh->ldap, LDAP_OPT_X_SASL_SSF_MIN,
+ &sasl_minssf);
+ if (lret != LDAP_OPT_SUCCESS) {
+ DEBUG(SSSDBG_CRIT_FAILURE,
+ ("Failed to set LDAP MIN SSF option to %d\n",
+ sasl_minssf));
+ 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) {