diff options
author | Pavel Březina <pbrezina@redhat.com> | 2016-02-09 12:57:59 +0100 |
---|---|---|
committer | Lukas Slebodnik <lslebodn@redhat.com> | 2016-04-19 13:16:32 +0200 |
commit | b3ca35780617b2e5a7637f9888b089e8e26a4e8c (patch) | |
tree | 604cc283191e6ab41720056ffe3c9d34e81e26a9 /src/responder/sudo/sudosrv_private.h | |
parent | 15d41c8f28259061e39715acdbbbaea778b6ecc8 (diff) | |
download | sssd-b3ca35780617b2e5a7637f9888b089e8e26a4e8c.tar.gz sssd-b3ca35780617b2e5a7637f9888b089e8e26a4e8c.tar.xz sssd-b3ca35780617b2e5a7637f9888b089e8e26a4e8c.zip |
sudo: convert get_sudorules to tevent
There was a lot of confusion with different error codes
and where to call sudosrv_cmd_done to finish the client
request. Converting it whole to tevent makes it much
more simpler to read and follow the request logic.
Reviewed-by: Jakub Hrozek <jhrozek@redhat.com>
Reviewed-by: Lukáš Slebodník <lslebodn@redhat.com>
Diffstat (limited to 'src/responder/sudo/sudosrv_private.h')
-rw-r--r-- | src/responder/sudo/sudosrv_private.h | 20 |
1 files changed, 11 insertions, 9 deletions
diff --git a/src/responder/sudo/sudosrv_private.h b/src/responder/sudo/sudosrv_private.h index 38de16960..99eef03e9 100644 --- a/src/responder/sudo/sudosrv_private.h +++ b/src/responder/sudo/sudosrv_private.h @@ -61,10 +61,6 @@ struct sudo_cmd_ctx { /* input data */ uid_t uid; char *rawname; - char *username; - struct sss_domain_info *domain; - - uint32_t expired_rules_num; /* output data */ struct sysdb_attrs **rules; @@ -73,11 +69,17 @@ struct sudo_cmd_ctx { struct sss_cmd_table *get_sudo_cmds(void); -errno_t sudosrv_cmd_done(struct sudo_cmd_ctx *cmd_ctx, int ret); - -errno_t sudosrv_get_sudorules(struct sudo_cmd_ctx *cmd_ctx); - -errno_t sudosrv_get_rules(struct sudo_cmd_ctx *cmd_ctx); +struct tevent_req *sudosrv_get_rules_send(TALLOC_CTX *mem_ctx, + struct tevent_context *ev, + struct sudo_ctx *sudo_ctx, + enum sss_sudo_type type, + uid_t uid, + const char *username); + +errno_t sudosrv_get_rules_recv(TALLOC_CTX *mem_ctx, + struct tevent_req *req, + struct sysdb_attrs ***_rules, + uint32_t *_num_rules); errno_t sudosrv_parse_query(TALLOC_CTX *mem_ctx, uint8_t *query_body, |