diff options
author | Simo Sorce <ssorce@redhat.com> | 2009-10-01 07:10:11 -0400 |
---|---|---|
committer | Stephen Gallagher <sgallagh@redhat.com> | 2009-10-13 11:13:43 -0400 |
commit | a30cae04fe5c8ff9ddfdaa514f030370d9777e30 (patch) | |
tree | ce971a17a1993b90768d7a5189e2d9678e08ee37 | |
parent | fb7a7c1ea8f251efd741096edd027c232838de2b (diff) | |
download | sssd-a30cae04fe5c8ff9ddfdaa514f030370d9777e30.tar.gz sssd-a30cae04fe5c8ff9ddfdaa514f030370d9777e30.tar.xz sssd-a30cae04fe5c8ff9ddfdaa514f030370d9777e30.zip |
Fix long timeout on ldap operation
Always use the network timeout defined in the options.
But raise defaults to 60 seconds or enumerations can easily fail.
-rw-r--r-- | server/providers/ldap/sdap.c | 4 | ||||
-rw-r--r-- | server/providers/ldap/sdap_async.c | 15 |
2 files changed, 14 insertions, 5 deletions
diff --git a/server/providers/ldap/sdap.c b/server/providers/ldap/sdap.c index 07e48c18c..b5c568d46 100644 --- a/server/providers/ldap/sdap.c +++ b/server/providers/ldap/sdap.c @@ -36,8 +36,8 @@ struct sdap_gen_opts default_basic_opts[] = { { "ldap_default_bind_dn", SDAP_STRING, NULL_STRING, NULL_STRING }, { "ldap_default_authtok_type", SDAP_STRING, NULL_STRING, NULL_STRING}, { "ldap_default_authtok", SDAP_BLOB, NULL_BLOB, NULL_BLOB }, - { "ldap_network_timeout", SDAP_NUMBER, { .number = 5 }, NULL_NUMBER }, - { "ldap_opt_timeout", SDAP_NUMBER, { .number = 5 }, NULL_NUMBER }, + { "ldap_network_timeout", SDAP_NUMBER, { .number = 60 }, NULL_NUMBER }, + { "ldap_opt_timeout", SDAP_NUMBER, { .number = 60 }, NULL_NUMBER }, { "ldap_tls_reqcert", SDAP_STRING, { "hard" }, NULL_STRING }, { "ldap_user_search_base", SDAP_STRING, { "ou=People,dc=example,dc=com" }, NULL_STRING }, { "ldap_user_search_scope", SDAP_STRING, { "sub" }, NULL_STRING }, diff --git a/server/providers/ldap/sdap_async.c b/server/providers/ldap/sdap_async.c index 165117483..0146bf82f 100644 --- a/server/providers/ldap/sdap_async.c +++ b/server/providers/ldap/sdap_async.c @@ -1530,7 +1530,10 @@ static void sdap_get_users_transaction(struct tevent_req *subreq) /* FIXME: get timeouts from configuration, for now 10 minutes */ ret = sdap_op_add(state, state->ev, state->sh, msgid, - sdap_get_users_done, req, 600, &state->op); + sdap_get_users_done, req, + sdap_go_get_int(state->opts->basic, + SDAP_NETWORK_TIMEOUT), + &state->op); if (ret) { DEBUG(1, ("Failed to set up operation!\n")); tevent_req_error(req, ret); @@ -1754,7 +1757,10 @@ static void sdap_get_groups_transaction(struct tevent_req *subreq) /* FIXME: get timeouts from configuration, for now 10 minutes */ ret = sdap_op_add(state, state->ev, state->sh, msgid, - sdap_get_groups_done, req, 600, &state->op); + sdap_get_groups_done, req, + sdap_go_get_int(state->opts->basic, + SDAP_NETWORK_TIMEOUT), + &state->op); if (ret) { DEBUG(1, ("Failed to set up operation!\n")); tevent_req_error(req, ret); @@ -2086,7 +2092,10 @@ static void sdap_get_initgr_transaction(struct tevent_req *subreq) /* FIXME: get timeouts from configuration, for now 10 minutes */ ret = sdap_op_add(state, state->ev, state->sh, msgid, - sdap_get_initgr_done, req, 600, &state->op); + sdap_get_initgr_done, req, + sdap_go_get_int(state->opts->basic, + SDAP_NETWORK_TIMEOUT), + &state->op); if (ret) { DEBUG(1, ("Failed to set up operation!\n")); tevent_req_error(req, ret); |