summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLukas Slebodnik <lslebodn@redhat.com>2017-01-06 15:58:17 +0100
committerLukas Slebodnik <lslebodn@redhat.com>2017-01-16 09:58:15 +0100
commitca68b1b4ba06b1cda316ae8af470647bd7015a5a (patch)
tree8e38d7fd83b5e7a3b33efc6f1a932083e9ff3c4c
parent8b026b55ff30ed24fb6795fbd5f59bd5949c303b (diff)
downloadsssd-ca68b1b4ba06b1cda316ae8af470647bd7015a5a.tar.gz
sssd-ca68b1b4ba06b1cda316ae8af470647bd7015a5a.tar.xz
sssd-ca68b1b4ba06b1cda316ae8af470647bd7015a5a.zip
DP: Remove unused attr_type from struct dp_id_data
Structure member attr_type was set to BE_ATTR_CORE on all places and there was a single place src/providers/ldap/ldap_id.c where we checked to other values. It is not used anymore; it's better to remove it. Reviewed-by: Michal Židek <mzidek@redhat.com>
-rw-r--r--src/providers/data_provider.h2
-rw-r--r--src/providers/data_provider/dp_custom_data.h1
-rw-r--r--src/providers/data_provider/dp_iface.h1
-rw-r--r--src/providers/data_provider/dp_iface.xml1
-rw-r--r--src/providers/data_provider/dp_iface_generated.c22
-rw-r--r--src/providers/data_provider/dp_iface_generated.h2
-rw-r--r--src/providers/data_provider/dp_target_id.c26
-rw-r--r--src/providers/ipa/ipa_id.c1
-rw-r--r--src/providers/ipa/ipa_subdomains_id.c1
-rw-r--r--src/providers/ldap/ldap_id.c5
-rw-r--r--src/providers/ldap/sdap_refresh.c1
-rw-r--r--src/providers/proxy/proxy_id.c6
-rw-r--r--src/providers/simple/simple_access_check.c1
-rw-r--r--src/responder/common/responder_dp.c6
14 files changed, 16 insertions, 60 deletions
diff --git a/src/providers/data_provider.h b/src/providers/data_provider.h
index 1030f15c2..46d9910dd 100644
--- a/src/providers/data_provider.h
+++ b/src/providers/data_provider.h
@@ -120,8 +120,6 @@
#define DP_ERR_TIMEOUT 2
#define DP_ERR_FATAL 3
-#define BE_ATTR_CORE 1
-
#define BE_FILTER_NAME 1
#define BE_FILTER_IDNUM 2
#define BE_FILTER_ENUM 3
diff --git a/src/providers/data_provider/dp_custom_data.h b/src/providers/data_provider/dp_custom_data.h
index 21a5890f6..d9de288b6 100644
--- a/src/providers/data_provider/dp_custom_data.h
+++ b/src/providers/data_provider/dp_custom_data.h
@@ -45,7 +45,6 @@ struct dp_subdomains_data {
struct dp_id_data {
uint32_t entry_type;
- uint32_t attr_type;
uint32_t filter_type;
const char *filter_value;
const char *extra_value;
diff --git a/src/providers/data_provider/dp_iface.h b/src/providers/data_provider/dp_iface.h
index 5c6f0eb2f..8ae7a2ad7 100644
--- a/src/providers/data_provider/dp_iface.h
+++ b/src/providers/data_provider/dp_iface.h
@@ -35,7 +35,6 @@ errno_t dp_get_account_info_handler(struct sbus_request *sbus_req,
void *dp_cli,
uint32_t dp_flags,
uint32_t entry_type,
- uint32_t attr_type,
const char *filter,
const char *domain,
const char *extra);
diff --git a/src/providers/data_provider/dp_iface.xml b/src/providers/data_provider/dp_iface.xml
index 992848a04..a3969873a 100644
--- a/src/providers/data_provider/dp_iface.xml
+++ b/src/providers/data_provider/dp_iface.xml
@@ -66,7 +66,6 @@
<method name="getAccountInfo">
<arg name="dp_flags" type="u" direction="in" />
<arg name="entry_type" type="u" direction="in" />
- <arg name="attr_type" type="u" direction="in" />
<arg name="filter" type="s" direction="in" />
<arg name="domain" type="s" direction="in" />
<arg name="extra" type="s" direction="in" />
diff --git a/src/providers/data_provider/dp_iface_generated.c b/src/providers/data_provider/dp_iface_generated.c
index fd2acb4f4..25ec0e29b 100644
--- a/src/providers/data_provider/dp_iface_generated.c
+++ b/src/providers/data_provider/dp_iface_generated.c
@@ -15,8 +15,8 @@ static int invoke_us_method(struct sbus_request *dbus_req, void *function_ptr);
/* invokes a handler with a 'uss' DBus signature */
static int invoke_uss_method(struct sbus_request *dbus_req, void *function_ptr);
-/* invokes a handler with a 'uuusss' DBus signature */
-static int invoke_uuusss_method(struct sbus_request *dbus_req, void *function_ptr);
+/* invokes a handler with a 'uusss' DBus signature */
+static int invoke_uusss_method(struct sbus_request *dbus_req, void *function_ptr);
/* arguments for org.freedesktop.sssd.DataProvider.Client.Register */
const struct sbus_arg_meta iface_dp_client_Register__in[] = {
@@ -260,7 +260,6 @@ int iface_dp_getDomains_finish(struct sbus_request *req, uint16_t arg_dp_error,
const struct sbus_arg_meta iface_dp_getAccountInfo__in[] = {
{ "dp_flags", "u" },
{ "entry_type", "u" },
- { "attr_type", "u" },
{ "filter", "s" },
{ "domain", "s" },
{ "extra", "s" },
@@ -326,7 +325,7 @@ const struct sbus_method_meta iface_dp__methods[] = {
iface_dp_getAccountInfo__in,
iface_dp_getAccountInfo__out,
offsetof(struct iface_dp, getAccountInfo),
- invoke_uuusss_method,
+ invoke_uusss_method,
},
{ NULL, }
};
@@ -378,24 +377,22 @@ static int invoke_uss_method(struct sbus_request *dbus_req, void *function_ptr)
arg_2);
}
-/* invokes a handler with a 'uuusss' DBus signature */
-static int invoke_uuusss_method(struct sbus_request *dbus_req, void *function_ptr)
+/* invokes a handler with a 'uusss' DBus signature */
+static int invoke_uusss_method(struct sbus_request *dbus_req, void *function_ptr)
{
uint32_t arg_0;
uint32_t arg_1;
- uint32_t arg_2;
+ const char * arg_2;
const char * arg_3;
const char * arg_4;
- const char * arg_5;
- int (*handler)(struct sbus_request *, void *, uint32_t, uint32_t, uint32_t, const char *, const char *, const char *) = function_ptr;
+ int (*handler)(struct sbus_request *, void *, uint32_t, uint32_t, const char *, const char *, const char *) = function_ptr;
if (!sbus_request_parse_or_finish(dbus_req,
DBUS_TYPE_UINT32, &arg_0,
DBUS_TYPE_UINT32, &arg_1,
- DBUS_TYPE_UINT32, &arg_2,
+ DBUS_TYPE_STRING, &arg_2,
DBUS_TYPE_STRING, &arg_3,
DBUS_TYPE_STRING, &arg_4,
- DBUS_TYPE_STRING, &arg_5,
DBUS_TYPE_INVALID)) {
return EOK; /* request handled */
}
@@ -405,8 +402,7 @@ static int invoke_uuusss_method(struct sbus_request *dbus_req, void *function_pt
arg_1,
arg_2,
arg_3,
- arg_4,
- arg_5);
+ arg_4);
}
/* invokes a handler with a 'us' DBus signature */
diff --git a/src/providers/data_provider/dp_iface_generated.h b/src/providers/data_provider/dp_iface_generated.h
index 7c2216aa2..c14b810cf 100644
--- a/src/providers/data_provider/dp_iface_generated.h
+++ b/src/providers/data_provider/dp_iface_generated.h
@@ -95,7 +95,7 @@ struct iface_dp {
int (*autofsHandler)(struct sbus_request *req, void *data, uint32_t arg_dp_flags, const char *arg_mapname);
int (*hostHandler)(struct sbus_request *req, void *data, uint32_t arg_dp_flags, const char *arg_name, const char *arg_alias);
int (*getDomains)(struct sbus_request *req, void *data, const char *arg_domain_hint);
- int (*getAccountInfo)(struct sbus_request *req, void *data, uint32_t arg_dp_flags, uint32_t arg_entry_type, uint32_t arg_attr_type, const char *arg_filter, const char *arg_domain, const char *arg_extra);
+ 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);
};
/* finish function for autofsHandler */
diff --git a/src/providers/data_provider/dp_target_id.c b/src/providers/data_provider/dp_target_id.c
index f92d3b8b5..0bca9bac2 100644
--- a/src/providers/data_provider/dp_target_id.c
+++ b/src/providers/data_provider/dp_target_id.c
@@ -30,18 +30,6 @@
#define FILTER_TYPE(str, type) {str "=", sizeof(str "=") - 1, type}
-static bool check_attr_type(uint32_t attr_type)
-{
- switch (attr_type) {
- case BE_ATTR_CORE:
- return true;
- default:
- return false;
- }
-
- return false;
-}
-
static bool check_and_parse_filter(struct dp_id_data *data,
const char *filter,
const char *extra)
@@ -252,7 +240,6 @@ errno_t dp_get_account_info_handler(struct sbus_request *sbus_req,
void *dp_cli,
uint32_t dp_flags,
uint32_t entry_type,
- uint32_t attr_type,
const char *filter,
const char *domain,
const char *extra)
@@ -261,17 +248,12 @@ errno_t dp_get_account_info_handler(struct sbus_request *sbus_req,
const char *key;
errno_t ret;
- if (!check_attr_type(attr_type)) {
- return EINVAL;
- }
-
data = talloc_zero(sbus_req, struct dp_id_data);
if (data == NULL) {
return ENOMEM;
}
data->entry_type = entry_type;
- data->attr_type = attr_type;
data->domain = domain;
if (!check_and_parse_filter(data, filter, extra)) {
@@ -280,12 +262,12 @@ errno_t dp_get_account_info_handler(struct sbus_request *sbus_req,
}
DEBUG(SSSDBG_FUNC_DATA,
- "Got request for [%#"PRIx32"][%s][%"PRId32"][%s]\n",
+ "Got request for [%#"PRIx32"][%s][%s]\n",
data->entry_type, be_req2str(data->entry_type),
- attr_type, filter);
+ filter);
- key = talloc_asprintf(data, "%u:%u:%s:%s:%s", data->entry_type,
- data->attr_type, extra, domain, filter);
+ key = talloc_asprintf(data, "%u:%s:%s:%s", data->entry_type,
+ extra, domain, filter);
if (key == NULL) {
ret = ENOMEM;
goto done;
diff --git a/src/providers/ipa/ipa_id.c b/src/providers/ipa/ipa_id.c
index 7f0cd5689..54af9918f 100644
--- a/src/providers/ipa/ipa_id.c
+++ b/src/providers/ipa/ipa_id.c
@@ -671,7 +671,6 @@ static void ipa_id_get_account_info_got_override(struct tevent_req *subreq)
"Switching back to BE_REQ_INITGROUPS.\n");
state->ar->entry_type = BE_REQ_INITGROUPS;
state->ar->filter_type = BE_FILTER_UUID;
- state->ar->attr_type = BE_ATTR_CORE;
}
} else {
diff --git a/src/providers/ipa/ipa_subdomains_id.c b/src/providers/ipa/ipa_subdomains_id.c
index 97c96e381..0d74e203d 100644
--- a/src/providers/ipa/ipa_subdomains_id.c
+++ b/src/providers/ipa/ipa_subdomains_id.c
@@ -237,7 +237,6 @@ static void ipa_subdomain_account_got_override(struct tevent_req *subreq)
"Switching back to BE_REQ_INITGROUPS.\n");
ar->entry_type = BE_REQ_INITGROUPS;
ar->filter_type = BE_FILTER_SECID;
- ar->attr_type = BE_ATTR_CORE;
}
} else {
DEBUG(SSSDBG_CRIT_FAILURE,
diff --git a/src/providers/ldap/ldap_id.c b/src/providers/ldap/ldap_id.c
index 54120bbda..70300e659 100644
--- a/src/providers/ldap/ldap_id.c
+++ b/src/providers/ldap/ldap_id.c
@@ -1439,11 +1439,6 @@ sdap_handle_acct_req_send(TALLOC_CTX *mem_ctx,
state->err = "Invalid filter type";
goto done;
}
- if (ar->attr_type != BE_ATTR_CORE) {
- ret = EINVAL;
- state->err = "Invalid attr type";
- goto done;
- }
subreq = groups_by_user_send(state, be_ctx->ev, id_ctx,
sdom, conn,
diff --git a/src/providers/ldap/sdap_refresh.c b/src/providers/ldap/sdap_refresh.c
index 59619b158..6d6c43e20 100644
--- a/src/providers/ldap/sdap_refresh.c
+++ b/src/providers/ldap/sdap_refresh.c
@@ -95,7 +95,6 @@ static struct tevent_req *sdap_refresh_send(TALLOC_CTX *mem_ctx,
}
state->account_req->entry_type = entry_type;
- state->account_req->attr_type = BE_ATTR_CORE;
state->account_req->filter_type = BE_FILTER_NAME;
state->account_req->extra_value = NULL;
state->account_req->domain = domain->name;
diff --git a/src/providers/proxy/proxy_id.c b/src/providers/proxy/proxy_id.c
index 48f552925..3d272897b 100644
--- a/src/providers/proxy/proxy_id.c
+++ b/src/providers/proxy/proxy_id.c
@@ -1446,12 +1446,6 @@ proxy_account_info(TALLOC_CTX *mem_ctx,
sysdb = domain->sysdb;
- /* For now we support only core attrs. */
- if (data->attr_type != BE_ATTR_CORE) {
- dp_reply_std_set(&reply, DP_ERR_FATAL, EINVAL, "Invalid attr type");
- return reply;
- }
-
/* Proxy provider does not support security ID lookups. */
if (data->filter_type == BE_FILTER_SECID) {
dp_reply_std_set(&reply, DP_ERR_FATAL, ENOSYS,
diff --git a/src/providers/simple/simple_access_check.c b/src/providers/simple/simple_access_check.c
index 227a9c620..f894f614d 100644
--- a/src/providers/simple/simple_access_check.c
+++ b/src/providers/simple/simple_access_check.c
@@ -259,7 +259,6 @@ simple_resolve_group_send(TALLOC_CTX *mem_ctx,
}
ar->entry_type = BE_REQ_GROUP;
- ar->attr_type = BE_ATTR_CORE;
ar->filter_type = BE_FILTER_IDNUM;
ar->filter_value = talloc_asprintf(ar, "%llu", (unsigned long long) gid);
ar->domain = talloc_strdup(ar, state->domain->name);
diff --git a/src/responder/common/responder_dp.c b/src/responder/common/responder_dp.c
index 86051a10e..da6767667 100644
--- a/src/responder/common/responder_dp.c
+++ b/src/responder/common/responder_dp.c
@@ -551,7 +551,6 @@ sss_dp_get_account_msg(void *pvt)
struct sss_dp_account_info *info;
uint32_t dp_flags;
uint32_t entry_type;
- uint32_t attrs_type = BE_ATTR_CORE;
char *filter;
info = talloc_get_type(pvt, struct sss_dp_account_info);
@@ -623,8 +622,8 @@ sss_dp_get_account_msg(void *pvt)
/* create the message */
DEBUG(SSSDBG_TRACE_FUNC,
- "Creating request for [%s][%#x][%s][%d][%s:%s]\n",
- info->dom->name, entry_type, be_req2str(entry_type), attrs_type,
+ "Creating request for [%s][%#x][%s][%s:%s]\n",
+ info->dom->name, entry_type, be_req2str(entry_type),
filter, info->extra == NULL ? "-" : info->extra);
if (info->extra == NULL) {
@@ -635,7 +634,6 @@ sss_dp_get_account_msg(void *pvt)
dbret = dbus_message_append_args(msg,
DBUS_TYPE_UINT32, &dp_flags,
DBUS_TYPE_UINT32, &entry_type,
- DBUS_TYPE_UINT32, &attrs_type,
DBUS_TYPE_STRING, &filter,
DBUS_TYPE_STRING, &info->dom->name,
DBUS_TYPE_STRING, &info->extra,