diff options
Diffstat (limited to 'source4/dsdb/samdb')
-rw-r--r-- | source4/dsdb/samdb/ldb_modules/kludge_acl.c | 14 | ||||
-rw-r--r-- | source4/dsdb/samdb/ldb_modules/rootdse.c | 2 |
2 files changed, 7 insertions, 9 deletions
diff --git a/source4/dsdb/samdb/ldb_modules/kludge_acl.c b/source4/dsdb/samdb/ldb_modules/kludge_acl.c index 0d0a266119..83c7d14da4 100644 --- a/source4/dsdb/samdb/ldb_modules/kludge_acl.c +++ b/source4/dsdb/samdb/ldb_modules/kludge_acl.c @@ -196,14 +196,11 @@ static int kludge_acl_init_2(struct ldb_module *module) NULL, attrs, &res); if (ret != LDB_SUCCESS) { - talloc_free(mem_ctx); - return ret; + goto done; } talloc_steal(mem_ctx, res); if (res->count == 0) { - talloc_free(mem_ctx); - data->password_attrs = NULL; - return LDB_SUCCESS; + goto done; } if (res->count > 1) { @@ -215,8 +212,7 @@ static int kludge_acl_init_2(struct ldb_module *module) password_attributes = ldb_msg_find_element(msg, "passwordAttribute"); if (!password_attributes) { - talloc_free(mem_ctx); - return LDB_SUCCESS; + goto done; } data->password_attrs = talloc_array(data, const char *, password_attributes->num_values + 1); if (!data->password_attrs) { @@ -228,8 +224,10 @@ static int kludge_acl_init_2(struct ldb_module *module) talloc_steal(data->password_attrs, password_attributes->values[i].data); } data->password_attrs[i] = NULL; + +done: talloc_free(mem_ctx); - return LDB_SUCCESS; + return ldb_next_second_stage_init(module); } static const struct ldb_module_ops kludge_acl_ops = { diff --git a/source4/dsdb/samdb/ldb_modules/rootdse.c b/source4/dsdb/samdb/ldb_modules/rootdse.c index fc1bfa824e..5f5b362c53 100644 --- a/source4/dsdb/samdb/ldb_modules/rootdse.c +++ b/source4/dsdb/samdb/ldb_modules/rootdse.c @@ -82,7 +82,7 @@ static int rootdse_add_dynamic(struct ldb_module *module, struct ldb_request *re server_creds = talloc_get_type(ldb_get_opaque(module->ldb, "server_credentials"), struct cli_credentials); - if (do_attribute(s->attrs, "supportedSASLMechanisms")) { + if (server_creds && do_attribute(s->attrs, "supportedSASLMechanisms")) { struct gensec_security_ops **backends = gensec_security_all(); enum credentials_use_kerberos use_kerberos = cli_credentials_get_kerberos_state(server_creds); |