diff options
author | Jakub Hrozek <jhrozek@redhat.com> | 2013-04-02 16:24:54 +0200 |
---|---|---|
committer | Jakub Hrozek <jhrozek@redhat.com> | 2013-04-03 14:42:00 +0200 |
commit | 44fc7e53b403d45576ab61d2dea4608e323ed332 (patch) | |
tree | a5af545b70786be1af7bbd0c3299c41aaed48279 /src/providers | |
parent | 584eda085e83a428f2c39dadf0d7adeaff5c87f4 (diff) | |
download | sssd-44fc7e53b403d45576ab61d2dea4608e323ed332.tar.gz sssd-44fc7e53b403d45576ab61d2dea4608e323ed332.tar.bz2 sssd-44fc7e53b403d45576ab61d2dea4608e323ed332.zip |
Centralize resolv_init, remove resolv context list
Diffstat (limited to 'src/providers')
-rw-r--r-- | src/providers/data_provider_be.c | 2 | ||||
-rw-r--r-- | src/providers/ipa/ipa_dyndns.c | 9 | ||||
-rw-r--r-- | src/providers/ldap/sdap_async_sudo_hostinfo.c | 18 |
3 files changed, 4 insertions, 25 deletions
diff --git a/src/providers/data_provider_be.c b/src/providers/data_provider_be.c index df077b24..823dc00e 100644 --- a/src/providers/data_provider_be.c +++ b/src/providers/data_provider_be.c @@ -2775,7 +2775,7 @@ static int data_provider_res_init(DBusMessage *message, struct be_ctx *be_ctx; be_ctx = talloc_get_type(sbus_conn_get_private_data(conn), struct be_ctx); - resolv_reread_configuration(); + resolv_reread_configuration(be_ctx->be_res->resolv); check_if_online(be_ctx); return monitor_common_res_init(message, conn); diff --git a/src/providers/ipa/ipa_dyndns.c b/src/providers/ipa/ipa_dyndns.c index 632ed26a..a31067cd 100644 --- a/src/providers/ipa/ipa_dyndns.c +++ b/src/providers/ipa/ipa_dyndns.c @@ -143,14 +143,7 @@ errno_t ipa_dyndns_init(struct be_ctx *be_ctx, { errno_t ret; - ret = resolv_init(be_ctx, be_ctx->ev, - dp_opt_get_int(be_ctx->be_res->opts, - DP_RES_OPT_RESOLVER_OP_TIMEOUT), - &ctx->resolv); - if (ret != EOK) { - DEBUG(1, ("Could not set up resolver context\n")); - return ret; - } + ctx->resolv = be_ctx->be_res->resolv; ret = be_add_online_cb(be_ctx, be_ctx, ipa_dyndns_update, diff --git a/src/providers/ldap/sdap_async_sudo_hostinfo.c b/src/providers/ldap/sdap_async_sudo_hostinfo.c index ff614223..4e33babd 100644 --- a/src/providers/ldap/sdap_async_sudo_hostinfo.c +++ b/src/providers/ldap/sdap_async_sudo_hostinfo.c @@ -431,22 +431,8 @@ static struct tevent_req *sdap_sudo_get_hostnames_send(TALLOC_CTX *mem_ctx, DEBUG(SSSDBG_TRACE_INTERNAL, ("Found hostname: %s\n", hostname)); } - /* initialize resolv ctx */ - ret = resolv_init(be_ctx, be_ctx->ev, - dp_opt_get_int(be_ctx->be_res->opts, - DP_RES_OPT_RESOLVER_OP_TIMEOUT), - &state->resolv_ctx); - if (ret != EOK) { - DEBUG(SSSDBG_CRIT_FAILURE, ("Could not set up resolver context\n")); - goto done; - } - - /* get database order */ - - state->host_db = talloc_zero_array(state, enum host_database, 3); - state->host_db[0] = DB_FILES; - state->host_db[1] = DB_DNS; - state->host_db[2] = DB_SENTINEL; + state->resolv_ctx = be_ctx->be_res->resolv; + state->host_db = default_host_dbs; /* get fqdn */ subreq = resolv_gethostbyname_send(state, state->ev, state->resolv_ctx, |