summaryrefslogtreecommitdiffstats
path: root/src/responder/sudo/sudosrv_private.h
diff options
context:
space:
mode:
authorPavel Březina <pbrezina@redhat.com>2012-01-24 13:42:59 +0100
committerStephen Gallagher <sgallagh@redhat.com>2012-02-04 08:27:16 -0500
commit41ef946f3f74a46b9e26118116e4811e259b30ef (patch)
treed88a5b7a94eaee2f2407c1ffa43ff3497d99c90b /src/responder/sudo/sudosrv_private.h
parentbd92e8ee315d4da9350b9ef0358c88a7b54aeebe (diff)
downloadsssd-41ef946f3f74a46b9e26118116e4811e259b30ef.tar.gz
sssd-41ef946f3f74a46b9e26118116e4811e259b30ef.tar.xz
sssd-41ef946f3f74a46b9e26118116e4811e259b30ef.zip
SUDO Integration - in-memory cache in responder
New sudo responder option: cache_timeout https://fedorahosted.org/sssd/ticket/1111
Diffstat (limited to 'src/responder/sudo/sudosrv_private.h')
-rw-r--r--src/responder/sudo/sudosrv_private.h33
1 files changed, 33 insertions, 0 deletions
diff --git a/src/responder/sudo/sudosrv_private.h b/src/responder/sudo/sudosrv_private.h
index b59aca4a3..c3feb19bf 100644
--- a/src/responder/sudo/sudosrv_private.h
+++ b/src/responder/sudo/sudosrv_private.h
@@ -38,10 +38,23 @@ enum sss_dp_sudo_type {
struct sudo_ctx {
struct resp_ctx *rctx;
+
+ /*
+ * options
+ */
+ int cache_timeout;
+
+ /*
+ * Key: domain for SSS_DP_SUDO_DEFAULTS
+ * domain:username for SSS_DP_SUDO_USER
+ * Val: struct sudo_cache_entry *
+ */
+ hash_table_t *cache;
};
struct sudo_cmd_ctx {
struct cli_ctx *cli_ctx;
+ struct sudo_ctx *sudo_ctx;
enum sss_dp_sudo_type type;
char *username;
bool check_next;
@@ -121,4 +134,24 @@ sss_dp_get_sudoers_recv(TALLOC_CTX *mem_ctx,
dbus_uint32_t *err_min,
char **err_msg);
+errno_t sudosrv_cache_init(TALLOC_CTX *mem_ctx,
+ unsigned long count,
+ hash_table_t **table);
+
+errno_t sudosrv_cache_lookup(hash_table_t *table,
+ struct sudo_dom_ctx *dctx,
+ bool check_next,
+ const char *username,
+ size_t *res_count,
+ struct sysdb_attrs ***res);
+
+errno_t sudosrv_cache_set_entry(struct tevent_context *ev,
+ struct sudo_ctx *sudo_ctx,
+ hash_table_t *table,
+ struct sss_domain_info *domain,
+ const char *username,
+ size_t res_count,
+ struct sysdb_attrs **res,
+ time_t timeout);
+
#endif /* _SUDOSRV_PRIVATE_H_ */