summaryrefslogtreecommitdiff
path: root/server/providers
diff options
context:
space:
mode:
authorSimo Sorce <ssorce@redhat.com>2009-10-01 07:10:11 -0400
committerStephen Gallagher <sgallagh@redhat.com>2009-10-01 08:53:14 -0400
commit4e0314ecad0fb649bcc2d6384a84ae818ef7c972 (patch)
tree332b033ebe0f48485ba4a62e89c3e42355e376d7 /server/providers
parentf24c2dd7cc8414ea0a5c8c4ae7766ca71554480f (diff)
downloadsssd-4e0314ecad0fb649bcc2d6384a84ae818ef7c972.tar.gz
sssd-4e0314ecad0fb649bcc2d6384a84ae818ef7c972.tar.bz2
sssd-4e0314ecad0fb649bcc2d6384a84ae818ef7c972.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.
Diffstat (limited to 'server/providers')
-rw-r--r--server/providers/ldap/sdap.c4
-rw-r--r--server/providers/ldap/sdap_async.c15
2 files changed, 14 insertions, 5 deletions
diff --git a/server/providers/ldap/sdap.c b/server/providers/ldap/sdap.c
index cc435ce0..b2dc6f6f 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 471cff6d..c3ca53ed 100644
--- a/server/providers/ldap/sdap_async.c
+++ b/server/providers/ldap/sdap_async.c
@@ -1907,7 +1907,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);
@@ -2131,7 +2134,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);
@@ -2463,7 +2469,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);