summaryrefslogtreecommitdiff
path: root/src/providers/ipa
diff options
context:
space:
mode:
authorJakub Hrozek <jhrozek@redhat.com>2013-05-21 17:18:03 +0200
committerJakub Hrozek <jhrozek@redhat.com>2013-06-07 00:14:12 +0200
commitdcb44c39dda9699cdd6488fd116a51ced0687de3 (patch)
tree71b463b2c64a5de1f7c0983d74700b264892bb96 /src/providers/ipa
parent7119f0c483049a8850d3075c0b1062f35200a538 (diff)
downloadsssd-dcb44c39dda9699cdd6488fd116a51ced0687de3.tar.gz
sssd-dcb44c39dda9699cdd6488fd116a51ced0687de3.tar.bz2
sssd-dcb44c39dda9699cdd6488fd116a51ced0687de3.zip
LDAP: sdap_id_ctx might contain several connections
With some LDAP server implementations, one server might provide different "views" of the identites on different ports. One example is the Active Directory Global catalog. The provider would contact different view depending on which operation it is performing and against which SSSD domain. At the same time, these views run on the same server, which means the same server options, enumeration, cleanup or Kerberos service should be used. So instead of using several different failover ports or several instances of sdap_id_ctx, this patch introduces a new "struct sdap_id_conn_ctx" that contains the connection cache to the particular view and an instance of "struct sdap_options" that contains the URI. No functional changes are present in this patch, currently all providers use a single connection. Multiple connections will be used later in the upcoming patches.
Diffstat (limited to 'src/providers/ipa')
-rw-r--r--src/providers/ipa/ipa_access.c2
-rw-r--r--src/providers/ipa/ipa_auth.c3
-rw-r--r--src/providers/ipa/ipa_hostid.c2
-rw-r--r--src/providers/ipa/ipa_id.c2
-rw-r--r--src/providers/ipa/ipa_init.c10
-rw-r--r--src/providers/ipa/ipa_selinux.c3
-rw-r--r--src/providers/ipa/ipa_subdomains.c2
-rw-r--r--src/providers/ipa/ipa_subdomains_id.c2
8 files changed, 11 insertions, 15 deletions
diff --git a/src/providers/ipa/ipa_access.c b/src/providers/ipa/ipa_access.c
index c43974e3..3760c6f7 100644
--- a/src/providers/ipa/ipa_access.c
+++ b/src/providers/ipa/ipa_access.c
@@ -208,7 +208,7 @@ static int hbac_retry(struct hbac_ctx *hbac_ctx)
if (!offline) {
if (hbac_ctx->sdap_op == NULL) {
hbac_ctx->sdap_op = sdap_id_op_create(hbac_ctx,
- hbac_ctx->sdap_ctx->conn_cache);
+ hbac_ctx->sdap_ctx->conn->conn_cache);
if (hbac_ctx->sdap_op == NULL) {
DEBUG(1, ("sdap_id_op_create failed.\n"));
return EIO;
diff --git a/src/providers/ipa/ipa_auth.c b/src/providers/ipa/ipa_auth.c
index b528c544..651196a9 100644
--- a/src/providers/ipa/ipa_auth.c
+++ b/src/providers/ipa/ipa_auth.c
@@ -71,7 +71,8 @@ static struct tevent_req *get_password_migration_flag_send(TALLOC_CTX *memctx,
state->password_migration = false;
state->ipa_realm = ipa_realm;
- state->sdap_op = sdap_id_op_create(state, state->sdap_id_ctx->conn_cache);
+ state->sdap_op = sdap_id_op_create(state,
+ state->sdap_id_ctx->conn->conn_cache);
if (state->sdap_op == NULL) {
DEBUG(SSSDBG_OP_FAILURE, ("sdap_id_op_create failed.\n"));
goto fail;
diff --git a/src/providers/ipa/ipa_hostid.c b/src/providers/ipa/ipa_hostid.c
index cb37e9a4..a697dbf6 100644
--- a/src/providers/ipa/ipa_hostid.c
+++ b/src/providers/ipa/ipa_hostid.c
@@ -165,7 +165,7 @@ hosts_get_send(TALLOC_CTX *memctx,
state->ctx = hostid_ctx;
state->dp_error = DP_ERR_FATAL;
- state->op = sdap_id_op_create(state, ctx->conn_cache);
+ state->op = sdap_id_op_create(state, ctx->conn->conn_cache);
if (!state->op) {
DEBUG(SSSDBG_OP_FAILURE, ("sdap_id_op_create failed\n"));
ret = ENOMEM;
diff --git a/src/providers/ipa/ipa_id.c b/src/providers/ipa/ipa_id.c
index 5f94eb2c..b7ae81f6 100644
--- a/src/providers/ipa/ipa_id.c
+++ b/src/providers/ipa/ipa_id.c
@@ -174,7 +174,7 @@ static struct tevent_req *ipa_id_get_netgroup_send(TALLOC_CTX *memctx,
state->ctx = ipa_ctx;
state->dp_error = DP_ERR_FATAL;
- state->op = sdap_id_op_create(state, ctx->conn_cache);
+ state->op = sdap_id_op_create(state, ctx->conn->conn_cache);
if (!state->op) {
DEBUG(2, ("sdap_id_op_create failed\n"));
ret = ENOMEM;
diff --git a/src/providers/ipa/ipa_init.c b/src/providers/ipa/ipa_init.c
index 9676b781..8363ca6d 100644
--- a/src/providers/ipa/ipa_init.c
+++ b/src/providers/ipa/ipa_init.c
@@ -138,12 +138,10 @@ int sssm_ipa_id_init(struct be_ctx *bectx,
ipa_options->id_ctx = ipa_ctx;
ipa_ctx->ipa_options = ipa_options;
- sdap_ctx = talloc_zero(ipa_options, struct sdap_id_ctx);
- if (!sdap_ctx) {
+ sdap_ctx = sdap_id_ctx_new(ipa_options, bectx, ipa_options->service->sdap);
+ if (sdap_ctx == NULL) {
return ENOMEM;
}
- sdap_ctx->be = bectx;
- sdap_ctx->service = ipa_options->service->sdap;
ipa_ctx->sdap_id_ctx = sdap_ctx;
ret = ipa_get_id_options(ipa_options, bectx->cdb,
@@ -188,10 +186,6 @@ int sssm_ipa_id_init(struct be_ctx *bectx,
goto done;
}
- ret = sdap_id_conn_cache_create(sdap_ctx, sdap_ctx, &sdap_ctx->conn_cache);
- if (ret != EOK) {
- goto done;
- }
/* Set up the ID mapping object */
ret = sdap_idmap_init(sdap_ctx, sdap_ctx, &sdap_ctx->opts->idmap_ctx);
diff --git a/src/providers/ipa/ipa_selinux.c b/src/providers/ipa/ipa_selinux.c
index ce8f39cc..39bebebf 100644
--- a/src/providers/ipa/ipa_selinux.c
+++ b/src/providers/ipa/ipa_selinux.c
@@ -864,7 +864,8 @@ ipa_get_selinux_send(TALLOC_CTX *mem_ctx,
}
if (!offline) {
- state->op = sdap_id_op_create(state, selinux_ctx->id_ctx->sdap_id_ctx->conn_cache);
+ state->op = sdap_id_op_create(state,
+ selinux_ctx->id_ctx->sdap_id_ctx->conn->conn_cache);
if (!state->op) {
DEBUG(SSSDBG_OP_FAILURE, ("sdap_id_op_create failed\n"));
ret = ENOMEM;
diff --git a/src/providers/ipa/ipa_subdomains.c b/src/providers/ipa/ipa_subdomains.c
index 95a11198..18878ae3 100644
--- a/src/providers/ipa/ipa_subdomains.c
+++ b/src/providers/ipa/ipa_subdomains.c
@@ -558,7 +558,7 @@ static void ipa_subdomains_retrieve(struct ipa_subdomains_ctx *ctx, struct be_re
req_ctx->reply = NULL;
req_ctx->sdap_op = sdap_id_op_create(req_ctx,
- ctx->sdap_id_ctx->conn_cache);
+ ctx->sdap_id_ctx->conn->conn_cache);
if (req_ctx->sdap_op == NULL) {
DEBUG(SSSDBG_OP_FAILURE, ("sdap_id_op_create failed.\n"));
ret = ENOMEM;
diff --git a/src/providers/ipa/ipa_subdomains_id.c b/src/providers/ipa/ipa_subdomains_id.c
index ea313cba..7fa09bd9 100644
--- a/src/providers/ipa/ipa_subdomains_id.c
+++ b/src/providers/ipa/ipa_subdomains_id.c
@@ -66,7 +66,7 @@ struct tevent_req *ipa_get_subdom_acct_send(TALLOC_CTX *memctx,
state->ctx = ctx;
state->dp_error = DP_ERR_FATAL;
- state->op = sdap_id_op_create(state, state->ctx->conn_cache);
+ state->op = sdap_id_op_create(state, state->ctx->conn->conn_cache);
if (!state->op) {
DEBUG(SSSDBG_OP_FAILURE, ("sdap_id_op_create failed\n"));
ret = ENOMEM;