summaryrefslogtreecommitdiffstats
path: root/server
diff options
context:
space:
mode:
authorSimo Sorce <ssorce@redhat.com>2009-10-30 12:06:49 -0400
committerStephen Gallagher <sgallagh@redhat.com>2009-10-30 12:18:00 -0400
commit37c1d615be2745d518792f1ca8a7c2a98ecb12b2 (patch)
tree0182bbe62bb65d1683885ec32c15585cee5b0dc4 /server
parent5a32ac3ee59c41734ab2fe0f7fa9e0327a4fc8b5 (diff)
downloadsssd-37c1d615be2745d518792f1ca8a7c2a98ecb12b2.tar.gz
sssd-37c1d615be2745d518792f1ca8a7c2a98ecb12b2.tar.xz
sssd-37c1d615be2745d518792f1ca8a7c2a98ecb12b2.zip
Fix segfault when SASL is not used at all
Diffstat (limited to 'server')
-rw-r--r--server/providers/ldap/sdap.c2
-rw-r--r--server/providers/ldap/sdap_async.c4
2 files changed, 4 insertions, 2 deletions
diff --git a/server/providers/ldap/sdap.c b/server/providers/ldap/sdap.c
index d0ea9ffd9..94cea885c 100644
--- a/server/providers/ldap/sdap.c
+++ b/server/providers/ldap/sdap.c
@@ -395,6 +395,8 @@ bool sdap_rootdse_sasl_mech_is_supported(struct sysdb_attrs *rootdse,
struct ldb_val *val;
int i;
+ if (!sasl_mech) return false;
+
for (i = 0; i < rootdse->num; i++) {
if (strcasecmp(rootdse->a[i].name, "supportedSASLMechanisms")) {
continue;
diff --git a/server/providers/ldap/sdap_async.c b/server/providers/ldap/sdap_async.c
index ae6806f43..dfdd267e8 100644
--- a/server/providers/ldap/sdap_async.c
+++ b/server/providers/ldap/sdap_async.c
@@ -3405,7 +3405,7 @@ static void sdap_cli_connect_done(struct tevent_req *subreq)
sasl_mech = dp_opt_get_string(state->opts->basic, SDAP_SASL_MECH);
- if (state->use_rootdse) {
+ if (sasl_mech && state->use_rootdse) {
/* check if server claims to support GSSAPI */
if (!sdap_rootdse_sasl_mech_is_supported(state->rootdse,
sasl_mech)) {
@@ -3468,7 +3468,7 @@ static void sdap_cli_rootdse_done(struct tevent_req *subreq)
sasl_mech = dp_opt_get_string(state->opts->basic, SDAP_SASL_MECH);
- if (state->use_rootdse) {
+ if (sasl_mech && state->use_rootdse) {
/* check if server claims to support GSSAPI */
if (!sdap_rootdse_sasl_mech_is_supported(state->rootdse,
sasl_mech)) {