diff options
author | Sumit Bose <sbose@redhat.com> | 2011-01-12 11:31:24 +0100 |
---|---|---|
committer | Stephen Gallagher <sgallagh@redhat.com> | 2011-01-17 07:59:54 -0500 |
commit | a530a96721d8106a6839b6b643b0abc5d7a7b9e0 (patch) | |
tree | d53aaff43201c62d8d97db5509b4506e6f3a2746 /src | |
parent | cbe7c54c2caf718bdea7ca6660ba8193d759d2d5 (diff) | |
download | sssd-a530a96721d8106a6839b6b643b0abc5d7a7b9e0.tar.gz sssd-a530a96721d8106a6839b6b643b0abc5d7a7b9e0.tar.bz2 sssd-a530a96721d8106a6839b6b643b0abc5d7a7b9e0.zip |
Add timeout parameter to sdap_get_generic_send()
Diffstat (limited to 'src')
-rw-r--r-- | src/providers/ipa/ipa_access.c | 53 | ||||
-rw-r--r-- | src/providers/ipa/ipa_auth.c | 4 | ||||
-rw-r--r-- | src/providers/ldap/ldap_id.c | 8 | ||||
-rw-r--r-- | src/providers/ldap/ldap_id_enum.c | 8 | ||||
-rw-r--r-- | src/providers/ldap/ldap_id_netgroup.c | 5 | ||||
-rw-r--r-- | src/providers/ldap/sdap_access.c | 4 | ||||
-rw-r--r-- | src/providers/ldap/sdap_async.c | 11 | ||||
-rw-r--r-- | src/providers/ldap/sdap_async.h | 12 | ||||
-rw-r--r-- | src/providers/ldap/sdap_async_accounts.c | 52 | ||||
-rw-r--r-- | src/providers/ldap/sdap_async_netgroups.c | 9 |
10 files changed, 111 insertions, 55 deletions
diff --git a/src/providers/ipa/ipa_access.c b/src/providers/ipa/ipa_access.c index c66bb9c8..61caef10 100644 --- a/src/providers/ipa/ipa_access.c +++ b/src/providers/ipa/ipa_access.c @@ -535,14 +535,17 @@ struct tevent_req *hbac_get_service_data_send(TALLOC_CTX *memctx, goto fail; } subreq = sdap_get_generic_send(state, - hbac_ctx_ev(state->hbac_ctx), - hbac_ctx_sdap_id_ctx(state->hbac_ctx)->opts, - sdap_handle, - state->services_search_base, - LDAP_SCOPE_SUB, - state->services_filter, - state->services_attrs, - NULL, 0); + hbac_ctx_ev(state->hbac_ctx), + hbac_ctx_sdap_id_ctx(state->hbac_ctx)->opts, + sdap_handle, + state->services_search_base, + LDAP_SCOPE_SUB, + state->services_filter, + state->services_attrs, + NULL, 0, + dp_opt_get_int( + hbac_ctx_sdap_id_ctx(state->hbac_ctx)->opts->basic, + SDAP_SEARCH_TIMEOUT)); if (subreq == NULL) { DEBUG(1, ("sdap_get_generic_send failed.\n")); @@ -830,13 +833,16 @@ static struct tevent_req *hbac_get_host_info_send(TALLOC_CTX *memctx, goto fail; } subreq = sdap_get_generic_send(state, hbac_ctx_ev(state->hbac_ctx), - hbac_ctx_sdap_id_ctx(state->hbac_ctx)->opts, - sdap_handle, - state->host_search_base, - LDAP_SCOPE_SUB, - state->host_filter, - state->host_attrs, - NULL, 0); + hbac_ctx_sdap_id_ctx(state->hbac_ctx)->opts, + sdap_handle, + state->host_search_base, + LDAP_SCOPE_SUB, + state->host_filter, + state->host_attrs, + NULL, 0, + dp_opt_get_int( + hbac_ctx_sdap_id_ctx(state->hbac_ctx)->opts->basic, + SDAP_SEARCH_TIMEOUT)); if (subreq == NULL) { DEBUG(1, ("sdap_get_generic_send failed.\n")); @@ -1148,13 +1154,16 @@ static struct tevent_req *hbac_get_rules_send(TALLOC_CTX *memctx, goto fail; } subreq = sdap_get_generic_send(state, hbac_ctx_ev(state->hbac_ctx), - hbac_ctx_sdap_id_ctx(state->hbac_ctx)->opts, - sdap_handle, - state->hbac_search_base, - LDAP_SCOPE_SUB, - state->hbac_filter, - state->hbac_attrs, - NULL, 0); + hbac_ctx_sdap_id_ctx(state->hbac_ctx)->opts, + sdap_handle, + state->hbac_search_base, + LDAP_SCOPE_SUB, + state->hbac_filter, + state->hbac_attrs, + NULL, 0, + dp_opt_get_int( + hbac_ctx_sdap_id_ctx(state->hbac_ctx)->opts->basic, + SDAP_SEARCH_TIMEOUT)); if (subreq == NULL) { DEBUG(1, ("sdap_get_generic_send failed.\n")); diff --git a/src/providers/ipa/ipa_auth.c b/src/providers/ipa/ipa_auth.c index 020b63f3..eb7f2917 100644 --- a/src/providers/ipa/ipa_auth.c +++ b/src/providers/ipa/ipa_auth.c @@ -153,7 +153,9 @@ static void get_password_migration_flag_auth_done(struct tevent_req *subreq) subreq = sdap_get_generic_send(state, state->ev, state->sdap_auth_ctx->opts, state->sh, search_base, LDAP_SCOPE_SUBTREE, - IPA_CONFIG_FILTER, attrs, NULL, 0); + IPA_CONFIG_FILTER, attrs, NULL, 0, + dp_opt_get_int(state->sdap_auth_ctx->opts->basic, + SDAP_SEARCH_TIMEOUT)); if (!subreq) { tevent_req_error(req, ENOMEM); return; diff --git a/src/providers/ldap/ldap_id.c b/src/providers/ldap/ldap_id.c index ce94731c..ed27620c 100644 --- a/src/providers/ldap/ldap_id.c +++ b/src/providers/ldap/ldap_id.c @@ -169,7 +169,9 @@ static void users_get_connect_done(struct tevent_req *subreq) state->domain, state->sysdb, state->ctx->opts, sdap_id_op_handle(state->op), - state->attrs, state->filter); + state->attrs, state->filter, + dp_opt_get_int(state->ctx->opts->basic, + SDAP_SEARCH_TIMEOUT)); if (!subreq) { tevent_req_error(req, ENOMEM); return; @@ -398,7 +400,9 @@ static void groups_get_connect_done(struct tevent_req *subreq) subreq = sdap_get_groups_send(state, state->ev, state->domain, state->sysdb, state->ctx->opts, sdap_id_op_handle(state->op), - state->attrs, state->filter); + state->attrs, state->filter, + dp_opt_get_int(state->ctx->opts->basic, + SDAP_SEARCH_TIMEOUT)); if (!subreq) { tevent_req_error(req, ENOMEM); return; diff --git a/src/providers/ldap/ldap_id_enum.c b/src/providers/ldap/ldap_id_enum.c index 8695f355..3335f70d 100644 --- a/src/providers/ldap/ldap_id_enum.c +++ b/src/providers/ldap/ldap_id_enum.c @@ -471,7 +471,9 @@ static struct tevent_req *enum_users_send(TALLOC_CTX *memctx, state->ctx->be->sysdb, state->ctx->opts, sdap_id_op_handle(state->op), - state->attrs, state->filter); + state->attrs, state->filter, + dp_opt_get_int(state->ctx->opts->basic, + SDAP_SEARCH_TIMEOUT)); if (!subreq) { ret = ENOMEM; goto fail; @@ -573,7 +575,9 @@ static struct tevent_req *enum_groups_send(TALLOC_CTX *memctx, state->ctx->be->domain, state->ctx->be->sysdb, state->ctx->opts, sdap_id_op_handle(state->op), - state->attrs, state->filter); + state->attrs, state->filter, + dp_opt_get_int(state->ctx->opts->basic, + SDAP_SEARCH_TIMEOUT)); if (!subreq) { ret = ENOMEM; goto fail; diff --git a/src/providers/ldap/ldap_id_netgroup.c b/src/providers/ldap/ldap_id_netgroup.c index 11d0a39f..7b9ad0f1 100644 --- a/src/providers/ldap/ldap_id_netgroup.c +++ b/src/providers/ldap/ldap_id_netgroup.c @@ -38,6 +38,7 @@ struct netgroup_get_state { struct sss_domain_info *domain; const char *name; + int timeout; char *filter; const char **attrs; @@ -79,6 +80,7 @@ struct tevent_req *netgroup_get_send(TALLOC_CTX *memctx, state->sysdb = ctx->be->sysdb; state->domain = state->ctx->be->domain; state->name = name; + state->timeout = dp_opt_get_int(ctx->opts->basic, SDAP_SEARCH_TIMEOUT); ret = sss_filter_sanitize(state, name, &clean_name); if (ret != EOK) { @@ -151,7 +153,8 @@ static void netgroup_get_connect_done(struct tevent_req *subreq) state->domain, state->sysdb, state->ctx->opts, sdap_id_op_handle(state->op), - state->attrs, state->filter); + state->attrs, state->filter, + state->timeout); if (!subreq) { tevent_req_error(req, ENOMEM); return; diff --git a/src/providers/ldap/sdap_access.c b/src/providers/ldap/sdap_access.c index ce2d5357..df433b69 100644 --- a/src/providers/ldap/sdap_access.c +++ b/src/providers/ldap/sdap_access.c @@ -625,7 +625,9 @@ static void sdap_access_filter_connect_done(struct tevent_req *subreq) state->basedn, LDAP_SCOPE_BASE, state->filter, NULL, - NULL, 0); + NULL, 0, + dp_opt_get_int(state->sdap_ctx->opts->basic, + SDAP_SEARCH_TIMEOUT)); if (subreq == NULL) { DEBUG(1, ("Could not start LDAP communication\n")); state->pam_status = PAM_SYSTEM_ERR; diff --git a/src/providers/ldap/sdap_async.c b/src/providers/ldap/sdap_async.c index 6929b293..134f3972 100644 --- a/src/providers/ldap/sdap_async.c +++ b/src/providers/ldap/sdap_async.c @@ -671,7 +671,9 @@ struct tevent_req *sdap_get_rootdse_send(TALLOC_CTX *memctx, subreq = sdap_get_generic_send(state, ev, opts, sh, "", LDAP_SCOPE_BASE, - "(objectclass=*)", attrs, NULL, 0); + "(objectclass=*)", attrs, NULL, 0, + dp_opt_get_int(state->opts->basic, + SDAP_SEARCH_TIMEOUT)); if (!subreq) { talloc_zfree(req); return NULL; @@ -770,7 +772,8 @@ struct tevent_req *sdap_get_generic_send(TALLOC_CTX *memctx, const char *filter, const char **attrs, struct sdap_attr_map *map, - int map_num_attrs) + int map_num_attrs, + int timeout) { struct tevent_req *req = NULL; struct sdap_get_generic_state *state = NULL; @@ -839,9 +842,7 @@ struct tevent_req *sdap_get_generic_send(TALLOC_CTX *memctx, DEBUG(8, ("ldap_search_ext called, msgid = %d\n", msgid)); ret = sdap_op_add(state, state->ev, state->sh, msgid, - sdap_get_generic_done, req, - dp_opt_get_int(state->opts->basic, - SDAP_SEARCH_TIMEOUT), + sdap_get_generic_done, req, timeout, &state->op); if (ret != EOK) { DEBUG(1, ("Failed to set up operation!\n")); diff --git a/src/providers/ldap/sdap_async.h b/src/providers/ldap/sdap_async.h index 10d0c307..5e377143 100644 --- a/src/providers/ldap/sdap_async.h +++ b/src/providers/ldap/sdap_async.h @@ -44,7 +44,8 @@ struct tevent_req *sdap_get_users_send(TALLOC_CTX *memctx, struct sdap_options *opts, struct sdap_handle *sh, const char **attrs, - const char *wildcard); + const char *wildcard, + int timeout); int sdap_get_users_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx, char **timestamp); @@ -55,7 +56,8 @@ struct tevent_req *sdap_get_groups_send(TALLOC_CTX *memctx, struct sdap_options *opts, struct sdap_handle *sh, const char **attrs, - const char *wildcard); + const char *wildcard, + int timeout); int sdap_get_groups_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx, char **timestamp); @@ -66,7 +68,8 @@ struct tevent_req *sdap_get_netgroups_send(TALLOC_CTX *memctx, struct sdap_options *opts, struct sdap_handle *sh, const char **attrs, - const char *wildcard); + const char *wildcard, + int timeout); int sdap_get_netgroups_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx, char **timestamp, size_t *reply_count, @@ -142,7 +145,8 @@ struct tevent_req *sdap_get_generic_send(TALLOC_CTX *memctx, const char *filter, const char **attrs, struct sdap_attr_map *map, - int map_num_attrs); + int map_num_attrs, + int timeout); int sdap_get_generic_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx, size_t *reply_count, struct sysdb_attrs ***reply_list); diff --git a/src/providers/ldap/sdap_async_accounts.c b/src/providers/ldap/sdap_async_accounts.c index 21c3237e..95ee59e8 100644 --- a/src/providers/ldap/sdap_async_accounts.c +++ b/src/providers/ldap/sdap_async_accounts.c @@ -385,7 +385,8 @@ struct tevent_req *sdap_get_users_send(TALLOC_CTX *memctx, struct sdap_options *opts, struct sdap_handle *sh, const char **attrs, - const char *filter) + const char *filter, + int timeout) { struct tevent_req *req, *subreq; struct sdap_get_users_state *state; @@ -409,7 +410,8 @@ struct tevent_req *sdap_get_users_send(TALLOC_CTX *memctx, SDAP_USER_SEARCH_BASE), LDAP_SCOPE_SUBTREE, state->filter, state->attrs, - state->opts->user_map, SDAP_OPTS_USER); + state->opts->user_map, SDAP_OPTS_USER, + timeout); if (!subreq) { talloc_zfree(req); return NULL; @@ -1283,7 +1285,9 @@ sdap_process_missing_member_2307bis(struct tevent_req *req, grp_state->filter, grp_state->attrs, grp_state->opts->user_map, - SDAP_OPTS_USER); + SDAP_OPTS_USER, + dp_opt_get_int(grp_state->opts->basic, + SDAP_SEARCH_TIMEOUT)); if (!subreq) { return ENOMEM; } @@ -1430,7 +1434,9 @@ next: state->filter, state->attrs, state->opts->user_map, - SDAP_OPTS_USER); + SDAP_OPTS_USER, + dp_opt_get_int(state->opts->basic, + SDAP_SEARCH_TIMEOUT)); if (!subreq) { tevent_req_error(req, ENOMEM); return; @@ -1501,7 +1507,8 @@ struct tevent_req *sdap_get_groups_send(TALLOC_CTX *memctx, struct sdap_options *opts, struct sdap_handle *sh, const char **attrs, - const char *filter) + const char *filter, + int timeout) { struct tevent_req *req, *subreq; struct sdap_get_groups_state *state; @@ -1525,7 +1532,8 @@ struct tevent_req *sdap_get_groups_send(TALLOC_CTX *memctx, SDAP_GROUP_SEARCH_BASE), LDAP_SCOPE_SUBTREE, state->filter, state->attrs, - state->opts->group_map, SDAP_OPTS_GROUP); + state->opts->group_map, SDAP_OPTS_GROUP, + timeout); if (!subreq) { talloc_zfree(req); return NULL; @@ -1973,7 +1981,9 @@ struct tevent_req *sdap_initgr_rfc2307_send(TALLOC_CTX *memctx, subreq = sdap_get_generic_send(state, state->ev, state->opts, state->sh, base_dn, LDAP_SCOPE_SUBTREE, filter, attrs, - state->opts->group_map, SDAP_OPTS_GROUP); + state->opts->group_map, SDAP_OPTS_GROUP, + dp_opt_get_int(state->opts->basic, + SDAP_SEARCH_TIMEOUT)); if (!subreq) { talloc_zfree(req); return NULL; @@ -2210,7 +2220,9 @@ static struct tevent_req *sdap_initgr_nested_send(TALLOC_CTX *memctx, state->group_dns[state->cur], LDAP_SCOPE_BASE, state->filter, state->grp_attrs, - state->opts->group_map, SDAP_OPTS_GROUP); + state->opts->group_map, SDAP_OPTS_GROUP, + dp_opt_get_int(state->opts->basic, + SDAP_SEARCH_TIMEOUT)); if (!subreq) { talloc_zfree(req); return NULL; @@ -2254,7 +2266,9 @@ static void sdap_initgr_nested_search(struct tevent_req *subreq) LDAP_SCOPE_BASE, state->filter, state->grp_attrs, state->opts->group_map, - SDAP_OPTS_GROUP); + SDAP_OPTS_GROUP, + dp_opt_get_int(state->opts->basic, + SDAP_SEARCH_TIMEOUT)); if (!subreq) { tevent_req_error(req, ENOMEM); return; @@ -2364,7 +2378,9 @@ struct tevent_req *sdap_get_initgr_send(TALLOC_CTX *memctx, state->opts, state->sh, base_dn, LDAP_SCOPE_SUBTREE, filter, attrs, - state->opts->user_map, SDAP_OPTS_USER); + state->opts->user_map, SDAP_OPTS_USER, + dp_opt_get_int(state->opts->basic, + SDAP_SEARCH_TIMEOUT)); if (!subreq) { talloc_zfree(req); return NULL; @@ -2873,7 +2889,9 @@ static errno_t sdap_nested_group_lookup_user(struct tevent_req *req, LDAP_SCOPE_BASE, filter, sdap_attrs, state->opts->user_map, - SDAP_OPTS_USER); + SDAP_OPTS_USER, + dp_opt_get_int(state->opts->basic, + SDAP_SEARCH_TIMEOUT)); if (!subreq) { talloc_free(sdap_attrs); return EIO; @@ -2913,7 +2931,9 @@ static errno_t sdap_nested_group_lookup_group(struct tevent_req *req) LDAP_SCOPE_BASE, filter, sdap_attrs, state->opts->group_map, - SDAP_OPTS_GROUP); + SDAP_OPTS_GROUP, + dp_opt_get_int(state->opts->basic, + SDAP_SEARCH_TIMEOUT)); if (!subreq) { talloc_free(sdap_attrs); return EIO; @@ -3245,7 +3265,9 @@ static struct tevent_req *sdap_initgr_rfc2307bis_send( subreq = sdap_get_generic_send(state, state->ev, state->opts, state->sh, base_dn, LDAP_SCOPE_SUBTREE, filter, attrs, - state->opts->group_map, SDAP_OPTS_GROUP); + state->opts->group_map, SDAP_OPTS_GROUP, + dp_opt_get_int(state->opts->basic, + SDAP_SEARCH_TIMEOUT)); if (!subreq) { talloc_zfree(req); return NULL; @@ -3643,7 +3665,9 @@ static errno_t rfc2307bis_nested_groups_step(struct tevent_req *req) SDAP_GROUP_SEARCH_BASE), LDAP_SCOPE_SUBTREE, filter, attrs, - state->opts->group_map, SDAP_OPTS_GROUP); + state->opts->group_map, SDAP_OPTS_GROUP, + dp_opt_get_int(state->opts->basic, + SDAP_SEARCH_TIMEOUT)); if (!subreq) { ret = EIO; goto error; diff --git a/src/providers/ldap/sdap_async_netgroups.c b/src/providers/ldap/sdap_async_netgroups.c index 01845486..1f6c6d06 100644 --- a/src/providers/ldap/sdap_async_netgroups.c +++ b/src/providers/ldap/sdap_async_netgroups.c @@ -467,7 +467,9 @@ static errno_t netgr_translate_members_ldap_step(struct tevent_req *req) subreq = sdap_get_generic_send(state, state->ev, state->opts, state->sh, state->dn_item->dn, LDAP_SCOPE_BASE, NULL, cn_attr, state->opts->netgroup_map, - SDAP_OPTS_NETGROUP); + SDAP_OPTS_NETGROUP, + dp_opt_get_int(state->opts->basic, + SDAP_SEARCH_TIMEOUT)); if (!subreq) { DEBUG(1, ("sdap_get_generic_send failed.\n")); return ENOMEM; @@ -582,7 +584,8 @@ struct tevent_req *sdap_get_netgroups_send(TALLOC_CTX *memctx, struct sdap_options *opts, struct sdap_handle *sh, const char **attrs, - const char *filter) + const char *filter, + int timeout) { struct tevent_req *req, *subreq; struct sdap_get_netgroups_state *state; @@ -607,7 +610,7 @@ struct tevent_req *sdap_get_netgroups_send(TALLOC_CTX *memctx, LDAP_SCOPE_SUBTREE, state->filter, state->attrs, state->opts->netgroup_map, - SDAP_OPTS_NETGROUP); + SDAP_OPTS_NETGROUP, timeout); if (!subreq) { talloc_zfree(req); return NULL; |