summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJakub Hrozek <jhrozek@redhat.com>2014-04-15 17:32:38 +0200
committerJakub Hrozek <jhrozek@redhat.com>2014-04-22 17:29:40 +0200
commitef2455b63380ecd17bea94270ceaabe15dcf6456 (patch)
treee04d0c7901eb59cd469b056a704de3d355658d46
parentc5a554f46f8ca0fd09afdb1f53dd9e229a68b86f (diff)
downloadsssd-ef2455b63380ecd17bea94270ceaabe15dcf6456.tar.gz
sssd-ef2455b63380ecd17bea94270ceaabe15dcf6456.tar.xz
sssd-ef2455b63380ecd17bea94270ceaabe15dcf6456.zip
DP: Remove unused 'force' parameter from the subdomain handler
The force argument was unused and made the code more complex than required. Moreover, the force argument would have made the subdomain handler behave differently than other identity domains -- when the front end decides it's time to update the domains, the back end should just update them. Handling multiple concurrent requests from multiple responders (typically after startup) is handled at the generic back end level (see be_queue_request). Reviewed-by: Pavel Březina <pbrezina@redhat.com>
-rw-r--r--src/providers/data_provider_be.c8
-rw-r--r--src/responder/common/responder_get_domains.c18
2 files changed, 6 insertions, 20 deletions
diff --git a/src/providers/data_provider_be.c b/src/providers/data_provider_be.c
index 5c2b480db..ec2c0fa5d 100644
--- a/src/providers/data_provider_be.c
+++ b/src/providers/data_provider_be.c
@@ -564,7 +564,6 @@ static int be_get_subdomains(struct sbus_request *dbus_req, void *user_data)
struct be_subdom_req *req;
struct be_req *be_req = NULL;
struct be_client *becli;
- dbus_bool_t force;
char *domain_hint;
dbus_uint16_t err_maj;
dbus_uint32_t err_min;
@@ -575,7 +574,6 @@ static int be_get_subdomains(struct sbus_request *dbus_req, void *user_data)
if (!becli) return EINVAL;
if (!sbus_request_parse_or_finish(dbus_req,
- DBUS_TYPE_BOOLEAN, &force,
DBUS_TYPE_STRING, &domain_hint,
DBUS_TYPE_INVALID))
return EOK; /* handled */
@@ -589,9 +587,8 @@ static int be_get_subdomains(struct sbus_request *dbus_req, void *user_data)
goto immediate;
}
- DEBUG(SSSDBG_TRACE_FUNC,
- "Got get subdomains [%sforced][%s]\n", force ? "" : "not ",
- domain_hint == NULL ? "no hint": domain_hint );
+ DEBUG(SSSDBG_TRACE_FUNC, "Got get subdomains [%s]\n",
+ domain_hint == NULL ? "no hint": domain_hint );
/* If we are offline return immediately
*/
@@ -621,7 +618,6 @@ static int be_get_subdomains(struct sbus_request *dbus_req, void *user_data)
err_msg = "Out of memory";
goto immediate;
}
- req->force = force;
req->domain_hint = talloc_strdup(req, domain_hint);
if (!req->domain_hint) {
err_maj = DP_ERR_FATAL;
diff --git a/src/responder/common/responder_get_domains.c b/src/responder/common/responder_get_domains.c
index 23b274b52..e86767f7c 100644
--- a/src/responder/common/responder_get_domains.c
+++ b/src/responder/common/responder_get_domains.c
@@ -29,16 +29,11 @@ static DBusMessage *sss_dp_get_domains_msg(void *pvt);
struct sss_dp_domains_info {
struct sss_domain_info *dom;
const char *hint;
- /* The DBus API expects its own Boolean type when formatting argument
- * with DBUS_TYPE_BOOLEAN
- */
- dbus_bool_t force;
};
static struct tevent_req *
get_subdomains_send(TALLOC_CTX *mem_ctx, struct resp_ctx *rctx,
struct sss_domain_info *dom,
- const bool force,
const char *hint)
{
errno_t ret;
@@ -58,7 +53,6 @@ get_subdomains_send(TALLOC_CTX *mem_ctx, struct resp_ctx *rctx,
goto fail;
}
info->hint = hint;
- info->force = force ? TRUE : FALSE;
info->dom = dom;
key = talloc_asprintf(state, "domains@%s", dom->name);
@@ -102,15 +96,14 @@ sss_dp_get_domains_msg(void *pvt)
}
DEBUG(SSSDBG_TRACE_FUNC,
- "Sending get domains request for [%s][%sforced][%s]\n",
- info->dom->name, info->force ? "" : "not ", info->hint);
+ "Sending get domains request for [%s][%s]\n",
+ info->dom->name, info->hint);
/* Send the hint argument to provider as well. This will
* be useful for some cases of transitional trust where
* the server might not know all trusted domains
*/
dbret = dbus_message_append_args(msg,
- DBUS_TYPE_BOOLEAN, &info->force,
DBUS_TYPE_STRING, &info->hint,
DBUS_TYPE_INVALID);
if (!dbret) {
@@ -141,7 +134,6 @@ struct sss_dp_get_domains_state {
struct resp_ctx *rctx;
struct sss_domain_info *dom;
const char *hint;
- bool force;
};
static void
@@ -182,7 +174,6 @@ struct tevent_req *sss_dp_get_domains_send(TALLOC_CTX *mem_ctx,
}
state->rctx = rctx;
- state->force = force;
if (hint != NULL) {
state->hint = hint;
} else {
@@ -204,8 +195,7 @@ struct tevent_req *sss_dp_get_domains_send(TALLOC_CTX *mem_ctx,
goto immediately;
}
- subreq = get_subdomains_send(req, rctx, state->dom,
- state->force, state->hint);
+ subreq = get_subdomains_send(req, rctx, state->dom, state->hint);
if (subreq == NULL) {
ret = ENOMEM;
goto immediately;
@@ -266,7 +256,7 @@ sss_dp_get_domains_process(struct tevent_req *subreq)
return;
}
- subreq = get_subdomains_send(req, state->rctx, state->dom, state->force, state->hint);
+ subreq = get_subdomains_send(req, state->rctx, state->dom, state->hint);
if (subreq == NULL) {
ret = ENOMEM;
goto fail;