|
|
ced1f5 |
From 1bed72e4faa2734b0eef6a107b2dc24bf052e576 Mon Sep 17 00:00:00 2001
|
|
|
ced1f5 |
From: Jakub Hrozek <jhrozek@redhat.com>
|
|
|
ced1f5 |
Date: Mon, 30 Oct 2017 20:50:41 +0100
|
|
|
ced1f5 |
Subject: [PATCH 73/83] DP: Create a new handler function getAccountDomain()
|
|
|
ced1f5 |
MIME-Version: 1.0
|
|
|
ced1f5 |
Content-Type: text/plain; charset=UTF-8
|
|
|
ced1f5 |
Content-Transfer-Encoding: 8bit
|
|
|
ced1f5 |
|
|
|
ced1f5 |
Adds a new method getAccountDomain() which is a bit similar to
|
|
|
ced1f5 |
getAccountInfo, except it doesn't fetch, parse and store the entry, but
|
|
|
ced1f5 |
just returns the domain or a subdomain the entry was found in.
|
|
|
ced1f5 |
|
|
|
ced1f5 |
At the moment, the method only supports requests by ID.
|
|
|
ced1f5 |
|
|
|
ced1f5 |
A default handler is provided (and in this patch used by all the
|
|
|
ced1f5 |
domains) which returns ERR_GET_ACCT_DOM_NOT_SUPPORTED. This return
|
|
|
ced1f5 |
code should be evaluated by the responder so that this DP method is
|
|
|
ced1f5 |
not called again, because it's not supported by the back end type.
|
|
|
ced1f5 |
|
|
|
ced1f5 |
Reviewed-by: Pavel Březina <pbrezina@redhat.com>
|
|
|
ced1f5 |
Reviewed-by: Sumit Bose <sbose@redhat.com>
|
|
|
ced1f5 |
(cherry picked from commit c0f9f5a0f6d71a1596ee3cef549b4b02295313c3)
|
|
|
ced1f5 |
---
|
|
|
ced1f5 |
src/providers/ad/ad_init.c | 4 +
|
|
|
ced1f5 |
src/providers/data_provider/dp.h | 20 ++++
|
|
|
ced1f5 |
src/providers/data_provider/dp_custom_data.h | 6 ++
|
|
|
ced1f5 |
src/providers/data_provider/dp_iface.c | 3 +-
|
|
|
ced1f5 |
src/providers/data_provider/dp_iface.h | 17 ++++
|
|
|
ced1f5 |
src/providers/data_provider/dp_iface.xml | 7 ++
|
|
|
ced1f5 |
src/providers/data_provider/dp_iface_generated.c | 31 +++++++
|
|
|
ced1f5 |
src/providers/data_provider/dp_iface_generated.h | 5 +
|
|
|
ced1f5 |
src/providers/data_provider/dp_target_id.c | 113 +++++++++++++++++++++++
|
|
|
ced1f5 |
src/providers/files/files_init.c | 6 ++
|
|
|
ced1f5 |
src/providers/ipa/ipa_init.c | 4 +
|
|
|
ced1f5 |
src/providers/ldap/ldap_init.c | 4 +
|
|
|
ced1f5 |
src/providers/proxy/proxy_init.c | 4 +
|
|
|
ced1f5 |
src/util/util_errors.c | 1 +
|
|
|
ced1f5 |
src/util/util_errors.h | 1 +
|
|
|
ced1f5 |
15 files changed, 225 insertions(+), 1 deletion(-)
|
|
|
ced1f5 |
|
|
|
ced1f5 |
diff --git a/src/providers/ad/ad_init.c b/src/providers/ad/ad_init.c
|
|
|
ced1f5 |
index e62025d4acd24844a5c7082d00c597516f35de16..7efb6aa71cbd2551422c87e0b0c5c1fe91390375 100644
|
|
|
ced1f5 |
--- a/src/providers/ad/ad_init.c
|
|
|
ced1f5 |
+++ b/src/providers/ad/ad_init.c
|
|
|
ced1f5 |
@@ -510,6 +510,10 @@ errno_t sssm_ad_id_init(TALLOC_CTX *mem_ctx,
|
|
|
ced1f5 |
sdap_online_check_handler_send, sdap_online_check_handler_recv, id_ctx->sdap_id_ctx,
|
|
|
ced1f5 |
struct sdap_id_ctx, void, struct dp_reply_std);
|
|
|
ced1f5 |
|
|
|
ced1f5 |
+ dp_set_method(dp_methods, DPM_ACCT_DOMAIN_HANDLER,
|
|
|
ced1f5 |
+ default_account_domain_send, default_account_domain_recv, NULL,
|
|
|
ced1f5 |
+ void, struct dp_get_acct_domain_data, struct dp_reply_std);
|
|
|
ced1f5 |
+
|
|
|
ced1f5 |
return EOK;
|
|
|
ced1f5 |
}
|
|
|
ced1f5 |
|
|
|
ced1f5 |
diff --git a/src/providers/data_provider/dp.h b/src/providers/data_provider/dp.h
|
|
|
ced1f5 |
index aa5b781158c54545b26034602bb25db46b189e87..ceb49da53b88142924e1792c6f64a22ec369677b 100644
|
|
|
ced1f5 |
--- a/src/providers/data_provider/dp.h
|
|
|
ced1f5 |
+++ b/src/providers/data_provider/dp.h
|
|
|
ced1f5 |
@@ -82,6 +82,7 @@ enum dp_methods {
|
|
|
ced1f5 |
DPM_HOSTID_HANDLER,
|
|
|
ced1f5 |
DPM_DOMAINS_HANDLER,
|
|
|
ced1f5 |
DPM_SESSION_HANDLER,
|
|
|
ced1f5 |
+ DPM_ACCT_DOMAIN_HANDLER,
|
|
|
ced1f5 |
|
|
|
ced1f5 |
DPM_REFRESH_ACCESS_RULES,
|
|
|
ced1f5 |
|
|
|
ced1f5 |
@@ -179,4 +180,23 @@ void dp_sbus_reset_users_memcache(struct data_provider *provider);
|
|
|
ced1f5 |
void dp_sbus_reset_groups_memcache(struct data_provider *provider);
|
|
|
ced1f5 |
void dp_sbus_reset_initgr_memcache(struct data_provider *provider);
|
|
|
ced1f5 |
|
|
|
ced1f5 |
+/*
|
|
|
ced1f5 |
+ * A dummy handler for DPM_ACCT_DOMAIN_HANDLER.
|
|
|
ced1f5 |
+ *
|
|
|
ced1f5 |
+ * Its purpose is to always return ERR_GET_ACCT_DOM_NOT_SUPPORTED
|
|
|
ced1f5 |
+ * which the responder should evaluate as "this back end does not
|
|
|
ced1f5 |
+ * support locating entries' domain" and never call
|
|
|
ced1f5 |
+ * DPM_ACCT_DOMAIN_HANDLER again
|
|
|
ced1f5 |
+ *
|
|
|
ced1f5 |
+ * This request cannot fail, except for critical errors like OOM.
|
|
|
ced1f5 |
+ */
|
|
|
ced1f5 |
+struct tevent_req *
|
|
|
ced1f5 |
+default_account_domain_send(TALLOC_CTX *mem_ctx,
|
|
|
ced1f5 |
+ void *unused_ctx,
|
|
|
ced1f5 |
+ struct dp_get_acct_domain_data *data,
|
|
|
ced1f5 |
+ struct dp_req_params *params);
|
|
|
ced1f5 |
+errno_t default_account_domain_recv(TALLOC_CTX *mem_ctx,
|
|
|
ced1f5 |
+ struct tevent_req *req,
|
|
|
ced1f5 |
+ struct dp_reply_std *data);
|
|
|
ced1f5 |
+
|
|
|
ced1f5 |
#endif /* _DP_H_ */
|
|
|
ced1f5 |
diff --git a/src/providers/data_provider/dp_custom_data.h b/src/providers/data_provider/dp_custom_data.h
|
|
|
ced1f5 |
index d9de288b62f4f6763ceb205dc596876cfc58bf6c..7c64bde4513961e79200e852c7277f77e064d5a3 100644
|
|
|
ced1f5 |
--- a/src/providers/data_provider/dp_custom_data.h
|
|
|
ced1f5 |
+++ b/src/providers/data_provider/dp_custom_data.h
|
|
|
ced1f5 |
@@ -43,6 +43,12 @@ struct dp_subdomains_data {
|
|
|
ced1f5 |
const char *domain_hint;
|
|
|
ced1f5 |
};
|
|
|
ced1f5 |
|
|
|
ced1f5 |
+struct dp_get_acct_domain_data {
|
|
|
ced1f5 |
+ uint32_t entry_type;
|
|
|
ced1f5 |
+ uint32_t filter_type;
|
|
|
ced1f5 |
+ const char *filter_value;
|
|
|
ced1f5 |
+};
|
|
|
ced1f5 |
+
|
|
|
ced1f5 |
struct dp_id_data {
|
|
|
ced1f5 |
uint32_t entry_type;
|
|
|
ced1f5 |
uint32_t filter_type;
|
|
|
ced1f5 |
diff --git a/src/providers/data_provider/dp_iface.c b/src/providers/data_provider/dp_iface.c
|
|
|
ced1f5 |
index 28d70e686f63a3572ac595f493aa1d59436c563f..124be0048f38a93d06561ff7b0d1916838587103 100644
|
|
|
ced1f5 |
--- a/src/providers/data_provider/dp_iface.c
|
|
|
ced1f5 |
+++ b/src/providers/data_provider/dp_iface.c
|
|
|
ced1f5 |
@@ -33,7 +33,8 @@ struct iface_dp iface_dp = {
|
|
|
ced1f5 |
.autofsHandler = dp_autofs_handler,
|
|
|
ced1f5 |
.hostHandler = dp_host_handler,
|
|
|
ced1f5 |
.getDomains = dp_subdomains_handler,
|
|
|
ced1f5 |
- .getAccountInfo = dp_get_account_info_handler
|
|
|
ced1f5 |
+ .getAccountInfo = dp_get_account_info_handler,
|
|
|
ced1f5 |
+ .getAccountDomain = dp_get_account_domain_handler,
|
|
|
ced1f5 |
};
|
|
|
ced1f5 |
|
|
|
ced1f5 |
struct iface_dp_backend iface_dp_backend = {
|
|
|
ced1f5 |
diff --git a/src/providers/data_provider/dp_iface.h b/src/providers/data_provider/dp_iface.h
|
|
|
ced1f5 |
index 759b9e6c9eb7f53836ae0b641b34e6c31e65779f..0a2f81eb5c108aa7596c974157b0dfafb041869f 100644
|
|
|
ced1f5 |
--- a/src/providers/data_provider/dp_iface.h
|
|
|
ced1f5 |
+++ b/src/providers/data_provider/dp_iface.h
|
|
|
ced1f5 |
@@ -58,6 +58,23 @@ errno_t dp_subdomains_handler(struct sbus_request *sbus_req,
|
|
|
ced1f5 |
void *dp_cli,
|
|
|
ced1f5 |
const char *domain_hint);
|
|
|
ced1f5 |
|
|
|
ced1f5 |
+/*
|
|
|
ced1f5 |
+ * Return a domain the account belongs to.
|
|
|
ced1f5 |
+ *
|
|
|
ced1f5 |
+ * The request uses the dp_reply_std structure for reply, with the following
|
|
|
ced1f5 |
+ * semantics:
|
|
|
ced1f5 |
+ * - DP_ERR_OK - it is expected that the string message contains the domain name
|
|
|
ced1f5 |
+ * the entry was found in. A 'negative' reply where the
|
|
|
ced1f5 |
+ * request returns DP_ERR_OK, but no domain should be treated
|
|
|
ced1f5 |
+ * as authoritative, as if the entry does not exist.
|
|
|
ced1f5 |
+ * - DP_ERR_* - the string message contains error string that corresponds
|
|
|
ced1f5 |
+ * to the errno field in dp_reply_std().
|
|
|
ced1f5 |
+ */
|
|
|
ced1f5 |
+errno_t dp_get_account_domain_handler(struct sbus_request *sbus_req,
|
|
|
ced1f5 |
+ void *dp_cli,
|
|
|
ced1f5 |
+ uint32_t entry_type,
|
|
|
ced1f5 |
+ const char *filter);
|
|
|
ced1f5 |
+
|
|
|
ced1f5 |
/* org.freedesktop.sssd.DataProvider.Backend */
|
|
|
ced1f5 |
errno_t dp_backend_is_online(struct sbus_request *sbus_req,
|
|
|
ced1f5 |
void *dp_cli,
|
|
|
ced1f5 |
diff --git a/src/providers/data_provider/dp_iface.xml b/src/providers/data_provider/dp_iface.xml
|
|
|
ced1f5 |
index 2bfa9dfa7e9d02d2d12c3358967f6969438a97a2..c2431850bca4baa529fb18e0480e781308b12dd6 100644
|
|
|
ced1f5 |
--- a/src/providers/data_provider/dp_iface.xml
|
|
|
ced1f5 |
+++ b/src/providers/data_provider/dp_iface.xml
|
|
|
ced1f5 |
@@ -79,5 +79,12 @@
|
|
|
ced1f5 |
<arg name="error" type="u" direction="out" />
|
|
|
ced1f5 |
<arg name="error_message" type="s" direction="out" />
|
|
|
ced1f5 |
</method>
|
|
|
ced1f5 |
+ <method name="getAccountDomain">
|
|
|
ced1f5 |
+ <arg name="entry_type" type="u" direction="in" />
|
|
|
ced1f5 |
+ <arg name="filter" type="s" direction="in" />
|
|
|
ced1f5 |
+ <arg name="dp_error" type="q" direction="out" />
|
|
|
ced1f5 |
+ <arg name="error" type="u" direction="out" />
|
|
|
ced1f5 |
+ <arg name="domain_name" type="s" direction="out" />
|
|
|
ced1f5 |
+ </method>
|
|
|
ced1f5 |
</interface>
|
|
|
ced1f5 |
</node>
|
|
|
ced1f5 |
diff --git a/src/providers/data_provider/dp_iface_generated.c b/src/providers/data_provider/dp_iface_generated.c
|
|
|
ced1f5 |
index 11ee2e24a69cc8d4d19fdbeed613e76081aef15d..4d093444536b15d8a17f7e507b93948e1df6ffee 100644
|
|
|
ced1f5 |
--- a/src/providers/data_provider/dp_iface_generated.c
|
|
|
ced1f5 |
+++ b/src/providers/data_provider/dp_iface_generated.c
|
|
|
ced1f5 |
@@ -313,6 +313,30 @@ int iface_dp_getAccountInfo_finish(struct sbus_request *req, uint16_t arg_dp_err
|
|
|
ced1f5 |
DBUS_TYPE_INVALID);
|
|
|
ced1f5 |
}
|
|
|
ced1f5 |
|
|
|
ced1f5 |
+/* arguments for org.freedesktop.sssd.dataprovider.getAccountDomain */
|
|
|
ced1f5 |
+const struct sbus_arg_meta iface_dp_getAccountDomain__in[] = {
|
|
|
ced1f5 |
+ { "entry_type", "u" },
|
|
|
ced1f5 |
+ { "filter", "s" },
|
|
|
ced1f5 |
+ { NULL, }
|
|
|
ced1f5 |
+};
|
|
|
ced1f5 |
+
|
|
|
ced1f5 |
+/* arguments for org.freedesktop.sssd.dataprovider.getAccountDomain */
|
|
|
ced1f5 |
+const struct sbus_arg_meta iface_dp_getAccountDomain__out[] = {
|
|
|
ced1f5 |
+ { "dp_error", "q" },
|
|
|
ced1f5 |
+ { "error", "u" },
|
|
|
ced1f5 |
+ { "domain_name", "s" },
|
|
|
ced1f5 |
+ { NULL, }
|
|
|
ced1f5 |
+};
|
|
|
ced1f5 |
+
|
|
|
ced1f5 |
+int iface_dp_getAccountDomain_finish(struct sbus_request *req, uint16_t arg_dp_error, uint32_t arg_error, const char *arg_domain_name)
|
|
|
ced1f5 |
+{
|
|
|
ced1f5 |
+ return sbus_request_return_and_finish(req,
|
|
|
ced1f5 |
+ DBUS_TYPE_UINT16, &arg_dp_error,
|
|
|
ced1f5 |
+ DBUS_TYPE_UINT32, &arg_error,
|
|
|
ced1f5 |
+ DBUS_TYPE_STRING, &arg_domain_name,
|
|
|
ced1f5 |
+ DBUS_TYPE_INVALID);
|
|
|
ced1f5 |
+}
|
|
|
ced1f5 |
+
|
|
|
ced1f5 |
/* methods for org.freedesktop.sssd.dataprovider */
|
|
|
ced1f5 |
const struct sbus_method_meta iface_dp__methods[] = {
|
|
|
ced1f5 |
{
|
|
|
ced1f5 |
@@ -357,6 +381,13 @@ const struct sbus_method_meta iface_dp__methods[] = {
|
|
|
ced1f5 |
offsetof(struct iface_dp, getAccountInfo),
|
|
|
ced1f5 |
invoke_uusss_method,
|
|
|
ced1f5 |
},
|
|
|
ced1f5 |
+ {
|
|
|
ced1f5 |
+ "getAccountDomain", /* name */
|
|
|
ced1f5 |
+ iface_dp_getAccountDomain__in,
|
|
|
ced1f5 |
+ iface_dp_getAccountDomain__out,
|
|
|
ced1f5 |
+ offsetof(struct iface_dp, getAccountDomain),
|
|
|
ced1f5 |
+ invoke_us_method,
|
|
|
ced1f5 |
+ },
|
|
|
ced1f5 |
{ NULL, }
|
|
|
ced1f5 |
};
|
|
|
ced1f5 |
|
|
|
ced1f5 |
diff --git a/src/providers/data_provider/dp_iface_generated.h b/src/providers/data_provider/dp_iface_generated.h
|
|
|
ced1f5 |
index 541a90b0b5a5bc0a346cbd04974d33c8bb0983c5..b629ec77487328a41615f3ca7e812088730f40c4 100644
|
|
|
ced1f5 |
--- a/src/providers/data_provider/dp_iface_generated.h
|
|
|
ced1f5 |
+++ b/src/providers/data_provider/dp_iface_generated.h
|
|
|
ced1f5 |
@@ -38,6 +38,7 @@
|
|
|
ced1f5 |
#define IFACE_DP_HOSTHANDLER "hostHandler"
|
|
|
ced1f5 |
#define IFACE_DP_GETDOMAINS "getDomains"
|
|
|
ced1f5 |
#define IFACE_DP_GETACCOUNTINFO "getAccountInfo"
|
|
|
ced1f5 |
+#define IFACE_DP_GETACCOUNTDOMAIN "getAccountDomain"
|
|
|
ced1f5 |
|
|
|
ced1f5 |
/* ------------------------------------------------------------------------
|
|
|
ced1f5 |
* DBus handlers
|
|
|
ced1f5 |
@@ -110,6 +111,7 @@ struct iface_dp {
|
|
|
ced1f5 |
int (*hostHandler)(struct sbus_request *req, void *data, uint32_t arg_dp_flags, const char *arg_name, const char *arg_alias);
|
|
|
ced1f5 |
int (*getDomains)(struct sbus_request *req, void *data, const char *arg_domain_hint);
|
|
|
ced1f5 |
int (*getAccountInfo)(struct sbus_request *req, void *data, uint32_t arg_dp_flags, uint32_t arg_entry_type, const char *arg_filter, const char *arg_domain, const char *arg_extra);
|
|
|
ced1f5 |
+ int (*getAccountDomain)(struct sbus_request *req, void *data, uint32_t arg_entry_type, const char *arg_filter);
|
|
|
ced1f5 |
};
|
|
|
ced1f5 |
|
|
|
ced1f5 |
/* finish function for autofsHandler */
|
|
|
ced1f5 |
@@ -124,6 +126,9 @@ int iface_dp_getDomains_finish(struct sbus_request *req, uint16_t arg_dp_error,
|
|
|
ced1f5 |
/* finish function for getAccountInfo */
|
|
|
ced1f5 |
int iface_dp_getAccountInfo_finish(struct sbus_request *req, uint16_t arg_dp_error, uint32_t arg_error, const char *arg_error_message);
|
|
|
ced1f5 |
|
|
|
ced1f5 |
+/* finish function for getAccountDomain */
|
|
|
ced1f5 |
+int iface_dp_getAccountDomain_finish(struct sbus_request *req, uint16_t arg_dp_error, uint32_t arg_error, const char *arg_domain_name);
|
|
|
ced1f5 |
+
|
|
|
ced1f5 |
/* ------------------------------------------------------------------------
|
|
|
ced1f5 |
* DBus Interface Metadata
|
|
|
ced1f5 |
*
|
|
|
ced1f5 |
diff --git a/src/providers/data_provider/dp_target_id.c b/src/providers/data_provider/dp_target_id.c
|
|
|
ced1f5 |
index 820a6574cb3a224cce4b7d8286af306f234454a3..11a36e9ce9b1aefcabb04dfe51395b6f4e4bc899 100644
|
|
|
ced1f5 |
--- a/src/providers/data_provider/dp_target_id.c
|
|
|
ced1f5 |
+++ b/src/providers/data_provider/dp_target_id.c
|
|
|
ced1f5 |
@@ -490,3 +490,116 @@ done:
|
|
|
ced1f5 |
|
|
|
ced1f5 |
return ret;
|
|
|
ced1f5 |
}
|
|
|
ced1f5 |
+
|
|
|
ced1f5 |
+static bool
|
|
|
ced1f5 |
+check_and_parse_acct_domain_filter(struct dp_get_acct_domain_data *data,
|
|
|
ced1f5 |
+ const char *filter)
|
|
|
ced1f5 |
+{
|
|
|
ced1f5 |
+ /* We will use sizeof() to determine the length of a string so we don't
|
|
|
ced1f5 |
+ * call strlen over and over again with each request. Not a bottleneck,
|
|
|
ced1f5 |
+ * but unnecessary and simple to avoid. */
|
|
|
ced1f5 |
+ static struct {
|
|
|
ced1f5 |
+ const char *name;
|
|
|
ced1f5 |
+ size_t lenght;
|
|
|
ced1f5 |
+ uint32_t type;
|
|
|
ced1f5 |
+ } types[] = {FILTER_TYPE("idnumber", BE_FILTER_IDNUM),
|
|
|
ced1f5 |
+ {0, 0, 0}};
|
|
|
ced1f5 |
+ int i;
|
|
|
ced1f5 |
+
|
|
|
ced1f5 |
+ if (SBUS_IS_STRING_EMPTY(filter)) {
|
|
|
ced1f5 |
+ return false;
|
|
|
ced1f5 |
+ }
|
|
|
ced1f5 |
+
|
|
|
ced1f5 |
+ for (i = 0; types[i].name != NULL; i++) {
|
|
|
ced1f5 |
+ if (strncmp(filter, types[i].name, types[i].lenght) == 0) {
|
|
|
ced1f5 |
+ data->filter_type = types[i].type;
|
|
|
ced1f5 |
+ data->filter_value = SBUS_SET_STRING(&filter[types[i].lenght]);
|
|
|
ced1f5 |
+ return true;
|
|
|
ced1f5 |
+ }
|
|
|
ced1f5 |
+ }
|
|
|
ced1f5 |
+
|
|
|
ced1f5 |
+ if (strcmp(filter, ENUM_INDICATOR) == 0) {
|
|
|
ced1f5 |
+ data->filter_type = BE_FILTER_ENUM;
|
|
|
ced1f5 |
+ data->filter_value = NULL;
|
|
|
ced1f5 |
+ return true;
|
|
|
ced1f5 |
+ }
|
|
|
ced1f5 |
+
|
|
|
ced1f5 |
+ return false;
|
|
|
ced1f5 |
+}
|
|
|
ced1f5 |
+
|
|
|
ced1f5 |
+errno_t dp_get_account_domain_handler(struct sbus_request *sbus_req,
|
|
|
ced1f5 |
+ void *dp_cli,
|
|
|
ced1f5 |
+ uint32_t entry_type,
|
|
|
ced1f5 |
+ const char *filter)
|
|
|
ced1f5 |
+{
|
|
|
ced1f5 |
+ struct dp_get_acct_domain_data *data;
|
|
|
ced1f5 |
+ const char *key = NULL;
|
|
|
ced1f5 |
+ errno_t ret;
|
|
|
ced1f5 |
+
|
|
|
ced1f5 |
+ data = talloc_zero(sbus_req, struct dp_get_acct_domain_data);
|
|
|
ced1f5 |
+ if (data == NULL) {
|
|
|
ced1f5 |
+ return ENOMEM;
|
|
|
ced1f5 |
+ }
|
|
|
ced1f5 |
+ data->entry_type = entry_type;
|
|
|
ced1f5 |
+
|
|
|
ced1f5 |
+ if (!check_and_parse_acct_domain_filter(data, filter)) {
|
|
|
ced1f5 |
+ ret = EINVAL;
|
|
|
ced1f5 |
+ goto done;
|
|
|
ced1f5 |
+ }
|
|
|
ced1f5 |
+
|
|
|
ced1f5 |
+ dp_req_with_reply(dp_cli, NULL, "AccountDomain", key, sbus_req,
|
|
|
ced1f5 |
+ DPT_ID, DPM_ACCT_DOMAIN_HANDLER, 0, data,
|
|
|
ced1f5 |
+ dp_req_reply_std, struct dp_reply_std);
|
|
|
ced1f5 |
+
|
|
|
ced1f5 |
+ ret = EOK;
|
|
|
ced1f5 |
+
|
|
|
ced1f5 |
+done:
|
|
|
ced1f5 |
+ if (ret != EOK) {
|
|
|
ced1f5 |
+ talloc_free(data);
|
|
|
ced1f5 |
+ }
|
|
|
ced1f5 |
+
|
|
|
ced1f5 |
+ return ret;
|
|
|
ced1f5 |
+}
|
|
|
ced1f5 |
+
|
|
|
ced1f5 |
+struct default_account_domain_state {
|
|
|
ced1f5 |
+ struct dp_reply_std reply;
|
|
|
ced1f5 |
+};
|
|
|
ced1f5 |
+
|
|
|
ced1f5 |
+struct tevent_req *
|
|
|
ced1f5 |
+default_account_domain_send(TALLOC_CTX *mem_ctx,
|
|
|
ced1f5 |
+ void *unused_ctx,
|
|
|
ced1f5 |
+ struct dp_get_acct_domain_data *data,
|
|
|
ced1f5 |
+ struct dp_req_params *params)
|
|
|
ced1f5 |
+{
|
|
|
ced1f5 |
+ struct default_account_domain_state *state;
|
|
|
ced1f5 |
+ struct tevent_req *req;
|
|
|
ced1f5 |
+
|
|
|
ced1f5 |
+ req = tevent_req_create(mem_ctx, &state,
|
|
|
ced1f5 |
+ struct default_account_domain_state);
|
|
|
ced1f5 |
+ if (req == NULL) {
|
|
|
ced1f5 |
+ DEBUG(SSSDBG_CRIT_FAILURE, "tevent_req_create() failed\n");
|
|
|
ced1f5 |
+ return NULL;
|
|
|
ced1f5 |
+ }
|
|
|
ced1f5 |
+
|
|
|
ced1f5 |
+ dp_reply_std_set(&state->reply,
|
|
|
ced1f5 |
+ DP_ERR_DECIDE, ERR_GET_ACCT_DOM_NOT_SUPPORTED,
|
|
|
ced1f5 |
+ NULL);
|
|
|
ced1f5 |
+ tevent_req_done(req);
|
|
|
ced1f5 |
+ tevent_req_post(req, params->ev);
|
|
|
ced1f5 |
+ return req;
|
|
|
ced1f5 |
+}
|
|
|
ced1f5 |
+
|
|
|
ced1f5 |
+errno_t default_account_domain_recv(TALLOC_CTX *mem_ctx,
|
|
|
ced1f5 |
+ struct tevent_req *req,
|
|
|
ced1f5 |
+ struct dp_reply_std *data)
|
|
|
ced1f5 |
+{
|
|
|
ced1f5 |
+ struct default_account_domain_state *state = NULL;
|
|
|
ced1f5 |
+
|
|
|
ced1f5 |
+ state = tevent_req_data(req, struct default_account_domain_state);
|
|
|
ced1f5 |
+
|
|
|
ced1f5 |
+ TEVENT_REQ_RETURN_ON_ERROR(req);
|
|
|
ced1f5 |
+
|
|
|
ced1f5 |
+ *data = state->reply;
|
|
|
ced1f5 |
+
|
|
|
ced1f5 |
+ return EOK;
|
|
|
ced1f5 |
+}
|
|
|
ced1f5 |
diff --git a/src/providers/files/files_init.c b/src/providers/files/files_init.c
|
|
|
ced1f5 |
index b91dfbac9bf9d4b678ebdfa6b1cb0971b4477dd9..8e5cd4cf913b79653616120d6ed6540e62ade932 100644
|
|
|
ced1f5 |
--- a/src/providers/files/files_init.c
|
|
|
ced1f5 |
+++ b/src/providers/files/files_init.c
|
|
|
ced1f5 |
@@ -88,5 +88,11 @@ int sssm_files_id_init(TALLOC_CTX *mem_ctx,
|
|
|
ced1f5 |
ctx, struct files_id_ctx,
|
|
|
ced1f5 |
struct dp_id_data, struct dp_reply_std);
|
|
|
ced1f5 |
|
|
|
ced1f5 |
+ dp_set_method(dp_methods, DPM_ACCT_DOMAIN_HANDLER,
|
|
|
ced1f5 |
+ default_account_domain_send,
|
|
|
ced1f5 |
+ default_account_domain_recv,
|
|
|
ced1f5 |
+ NULL, void,
|
|
|
ced1f5 |
+ struct dp_get_acct_domain_data, struct dp_reply_std);
|
|
|
ced1f5 |
+
|
|
|
ced1f5 |
return EOK;
|
|
|
ced1f5 |
}
|
|
|
ced1f5 |
diff --git a/src/providers/ipa/ipa_init.c b/src/providers/ipa/ipa_init.c
|
|
|
ced1f5 |
index f335d51fd65959d256c54a5d92c594a24e895b7c..754e5315c3a7f84ac2901986ecdda73e4dad26bc 100644
|
|
|
ced1f5 |
--- a/src/providers/ipa/ipa_init.c
|
|
|
ced1f5 |
+++ b/src/providers/ipa/ipa_init.c
|
|
|
ced1f5 |
@@ -754,6 +754,10 @@ errno_t sssm_ipa_id_init(TALLOC_CTX *mem_ctx,
|
|
|
ced1f5 |
sdap_online_check_handler_send, sdap_online_check_handler_recv, id_ctx->sdap_id_ctx,
|
|
|
ced1f5 |
struct sdap_id_ctx, void, struct dp_reply_std);
|
|
|
ced1f5 |
|
|
|
ced1f5 |
+ dp_set_method(dp_methods, DPM_ACCT_DOMAIN_HANDLER,
|
|
|
ced1f5 |
+ default_account_domain_send, default_account_domain_recv, NULL,
|
|
|
ced1f5 |
+ void, struct dp_get_acct_domain_data, struct dp_reply_std);
|
|
|
ced1f5 |
+
|
|
|
ced1f5 |
return EOK;
|
|
|
ced1f5 |
}
|
|
|
ced1f5 |
|
|
|
ced1f5 |
diff --git a/src/providers/ldap/ldap_init.c b/src/providers/ldap/ldap_init.c
|
|
|
ced1f5 |
index 43d905893081c31ed659fd1ef8343f965bdc5af0..c0ede8941ee8480c2ec4765f89d12e903edcf012 100644
|
|
|
ced1f5 |
--- a/src/providers/ldap/ldap_init.c
|
|
|
ced1f5 |
+++ b/src/providers/ldap/ldap_init.c
|
|
|
ced1f5 |
@@ -531,6 +531,10 @@ errno_t sssm_ldap_id_init(TALLOC_CTX *mem_ctx,
|
|
|
ced1f5 |
sdap_online_check_handler_send, sdap_online_check_handler_recv, id_ctx,
|
|
|
ced1f5 |
struct sdap_id_ctx, void, struct dp_reply_std);
|
|
|
ced1f5 |
|
|
|
ced1f5 |
+ dp_set_method(dp_methods, DPM_ACCT_DOMAIN_HANDLER,
|
|
|
ced1f5 |
+ default_account_domain_send, default_account_domain_recv, NULL,
|
|
|
ced1f5 |
+ void, struct dp_get_acct_domain_data, struct dp_reply_std);
|
|
|
ced1f5 |
+
|
|
|
ced1f5 |
return EOK;
|
|
|
ced1f5 |
}
|
|
|
ced1f5 |
|
|
|
ced1f5 |
diff --git a/src/providers/proxy/proxy_init.c b/src/providers/proxy/proxy_init.c
|
|
|
ced1f5 |
index 7c9d3dafbdf1f9448cc8f8b473aea15cf4206afc..7d997cb16ee62f10f4b86c9c3ab373a48676fe75 100644
|
|
|
ced1f5 |
--- a/src/providers/proxy/proxy_init.c
|
|
|
ced1f5 |
+++ b/src/providers/proxy/proxy_init.c
|
|
|
ced1f5 |
@@ -351,6 +351,10 @@ errno_t sssm_proxy_id_init(TALLOC_CTX *mem_ctx,
|
|
|
ced1f5 |
proxy_account_info_handler_send, proxy_account_info_handler_recv, ctx,
|
|
|
ced1f5 |
struct proxy_id_ctx, struct dp_id_data, struct dp_reply_std);
|
|
|
ced1f5 |
|
|
|
ced1f5 |
+ dp_set_method(dp_methods, DPM_ACCT_DOMAIN_HANDLER,
|
|
|
ced1f5 |
+ default_account_domain_send, default_account_domain_recv, NULL,
|
|
|
ced1f5 |
+ void, struct dp_get_acct_domain_data, struct dp_reply_std);
|
|
|
ced1f5 |
+
|
|
|
ced1f5 |
ret = EOK;
|
|
|
ced1f5 |
|
|
|
ced1f5 |
done:
|
|
|
ced1f5 |
diff --git a/src/util/util_errors.c b/src/util/util_errors.c
|
|
|
ced1f5 |
index 5a92a2dcf6e65f93bc9732cebf562756357123b6..9a9ba3f3063cab4afb538c3a58527a2d2ed3fffd 100644
|
|
|
ced1f5 |
--- a/src/util/util_errors.c
|
|
|
ced1f5 |
+++ b/src/util/util_errors.c
|
|
|
ced1f5 |
@@ -115,6 +115,7 @@ struct err_string error_to_str[] = {
|
|
|
ced1f5 |
{ "Unable to initialize SSL" }, /* ERR_SSL_FAILURE */
|
|
|
ced1f5 |
{ "Unable to verify peer" }, /* ERR_UNABLE_TO_VERIFY_PEER */
|
|
|
ced1f5 |
{ "Unable to resolve host" }, /* ERR_UNABLE_TO_RESOLVE_HOST */
|
|
|
ced1f5 |
+ { "GetAccountDomain() not supported" }, /* ERR_GET_ACCT_DOM_NOT_SUPPORTED */
|
|
|
ced1f5 |
{ "ERR_LAST" } /* ERR_LAST */
|
|
|
ced1f5 |
};
|
|
|
ced1f5 |
|
|
|
ced1f5 |
diff --git a/src/util/util_errors.h b/src/util/util_errors.h
|
|
|
ced1f5 |
index 509ccb805fb97e59f9da0ea2f991ece2f2030ca4..5ee9862c3f2f60c078693b1b85a40f15436e818c 100644
|
|
|
ced1f5 |
--- a/src/util/util_errors.h
|
|
|
ced1f5 |
+++ b/src/util/util_errors.h
|
|
|
ced1f5 |
@@ -137,6 +137,7 @@ enum sssd_errors {
|
|
|
ced1f5 |
ERR_SSL_FAILURE,
|
|
|
ced1f5 |
ERR_UNABLE_TO_VERIFY_PEER,
|
|
|
ced1f5 |
ERR_UNABLE_TO_RESOLVE_HOST,
|
|
|
ced1f5 |
+ ERR_GET_ACCT_DOM_NOT_SUPPORTED,
|
|
|
ced1f5 |
ERR_LAST /* ALWAYS LAST */
|
|
|
ced1f5 |
};
|
|
|
ced1f5 |
|
|
|
ced1f5 |
--
|
|
|
ced1f5 |
2.14.3
|
|
|
ced1f5 |
|