summaryrefslogtreecommitdiffstats
path: root/src/responder/common
diff options
context:
space:
mode:
authorPavel Březina <pbrezina@redhat.com>2016-11-18 15:10:11 +0100
committerLukas Slebodnik <lslebodn@redhat.com>2016-12-19 23:24:12 +0100
commit8f895983e8d24b3edde4f695621f6b9a2fd20923 (patch)
tree1d2da880a761a5fcda60306c3d5cc218b5cb2f9a /src/responder/common
parent3be2628d8aba6aeb99ac1484da990f1fad8169ec (diff)
downloadsssd-8f895983e8d24b3edde4f695621f6b9a2fd20923.tar.gz
sssd-8f895983e8d24b3edde4f695621f6b9a2fd20923.tar.xz
sssd-8f895983e8d24b3edde4f695621f6b9a2fd20923.zip
cache_req: make plug-ins definition const
Resolves: https://fedorahosted.org/sssd/ticket/3151 Reviewed-by: Lukáš Slebodník <lslebodn@redhat.com>
Diffstat (limited to 'src/responder/common')
-rw-r--r--src/responder/common/cache_req/cache_req.c6
-rw-r--r--src/responder/common/cache_req/cache_req_plugin.h38
-rw-r--r--src/responder/common/cache_req/cache_req_private.h2
-rw-r--r--src/responder/common/cache_req/plugins/cache_req_enum_groups.c2
-rw-r--r--src/responder/common/cache_req/plugins/cache_req_enum_svc.c2
-rw-r--r--src/responder/common/cache_req/plugins/cache_req_enum_users.c2
-rw-r--r--src/responder/common/cache_req/plugins/cache_req_group_by_filter.c2
-rw-r--r--src/responder/common/cache_req/plugins/cache_req_group_by_id.c2
-rw-r--r--src/responder/common/cache_req/plugins/cache_req_group_by_name.c2
-rw-r--r--src/responder/common/cache_req/plugins/cache_req_initgroups_by_name.c2
-rw-r--r--src/responder/common/cache_req/plugins/cache_req_initgroups_by_upn.c2
-rw-r--r--src/responder/common/cache_req/plugins/cache_req_netgroup_by_name.c2
-rw-r--r--src/responder/common/cache_req/plugins/cache_req_object_by_id.c2
-rw-r--r--src/responder/common/cache_req/plugins/cache_req_object_by_name.c2
-rw-r--r--src/responder/common/cache_req/plugins/cache_req_object_by_sid.c2
-rw-r--r--src/responder/common/cache_req/plugins/cache_req_svc_by_name.c2
-rw-r--r--src/responder/common/cache_req/plugins/cache_req_svc_by_port.c2
-rw-r--r--src/responder/common/cache_req/plugins/cache_req_user_by_cert.c2
-rw-r--r--src/responder/common/cache_req/plugins/cache_req_user_by_filter.c2
-rw-r--r--src/responder/common/cache_req/plugins/cache_req_user_by_id.c2
-rw-r--r--src/responder/common/cache_req/plugins/cache_req_user_by_name.c2
-rw-r--r--src/responder/common/cache_req/plugins/cache_req_user_by_upn.c2
22 files changed, 42 insertions, 42 deletions
diff --git a/src/responder/common/cache_req/cache_req.c b/src/responder/common/cache_req/cache_req.c
index c34212eb5..4cc28c096 100644
--- a/src/responder/common/cache_req/cache_req.c
+++ b/src/responder/common/cache_req/cache_req.c
@@ -27,10 +27,10 @@
#include "responder/common/cache_req/cache_req_private.h"
#include "responder/common/cache_req/cache_req_plugin.h"
-static struct cache_req_plugin *
+static const struct cache_req_plugin *
cache_req_get_plugin(enum cache_req_type type)
{
- static struct cache_req_plugin *plugins[CACHE_REQ_SENTINEL] = {
+ static const struct cache_req_plugin *plugins[CACHE_REQ_SENTINEL] = {
&cache_req_user_by_name,
&cache_req_user_by_upn,
&cache_req_user_by_id,
@@ -69,7 +69,7 @@ cache_req_get_plugin(enum cache_req_type type)
static errno_t cache_req_set_plugin(struct cache_req *cr,
enum cache_req_type type)
{
- struct cache_req_plugin *plugin;
+ const struct cache_req_plugin *plugin;
plugin = cache_req_get_plugin(type);
if (plugin == NULL) {
diff --git a/src/responder/common/cache_req/cache_req_plugin.h b/src/responder/common/cache_req/cache_req_plugin.h
index fbfe9694c..e12d7edae 100644
--- a/src/responder/common/cache_req/cache_req_plugin.h
+++ b/src/responder/common/cache_req/cache_req_plugin.h
@@ -199,24 +199,24 @@ struct cache_req_plugin {
cache_req_dpreq_params_fn dpreq_params_fn;
};
-extern struct cache_req_plugin cache_req_user_by_name;
-extern struct cache_req_plugin cache_req_user_by_upn;
-extern struct cache_req_plugin cache_req_user_by_id;
-extern struct cache_req_plugin cache_req_group_by_name;
-extern struct cache_req_plugin cache_req_group_by_id;
-extern struct cache_req_plugin cache_req_initgroups_by_name;
-extern struct cache_req_plugin cache_req_initgroups_by_upn;
-extern struct cache_req_plugin cache_req_user_by_cert;
-extern struct cache_req_plugin cache_req_user_by_filter;
-extern struct cache_req_plugin cache_req_group_by_filter;
-extern struct cache_req_plugin cache_req_object_by_sid;
-extern struct cache_req_plugin cache_req_object_by_name;
-extern struct cache_req_plugin cache_req_object_by_id;
-extern struct cache_req_plugin cache_req_enum_users;
-extern struct cache_req_plugin cache_req_enum_groups;
-extern struct cache_req_plugin cache_req_enum_svc;
-extern struct cache_req_plugin cache_req_svc_by_name;
-extern struct cache_req_plugin cache_req_svc_by_port;
-extern struct cache_req_plugin cache_req_netgroup_by_name;
+extern const struct cache_req_plugin cache_req_user_by_name;
+extern const struct cache_req_plugin cache_req_user_by_upn;
+extern const struct cache_req_plugin cache_req_user_by_id;
+extern const struct cache_req_plugin cache_req_group_by_name;
+extern const struct cache_req_plugin cache_req_group_by_id;
+extern const struct cache_req_plugin cache_req_initgroups_by_name;
+extern const struct cache_req_plugin cache_req_initgroups_by_upn;
+extern const struct cache_req_plugin cache_req_user_by_cert;
+extern const struct cache_req_plugin cache_req_user_by_filter;
+extern const struct cache_req_plugin cache_req_group_by_filter;
+extern const struct cache_req_plugin cache_req_object_by_sid;
+extern const struct cache_req_plugin cache_req_object_by_name;
+extern const struct cache_req_plugin cache_req_object_by_id;
+extern const struct cache_req_plugin cache_req_enum_users;
+extern const struct cache_req_plugin cache_req_enum_groups;
+extern const struct cache_req_plugin cache_req_enum_svc;
+extern const struct cache_req_plugin cache_req_svc_by_name;
+extern const struct cache_req_plugin cache_req_svc_by_port;
+extern const struct cache_req_plugin cache_req_netgroup_by_name;
#endif /* _CACHE_REQ_PLUGIN_H_ */
diff --git a/src/responder/common/cache_req/cache_req_private.h b/src/responder/common/cache_req/cache_req_private.h
index 4019fe368..9a2ab66ad 100644
--- a/src/responder/common/cache_req/cache_req_private.h
+++ b/src/responder/common/cache_req/cache_req_private.h
@@ -34,7 +34,7 @@ struct cache_req {
/* Provided input. */
struct cache_req_data *data;
- struct cache_req_plugin *plugin;
+ const struct cache_req_plugin *plugin;
struct resp_ctx *rctx;
struct sss_nc_ctx *ncache;
int midpoint;
diff --git a/src/responder/common/cache_req/plugins/cache_req_enum_groups.c b/src/responder/common/cache_req/plugins/cache_req_enum_groups.c
index c36925615..5827d0cc9 100644
--- a/src/responder/common/cache_req/plugins/cache_req_enum_groups.c
+++ b/src/responder/common/cache_req/plugins/cache_req_enum_groups.c
@@ -59,7 +59,7 @@ cache_req_enum_groups_dpreq_params(TALLOC_CTX *mem_ctx,
return EOK;
}
-struct cache_req_plugin cache_req_enum_groups = {
+const struct cache_req_plugin cache_req_enum_groups = {
.name = "Enumerate groups",
.dp_type = SSS_DP_GROUP,
.attr_expiration = SYSDB_CACHE_EXPIRE,
diff --git a/src/responder/common/cache_req/plugins/cache_req_enum_svc.c b/src/responder/common/cache_req/plugins/cache_req_enum_svc.c
index d88a29259..c83564fdc 100644
--- a/src/responder/common/cache_req/plugins/cache_req_enum_svc.c
+++ b/src/responder/common/cache_req/plugins/cache_req_enum_svc.c
@@ -60,7 +60,7 @@ cache_req_enum_svc_dpreq_params(TALLOC_CTX *mem_ctx,
return EOK;
}
-struct cache_req_plugin cache_req_enum_svc = {
+const struct cache_req_plugin cache_req_enum_svc = {
.name = "Enumerate services",
.dp_type = SSS_DP_SERVICES,
.attr_expiration = SYSDB_CACHE_EXPIRE,
diff --git a/src/responder/common/cache_req/plugins/cache_req_enum_users.c b/src/responder/common/cache_req/plugins/cache_req_enum_users.c
index ed042f648..f26e88ef8 100644
--- a/src/responder/common/cache_req/plugins/cache_req_enum_users.c
+++ b/src/responder/common/cache_req/plugins/cache_req_enum_users.c
@@ -59,7 +59,7 @@ cache_req_enum_users_dpreq_params(TALLOC_CTX *mem_ctx,
return EOK;
}
-struct cache_req_plugin cache_req_enum_users = {
+const struct cache_req_plugin cache_req_enum_users = {
.name = "Enumerate users",
.dp_type = SSS_DP_USER,
.attr_expiration = SYSDB_CACHE_EXPIRE,
diff --git a/src/responder/common/cache_req/plugins/cache_req_group_by_filter.c b/src/responder/common/cache_req/plugins/cache_req_group_by_filter.c
index fc4549031..1619cf7bd 100644
--- a/src/responder/common/cache_req/plugins/cache_req_group_by_filter.c
+++ b/src/responder/common/cache_req/plugins/cache_req_group_by_filter.c
@@ -114,7 +114,7 @@ cache_req_group_by_filter_dpreq_params(TALLOC_CTX *mem_ctx,
return EOK;
}
-struct cache_req_plugin cache_req_group_by_filter = {
+const struct cache_req_plugin cache_req_group_by_filter = {
.name = "Group by filter",
.dp_type = SSS_DP_WILDCARD_GROUP,
.attr_expiration = SYSDB_CACHE_EXPIRE,
diff --git a/src/responder/common/cache_req/plugins/cache_req_group_by_id.c b/src/responder/common/cache_req/plugins/cache_req_group_by_id.c
index 7728330ae..0fb372bd3 100644
--- a/src/responder/common/cache_req/plugins/cache_req_group_by_id.c
+++ b/src/responder/common/cache_req/plugins/cache_req_group_by_id.c
@@ -102,7 +102,7 @@ cache_req_group_by_id_dpreq_params(TALLOC_CTX *mem_ctx,
return EOK;
}
-struct cache_req_plugin cache_req_group_by_id = {
+const struct cache_req_plugin cache_req_group_by_id = {
.name = "Group by ID",
.dp_type = SSS_DP_GROUP,
.attr_expiration = SYSDB_CACHE_EXPIRE,
diff --git a/src/responder/common/cache_req/plugins/cache_req_group_by_name.c b/src/responder/common/cache_req/plugins/cache_req_group_by_name.c
index b0d363fff..c88dbd456 100644
--- a/src/responder/common/cache_req/plugins/cache_req_group_by_name.c
+++ b/src/responder/common/cache_req/plugins/cache_req_group_by_name.c
@@ -152,7 +152,7 @@ cache_req_group_by_name_dpreq_params(TALLOC_CTX *mem_ctx,
return EOK;
}
-struct cache_req_plugin cache_req_group_by_name = {
+const struct cache_req_plugin cache_req_group_by_name = {
.name = "Group by name",
.dp_type = SSS_DP_GROUP,
.attr_expiration = SYSDB_CACHE_EXPIRE,
diff --git a/src/responder/common/cache_req/plugins/cache_req_initgroups_by_name.c b/src/responder/common/cache_req/plugins/cache_req_initgroups_by_name.c
index c1ba3f52a..9575ae707 100644
--- a/src/responder/common/cache_req/plugins/cache_req_initgroups_by_name.c
+++ b/src/responder/common/cache_req/plugins/cache_req_initgroups_by_name.c
@@ -167,7 +167,7 @@ cache_req_initgroups_by_name_dpreq_params(TALLOC_CTX *mem_ctx,
return EOK;
}
-struct cache_req_plugin cache_req_initgroups_by_name = {
+const struct cache_req_plugin cache_req_initgroups_by_name = {
.name = "Initgroups by name",
.dp_type = SSS_DP_INITGROUPS,
.attr_expiration = SYSDB_INITGR_EXPIRE,
diff --git a/src/responder/common/cache_req/plugins/cache_req_initgroups_by_upn.c b/src/responder/common/cache_req/plugins/cache_req_initgroups_by_upn.c
index d1c7987ad..7a0b96b19 100644
--- a/src/responder/common/cache_req/plugins/cache_req_initgroups_by_upn.c
+++ b/src/responder/common/cache_req/plugins/cache_req_initgroups_by_upn.c
@@ -103,7 +103,7 @@ cache_req_initgroups_by_upn_dpreq_params(TALLOC_CTX *mem_ctx,
return EOK;
}
-struct cache_req_plugin cache_req_initgroups_by_upn = {
+const struct cache_req_plugin cache_req_initgroups_by_upn = {
.name = "Initgroups by UPN",
.dp_type = SSS_DP_INITGROUPS,
.attr_expiration = SYSDB_INITGR_EXPIRE,
diff --git a/src/responder/common/cache_req/plugins/cache_req_netgroup_by_name.c b/src/responder/common/cache_req/plugins/cache_req_netgroup_by_name.c
index 07582e831..15549adef 100644
--- a/src/responder/common/cache_req/plugins/cache_req_netgroup_by_name.c
+++ b/src/responder/common/cache_req/plugins/cache_req_netgroup_by_name.c
@@ -111,7 +111,7 @@ cache_req_netgroup_by_name_dpreq_params(TALLOC_CTX *mem_ctx,
return EOK;
}
-struct cache_req_plugin cache_req_netgroup_by_name = {
+const struct cache_req_plugin cache_req_netgroup_by_name = {
.name = "Netgroup by name",
.dp_type = SSS_DP_NETGR,
.attr_expiration = SYSDB_CACHE_EXPIRE,
diff --git a/src/responder/common/cache_req/plugins/cache_req_object_by_id.c b/src/responder/common/cache_req/plugins/cache_req_object_by_id.c
index c059fde0b..68c439f33 100644
--- a/src/responder/common/cache_req/plugins/cache_req_object_by_id.c
+++ b/src/responder/common/cache_req/plugins/cache_req_object_by_id.c
@@ -94,7 +94,7 @@ cache_req_object_by_id_dpreq_params(TALLOC_CTX *mem_ctx,
return EOK;
}
-struct cache_req_plugin cache_req_object_by_id = {
+const struct cache_req_plugin cache_req_object_by_id = {
.name = "Object by ID",
.dp_type = SSS_DP_USER_AND_GROUP,
.attr_expiration = SYSDB_CACHE_EXPIRE,
diff --git a/src/responder/common/cache_req/plugins/cache_req_object_by_name.c b/src/responder/common/cache_req/plugins/cache_req_object_by_name.c
index 343b422c6..313d90bc0 100644
--- a/src/responder/common/cache_req/plugins/cache_req_object_by_name.c
+++ b/src/responder/common/cache_req/plugins/cache_req_object_by_name.c
@@ -187,7 +187,7 @@ cache_req_object_by_name_dpreq_params(TALLOC_CTX *mem_ctx,
return EOK;
}
-struct cache_req_plugin cache_req_object_by_name = {
+const struct cache_req_plugin cache_req_object_by_name = {
.name = "Object by name",
.dp_type = SSS_DP_USER_AND_GROUP,
.attr_expiration = SYSDB_CACHE_EXPIRE,
diff --git a/src/responder/common/cache_req/plugins/cache_req_object_by_sid.c b/src/responder/common/cache_req/plugins/cache_req_object_by_sid.c
index e40968bce..6cf10c908 100644
--- a/src/responder/common/cache_req/plugins/cache_req_object_by_sid.c
+++ b/src/responder/common/cache_req/plugins/cache_req_object_by_sid.c
@@ -104,7 +104,7 @@ cache_req_object_by_sid_dpreq_params(TALLOC_CTX *mem_ctx,
return EOK;
}
-struct cache_req_plugin cache_req_object_by_sid = {
+const struct cache_req_plugin cache_req_object_by_sid = {
.name = "Object by SID",
.dp_type = SSS_DP_SECID,
.attr_expiration = SYSDB_CACHE_EXPIRE,
diff --git a/src/responder/common/cache_req/plugins/cache_req_svc_by_name.c b/src/responder/common/cache_req/plugins/cache_req_svc_by_name.c
index 7a253eb82..4de27571c 100644
--- a/src/responder/common/cache_req/plugins/cache_req_svc_by_name.c
+++ b/src/responder/common/cache_req/plugins/cache_req_svc_by_name.c
@@ -135,7 +135,7 @@ cache_req_svc_by_name_dpreq_params(TALLOC_CTX *mem_ctx,
return EOK;
}
-struct cache_req_plugin cache_req_svc_by_name = {
+const struct cache_req_plugin cache_req_svc_by_name = {
.name = "Service by name",
.dp_type = SSS_DP_SERVICES,
.attr_expiration = SYSDB_CACHE_EXPIRE,
diff --git a/src/responder/common/cache_req/plugins/cache_req_svc_by_port.c b/src/responder/common/cache_req/plugins/cache_req_svc_by_port.c
index 9b9703ac6..1b17c7135 100644
--- a/src/responder/common/cache_req/plugins/cache_req_svc_by_port.c
+++ b/src/responder/common/cache_req/plugins/cache_req_svc_by_port.c
@@ -108,7 +108,7 @@ cache_req_svc_by_port_dpreq_params(TALLOC_CTX *mem_ctx,
return EOK;
}
-struct cache_req_plugin cache_req_svc_by_port = {
+const struct cache_req_plugin cache_req_svc_by_port = {
.name = "Service by port",
.dp_type = SSS_DP_SERVICES,
.attr_expiration = SYSDB_CACHE_EXPIRE,
diff --git a/src/responder/common/cache_req/plugins/cache_req_user_by_cert.c b/src/responder/common/cache_req/plugins/cache_req_user_by_cert.c
index 68728984d..9a1bcc6aa 100644
--- a/src/responder/common/cache_req/plugins/cache_req_user_by_cert.c
+++ b/src/responder/common/cache_req/plugins/cache_req_user_by_cert.c
@@ -78,7 +78,7 @@ cache_req_user_by_cert_dpreq_params(TALLOC_CTX *mem_ctx,
return EOK;
}
-struct cache_req_plugin cache_req_user_by_cert = {
+const struct cache_req_plugin cache_req_user_by_cert = {
.name = "User by certificate",
.dp_type = SSS_DP_CERT,
.attr_expiration = SYSDB_CACHE_EXPIRE,
diff --git a/src/responder/common/cache_req/plugins/cache_req_user_by_filter.c b/src/responder/common/cache_req/plugins/cache_req_user_by_filter.c
index ef01d71d5..ee9f60bf6 100644
--- a/src/responder/common/cache_req/plugins/cache_req_user_by_filter.c
+++ b/src/responder/common/cache_req/plugins/cache_req_user_by_filter.c
@@ -114,7 +114,7 @@ cache_req_user_by_filter_dpreq_params(TALLOC_CTX *mem_ctx,
return EOK;
}
-struct cache_req_plugin cache_req_user_by_filter = {
+const struct cache_req_plugin cache_req_user_by_filter = {
.name = "User by filter",
.dp_type = SSS_DP_WILDCARD_USER,
.attr_expiration = SYSDB_CACHE_EXPIRE,
diff --git a/src/responder/common/cache_req/plugins/cache_req_user_by_id.c b/src/responder/common/cache_req/plugins/cache_req_user_by_id.c
index f0629add5..a7e183760 100644
--- a/src/responder/common/cache_req/plugins/cache_req_user_by_id.c
+++ b/src/responder/common/cache_req/plugins/cache_req_user_by_id.c
@@ -102,7 +102,7 @@ cache_req_user_by_id_dpreq_params(TALLOC_CTX *mem_ctx,
return EOK;
}
-struct cache_req_plugin cache_req_user_by_id = {
+const struct cache_req_plugin cache_req_user_by_id = {
.name = "User by ID",
.dp_type = SSS_DP_USER,
.attr_expiration = SYSDB_CACHE_EXPIRE,
diff --git a/src/responder/common/cache_req/plugins/cache_req_user_by_name.c b/src/responder/common/cache_req/plugins/cache_req_user_by_name.c
index c799362da..46dd9434b 100644
--- a/src/responder/common/cache_req/plugins/cache_req_user_by_name.c
+++ b/src/responder/common/cache_req/plugins/cache_req_user_by_name.c
@@ -152,7 +152,7 @@ cache_req_user_by_name_dpreq_params(TALLOC_CTX *mem_ctx,
return EOK;
}
-struct cache_req_plugin cache_req_user_by_name = {
+const struct cache_req_plugin cache_req_user_by_name = {
.name = "User by name",
.dp_type = SSS_DP_USER,
.attr_expiration = SYSDB_CACHE_EXPIRE,
diff --git a/src/responder/common/cache_req/plugins/cache_req_user_by_upn.c b/src/responder/common/cache_req/plugins/cache_req_user_by_upn.c
index 63e9ad718..9d1e703d6 100644
--- a/src/responder/common/cache_req/plugins/cache_req_user_by_upn.c
+++ b/src/responder/common/cache_req/plugins/cache_req_user_by_upn.c
@@ -107,7 +107,7 @@ cache_req_user_by_upn_dpreq_params(TALLOC_CTX *mem_ctx,
return EOK;
}
-struct cache_req_plugin cache_req_user_by_upn = {
+const struct cache_req_plugin cache_req_user_by_upn = {
.name = "User by UPN",
.dp_type = SSS_DP_USER,
.attr_expiration = SYSDB_CACHE_EXPIRE,