summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/providers/ad/ad_id.c2
-rw-r--r--src/providers/ipa/ipa_id.c2
-rw-r--r--src/providers/ldap/ldap_common.h10
-rw-r--r--src/providers/ldap/ldap_id.c59
-rw-r--r--src/providers/ldap/ldap_id_netgroup.c11
-rw-r--r--src/providers/ldap/ldap_id_services.c5
-rw-r--r--src/providers/ldap/sdap_async.h1
-rw-r--r--src/providers/ldap/sdap_async_initgroups.c5
8 files changed, 64 insertions, 31 deletions
diff --git a/src/providers/ad/ad_id.c b/src/providers/ad/ad_id.c
index f6e975e1..5d8c7837 100644
--- a/src/providers/ad/ad_id.c
+++ b/src/providers/ad/ad_id.c
@@ -34,7 +34,7 @@ ad_account_info_handler(struct be_req *be_req)
struct ad_id_ctx);
sdap_id_ctx = ad_ctx->sdap_id_ctx;
- return sdap_handle_account_info(be_req, sdap_id_ctx);
+ return sdap_handle_account_info(be_req, sdap_id_ctx, sdap_id_ctx->conn);
}
void
diff --git a/src/providers/ipa/ipa_id.c b/src/providers/ipa/ipa_id.c
index b7ae81f6..b11abaa7 100644
--- a/src/providers/ipa/ipa_id.c
+++ b/src/providers/ipa/ipa_id.c
@@ -97,7 +97,7 @@ void ipa_account_info_handler(struct be_req *breq)
} else {
/* any account request is handled by sdap,
* any invalid request is caught there. */
- return sdap_handle_account_info(breq, ctx);
+ return sdap_handle_account_info(breq, ctx, ctx->conn);
}
if (!req) {
diff --git a/src/providers/ldap/ldap_common.h b/src/providers/ldap/ldap_common.h
index e22bff1e..5dfa6004 100644
--- a/src/providers/ldap/ldap_common.h
+++ b/src/providers/ldap/ldap_common.h
@@ -93,14 +93,16 @@ errno_t sdap_reinit_cleanup_recv(struct tevent_req *req);
/* id */
void sdap_account_info_handler(struct be_req *breq);
-void sdap_handle_account_info(struct be_req *breq, struct sdap_id_ctx *ctx);
+void sdap_handle_account_info(struct be_req *breq, struct sdap_id_ctx *ctx,
+ struct sdap_id_conn_ctx *conn);
int sdap_id_setup_tasks(struct sdap_id_ctx *ctx);
struct tevent_req *
sdap_handle_acct_req_send(TALLOC_CTX *mem_ctx,
struct be_req *breq,
struct be_acct_req *ar,
- struct sdap_id_ctx *id_ctx);
+ struct sdap_id_ctx *id_ctx,
+ struct sdap_id_conn_ctx *conn);
errno_t
sdap_handle_acct_req_recv(struct tevent_req *req,
int *_dp_error, const char **_err);
@@ -172,15 +174,16 @@ void sdap_mark_offline(struct sdap_id_ctx *ctx);
struct tevent_req *groups_get_send(TALLOC_CTX *memctx,
struct tevent_context *ev,
struct sdap_id_ctx *ctx,
+ struct sdap_id_conn_ctx *conn,
const char *name,
int filter_type,
int attrs_type);
int groups_get_recv(struct tevent_req *req, int *dp_error_out);
-
struct tevent_req *ldap_netgroup_get_send(TALLOC_CTX *memctx,
struct tevent_context *ev,
struct sdap_id_ctx *ctx,
+ struct sdap_id_conn_ctx *conn,
const char *name);
int ldap_netgroup_get_recv(struct tevent_req *req, int *dp_error_out);
@@ -188,6 +191,7 @@ struct tevent_req *
services_get_send(TALLOC_CTX *mem_ctx,
struct tevent_context *ev,
struct sdap_id_ctx *id_ctx,
+ struct sdap_id_conn_ctx *conn,
const char *name,
const char *protocol,
int filter_type);
diff --git a/src/providers/ldap/ldap_id.c b/src/providers/ldap/ldap_id.c
index c04d90fb..1f3c62bb 100644
--- a/src/providers/ldap/ldap_id.c
+++ b/src/providers/ldap/ldap_id.c
@@ -39,6 +39,7 @@
struct users_get_state {
struct tevent_context *ev;
struct sdap_id_ctx *ctx;
+ struct sdap_id_conn_ctx *conn;
struct sdap_id_op *op;
struct sysdb_ctx *sysdb;
struct sss_domain_info *domain;
@@ -59,6 +60,7 @@ static void users_get_done(struct tevent_req *subreq);
struct tevent_req *users_get_send(TALLOC_CTX *memctx,
struct tevent_context *ev,
struct sdap_id_ctx *ctx,
+ struct sdap_id_conn_ctx *conn,
const char *name,
int filter_type,
int attrs_type)
@@ -78,9 +80,10 @@ struct tevent_req *users_get_send(TALLOC_CTX *memctx,
state->ev = ev;
state->ctx = ctx;
+ state->conn = conn;
state->dp_error = DP_ERR_FATAL;
- state->op = sdap_id_op_create(state, state->ctx->conn->conn_cache);
+ state->op = sdap_id_op_create(state, state->conn->conn_cache);
if (!state->op) {
DEBUG(2, ("sdap_id_op_create failed\n"));
ret = ENOMEM;
@@ -360,6 +363,7 @@ int users_get_recv(struct tevent_req *req, int *dp_error_out)
struct groups_get_state {
struct tevent_context *ev;
struct sdap_id_ctx *ctx;
+ struct sdap_id_conn_ctx *conn;
struct sdap_id_op *op;
struct sysdb_ctx *sysdb;
struct sss_domain_info *domain;
@@ -380,6 +384,7 @@ static void groups_get_done(struct tevent_req *subreq);
struct tevent_req *groups_get_send(TALLOC_CTX *memctx,
struct tevent_context *ev,
struct sdap_id_ctx *ctx,
+ struct sdap_id_conn_ctx *conn,
const char *name,
int filter_type,
int attrs_type)
@@ -401,9 +406,10 @@ struct tevent_req *groups_get_send(TALLOC_CTX *memctx,
state->ev = ev;
state->ctx = ctx;
+ state->conn = conn;
state->dp_error = DP_ERR_FATAL;
- state->op = sdap_id_op_create(state, state->ctx->conn->conn_cache);
+ state->op = sdap_id_op_create(state, state->conn->conn_cache);
if (!state->op) {
DEBUG(2, ("sdap_id_op_create failed\n"));
ret = ENOMEM;
@@ -671,6 +677,7 @@ int groups_get_recv(struct tevent_req *req, int *dp_error_out)
struct groups_by_user_state {
struct tevent_context *ev;
struct sdap_id_ctx *ctx;
+ struct sdap_id_conn_ctx *conn;
struct sdap_id_op *op;
const char *name;
const char **attrs;
@@ -685,6 +692,7 @@ static void groups_by_user_done(struct tevent_req *subreq);
static struct tevent_req *groups_by_user_send(TALLOC_CTX *memctx,
struct tevent_context *ev,
struct sdap_id_ctx *ctx,
+ struct sdap_id_conn_ctx *conn,
const char *name)
{
struct tevent_req *req;
@@ -697,8 +705,9 @@ static struct tevent_req *groups_by_user_send(TALLOC_CTX *memctx,
state->ev = ev;
state->ctx = ctx;
state->dp_error = DP_ERR_FATAL;
+ state->conn = conn;
- state->op = sdap_id_op_create(state, state->ctx->conn->conn_cache);
+ state->op = sdap_id_op_create(state, state->conn->conn_cache);
if (!state->op) {
DEBUG(2, ("sdap_id_op_create failed\n"));
ret = ENOMEM;
@@ -762,6 +771,7 @@ static void groups_by_user_connect_done(struct tevent_req *subreq)
state->ev,
sdap_id_op_handle(state->op),
state->ctx,
+ state->conn,
state->name,
state->attrs);
if (!subreq) {
@@ -971,11 +981,13 @@ static void sdap_check_online_reinit_done(struct tevent_req *req)
/* FIXME: embed this function in sssd_be and only call out
* specific functions from modules ? */
-void sdap_handle_account_info(struct be_req *breq, struct sdap_id_ctx *ctx);
+void sdap_handle_account_info(struct be_req *breq, struct sdap_id_ctx *ctx,
+ struct sdap_id_conn_ctx *conn);
static struct tevent_req *get_user_and_group_send(TALLOC_CTX *memctx,
struct tevent_context *ev,
struct sdap_id_ctx *ctx,
+ struct sdap_id_conn_ctx *conn,
const char *name,
int filter_type,
int attrs_type);
@@ -993,7 +1005,7 @@ void sdap_account_info_handler(struct be_req *breq)
return sdap_handler_done(breq, DP_ERR_FATAL,
EINVAL, "Invalid request data\n");
}
- return sdap_handle_account_info(breq, ctx);
+ return sdap_handle_account_info(breq, ctx, ctx->conn);
}
/* A generic LDAP account info handler */
@@ -1010,7 +1022,8 @@ struct tevent_req *
sdap_handle_acct_req_send(TALLOC_CTX *mem_ctx,
struct be_req *breq,
struct be_acct_req *ar,
- struct sdap_id_ctx *id_ctx)
+ struct sdap_id_ctx *id_ctx,
+ struct sdap_id_conn_ctx *conn)
{
struct tevent_req *req;
struct tevent_req *subreq;
@@ -1046,7 +1059,7 @@ sdap_handle_acct_req_send(TALLOC_CTX *mem_ctx,
goto done;
}
- subreq = users_get_send(breq, be_ctx->ev, id_ctx,
+ subreq = users_get_send(breq, be_ctx->ev, id_ctx, conn,
ar->filter_value,
ar->filter_type,
ar->attr_type);
@@ -1063,7 +1076,7 @@ sdap_handle_acct_req_send(TALLOC_CTX *mem_ctx,
goto done;
}
- subreq = groups_get_send(breq, be_ctx->ev, id_ctx,
+ subreq = groups_get_send(breq, be_ctx->ev, id_ctx, conn,
ar->filter_value,
ar->filter_type,
ar->attr_type);
@@ -1081,7 +1094,7 @@ sdap_handle_acct_req_send(TALLOC_CTX *mem_ctx,
goto done;
}
- subreq = groups_by_user_send(breq, be_ctx->ev, id_ctx,
+ subreq = groups_by_user_send(breq, be_ctx->ev, id_ctx, conn,
ar->filter_value);
break;
@@ -1092,7 +1105,7 @@ sdap_handle_acct_req_send(TALLOC_CTX *mem_ctx,
goto done;
}
- subreq = ldap_netgroup_get_send(breq, be_ctx->ev, id_ctx,
+ subreq = ldap_netgroup_get_send(breq, be_ctx->ev, id_ctx, conn,
ar->filter_value);
break;
@@ -1112,7 +1125,7 @@ sdap_handle_acct_req_send(TALLOC_CTX *mem_ctx,
goto done;
}
- subreq = services_get_send(breq, be_ctx->ev, id_ctx,
+ subreq = services_get_send(breq, be_ctx->ev, id_ctx, conn,
ar->filter_value,
ar->extra_value,
ar->filter_type);
@@ -1125,7 +1138,7 @@ sdap_handle_acct_req_send(TALLOC_CTX *mem_ctx,
goto done;
}
- subreq = get_user_and_group_send(breq, be_ctx->ev, id_ctx,
+ subreq = get_user_and_group_send(breq, be_ctx->ev, id_ctx, conn,
ar->filter_value,
ar->filter_type,
ar->attr_type);
@@ -1139,7 +1152,7 @@ sdap_handle_acct_req_send(TALLOC_CTX *mem_ctx,
goto done;
}
- subreq = get_user_and_group_send(breq, be_ctx->ev, id_ctx,
+ subreq = get_user_and_group_send(breq, be_ctx->ev, id_ctx, conn,
ar->filter_value,
ar->filter_type,
ar->attr_type);
@@ -1245,7 +1258,8 @@ sdap_handle_acct_req_recv(struct tevent_req *req,
static void sdap_account_info_complete(struct tevent_req *req);
-void sdap_handle_account_info(struct be_req *breq, struct sdap_id_ctx *ctx)
+void sdap_handle_account_info(struct be_req *breq, struct sdap_id_ctx *ctx,
+ struct sdap_id_conn_ctx *conn)
{
struct be_acct_req *ar;
struct tevent_req *req;
@@ -1260,7 +1274,7 @@ void sdap_handle_account_info(struct be_req *breq, struct sdap_id_ctx *ctx)
EINVAL, "Invalid private data");
}
- req = sdap_handle_acct_req_send(breq, breq, ar, ctx);
+ req = sdap_handle_acct_req_send(breq, breq, ar, ctx, conn);
if (req == NULL) {
return sdap_handler_done(breq, DP_ERR_FATAL, ENOMEM, "Out of memory");
}
@@ -1299,6 +1313,7 @@ static void sdap_account_info_complete(struct tevent_req *req)
struct get_user_and_group_state {
struct tevent_context *ev;
struct sdap_id_ctx *id_ctx;
+ struct sdap_id_conn_ctx *conn;
struct sdap_id_op *op;
struct sysdb_ctx *sysdb;
struct sss_domain_info *domain;
@@ -1319,6 +1334,7 @@ static void get_user_and_group_groups_done(struct tevent_req *subreq);
static struct tevent_req *get_user_and_group_send(TALLOC_CTX *memctx,
struct tevent_context *ev,
struct sdap_id_ctx *id_ctx,
+ struct sdap_id_conn_ctx *conn,
const char *filter_val,
int filter_type,
int attrs_type)
@@ -1336,9 +1352,10 @@ static struct tevent_req *get_user_and_group_send(TALLOC_CTX *memctx,
state->ev = ev;
state->id_ctx = id_ctx;
+ state->conn = conn;
state->dp_error = DP_ERR_FATAL;
- state->op = sdap_id_op_create(state, state->id_ctx->conn->conn_cache);
+ state->op = sdap_id_op_create(state, state->conn->conn_cache);
if (!state->op) {
DEBUG(SSSDBG_OP_FAILURE, ("sdap_id_op_create failed\n"));
ret = ENOMEM;
@@ -1351,8 +1368,9 @@ static struct tevent_req *get_user_and_group_send(TALLOC_CTX *memctx,
state->filter_type = filter_type;
state->attrs_type = attrs_type;
- subreq = users_get_send(req, state->ev, state->id_ctx, state->filter_val,
- state->filter_type, state->attrs_type);
+ subreq = users_get_send(req, state->ev, state->id_ctx, state->conn,
+ state->filter_val, state->filter_type,
+ state->attrs_type);
if (subreq == NULL) {
DEBUG(SSSDBG_OP_FAILURE, ("users_get_send failed.\n"));
ret = ENOMEM;
@@ -1385,8 +1403,9 @@ static void get_user_and_group_users_done(struct tevent_req *subreq)
return;
}
- subreq = groups_get_send(req, state->ev, state->id_ctx, state->filter_val,
- state->filter_type, state->attrs_type);
+ subreq = groups_get_send(req, state->ev, state->id_ctx, state->conn,
+ state->filter_val, state->filter_type,
+ state->attrs_type);
if (subreq == NULL) {
DEBUG(SSSDBG_OP_FAILURE, ("groups_get_send failed.\n"));
tevent_req_error(req, ENOMEM);
diff --git a/src/providers/ldap/ldap_id_netgroup.c b/src/providers/ldap/ldap_id_netgroup.c
index 6788a52e..5f44c0a9 100644
--- a/src/providers/ldap/ldap_id_netgroup.c
+++ b/src/providers/ldap/ldap_id_netgroup.c
@@ -34,6 +34,7 @@ struct ldap_netgroup_get_state {
struct tevent_context *ev;
struct sdap_id_ctx *ctx;
struct sdap_id_op *op;
+ struct sdap_id_conn_ctx *conn;
struct sysdb_ctx *sysdb;
struct sss_domain_info *domain;
@@ -54,9 +55,10 @@ static void ldap_netgroup_get_connect_done(struct tevent_req *subreq);
static void ldap_netgroup_get_done(struct tevent_req *subreq);
struct tevent_req *ldap_netgroup_get_send(TALLOC_CTX *memctx,
- struct tevent_context *ev,
- struct sdap_id_ctx *ctx,
- const char *name)
+ struct tevent_context *ev,
+ struct sdap_id_ctx *ctx,
+ struct sdap_id_conn_ctx *conn,
+ const char *name)
{
struct tevent_req *req;
struct ldap_netgroup_get_state *state;
@@ -68,9 +70,10 @@ struct tevent_req *ldap_netgroup_get_send(TALLOC_CTX *memctx,
state->ev = ev;
state->ctx = ctx;
+ state->conn = conn;
state->dp_error = DP_ERR_FATAL;
- state->op = sdap_id_op_create(state, state->ctx->conn->conn_cache);
+ state->op = sdap_id_op_create(state, state->conn->conn_cache);
if (!state->op) {
DEBUG(2, ("sdap_id_op_create failed\n"));
ret = ENOMEM;
diff --git a/src/providers/ldap/ldap_id_services.c b/src/providers/ldap/ldap_id_services.c
index 5c3c53f2..2a3f104c 100644
--- a/src/providers/ldap/ldap_id_services.c
+++ b/src/providers/ldap/ldap_id_services.c
@@ -36,6 +36,7 @@ struct sdap_services_get_state {
struct sdap_id_op *op;
struct sysdb_ctx *sysdb;
struct sss_domain_info *domain;
+ struct sdap_id_conn_ctx *conn;
const char *name;
const char *protocol;
@@ -59,6 +60,7 @@ struct tevent_req *
services_get_send(TALLOC_CTX *mem_ctx,
struct tevent_context *ev,
struct sdap_id_ctx *id_ctx,
+ struct sdap_id_conn_ctx *conn,
const char *name,
const char *protocol,
int filter_type)
@@ -75,6 +77,7 @@ services_get_send(TALLOC_CTX *mem_ctx,
state->ev = ev;
state->id_ctx = id_ctx;
+ state->conn = conn;
state->dp_error = DP_ERR_FATAL;
state->sysdb = id_ctx->be->domain->sysdb;
state->domain = state->id_ctx->be->domain;
@@ -82,7 +85,7 @@ services_get_send(TALLOC_CTX *mem_ctx,
state->protocol = protocol;
state->filter_type = filter_type;
- state->op = sdap_id_op_create(state, state->id_ctx->conn->conn_cache);
+ state->op = sdap_id_op_create(state, state->conn->conn_cache);
if (!state->op) {
DEBUG(SSSDBG_MINOR_FAILURE, ("sdap_id_op_create failed\n"));
ret = ENOMEM;
diff --git a/src/providers/ldap/sdap_async.h b/src/providers/ldap/sdap_async.h
index eedf8a70..38c8302d 100644
--- a/src/providers/ldap/sdap_async.h
+++ b/src/providers/ldap/sdap_async.h
@@ -117,6 +117,7 @@ struct tevent_req *sdap_get_initgr_send(TALLOC_CTX *memctx,
struct tevent_context *ev,
struct sdap_handle *sh,
struct sdap_id_ctx *id_ctx,
+ struct sdap_id_conn_ctx *conn,
const char *name,
const char **grp_attrs);
int sdap_get_initgr_recv(struct tevent_req *req);
diff --git a/src/providers/ldap/sdap_async_initgroups.c b/src/providers/ldap/sdap_async_initgroups.c
index 5a6ba028..57193f71 100644
--- a/src/providers/ldap/sdap_async_initgroups.c
+++ b/src/providers/ldap/sdap_async_initgroups.c
@@ -2510,6 +2510,7 @@ struct sdap_get_initgr_state {
struct sss_domain_info *dom;
struct sdap_handle *sh;
struct sdap_id_ctx *id_ctx;
+ struct sdap_id_conn_ctx *conn;
const char *name;
const char **grp_attrs;
const char **user_attrs;
@@ -2531,6 +2532,7 @@ struct tevent_req *sdap_get_initgr_send(TALLOC_CTX *memctx,
struct tevent_context *ev,
struct sdap_handle *sh,
struct sdap_id_ctx *id_ctx,
+ struct sdap_id_conn_ctx *conn,
const char *name,
const char **grp_attrs)
{
@@ -2550,6 +2552,7 @@ struct tevent_req *sdap_get_initgr_send(TALLOC_CTX *memctx,
state->dom = id_ctx->be->domain;
state->sh = sh;
state->id_ctx = id_ctx;
+ state->conn = conn;
state->name = name;
state->grp_attrs = grp_attrs;
state->orig_user = NULL;
@@ -2947,7 +2950,7 @@ static void sdap_get_initgr_done(struct tevent_req *subreq)
goto fail;
}
- subreq = groups_get_send(req, state->ev, state->id_ctx, gid,
+ subreq = groups_get_send(req, state->ev, state->id_ctx, state->conn, gid,
BE_FILTER_IDNUM, BE_ATTR_ALL);
if (!subreq) {
ret = ENOMEM;