diff --git a/src/tools/common/sss_tools.c b/src/tools/common/sss_tools.c index 9e90f6186d0..03a93c2505c 100644 --- a/src/tools/common/sss_tools.c +++ b/src/tools/common/sss_tools.c @@ -307,8 +307,7 @@ static int tool_cmd_init(struct sss_tool_ctx *tool_ctx, static errno_t sss_tool_route(int argc, const char **argv, struct sss_tool_ctx *tool_ctx, - struct sss_route_cmd *commands, - void *pvt) + struct sss_route_cmd *commands) { struct sss_cmdline cmdline; const char *cmd; @@ -347,7 +346,7 @@ static errno_t sss_tool_route(int argc, const char **argv, } } - return commands[i].fn(&cmdline, tool_ctx, pvt); + return commands[i].fn(&cmdline, tool_ctx); } } @@ -527,8 +526,7 @@ errno_t sss_tool_popt(struct sss_cmdline *cmdline, } int sss_tool_main(int argc, const char **argv, - struct sss_route_cmd *commands, - void *pvt) + struct sss_route_cmd *commands) { struct sss_tool_ctx *tool_ctx; errno_t ret; @@ -539,7 +537,7 @@ int sss_tool_main(int argc, const char **argv, return EXIT_FAILURE; } - ret = sss_tool_route(argc, argv, tool_ctx, commands, pvt); + ret = sss_tool_route(argc, argv, tool_ctx, commands); SYSDB_VERSION_ERROR(ret); talloc_free(tool_ctx); if (ret != EOK) { diff --git a/src/tools/common/sss_tools.h b/src/tools/common/sss_tools.h index da3edd8b2ad..22f9764c894 100644 --- a/src/tools/common/sss_tools.h +++ b/src/tools/common/sss_tools.h @@ -43,8 +43,7 @@ struct sss_cmdline { typedef errno_t (*sss_route_fn)(struct sss_cmdline *cmdline, - struct sss_tool_ctx *tool_ctx, - void *pvt); + struct sss_tool_ctx *tool_ctx); #define SSS_TOOL_COMMAND_FLAGS(cmd, msg, fn, flags) \ {cmd, _(msg), fn, flags} @@ -90,8 +89,7 @@ errno_t sss_tool_popt(struct sss_cmdline *cmdline, void *popt_fn_pvt); int sss_tool_main(int argc, const char **argv, - struct sss_route_cmd *commands, - void *pvt); + struct sss_route_cmd *commands); errno_t sss_tool_parse_name(TALLOC_CTX *mem_ctx, struct sss_tool_ctx *tool_ctx, diff --git a/src/tools/sss_override.c b/src/tools/sss_override.c index c89a16f0156..e4bad848ee9 100644 --- a/src/tools/sss_override.c +++ b/src/tools/sss_override.c @@ -1410,8 +1410,7 @@ static errno_t group_export(const char *filename, } static int override_user_add(struct sss_cmdline *cmdline, - struct sss_tool_ctx *tool_ctx, - void *pvt) + struct sss_tool_ctx *tool_ctx) { struct override_user user = {NULL}; errno_t ret; @@ -1441,8 +1440,7 @@ static int override_user_add(struct sss_cmdline *cmdline, } static int override_user_del(struct sss_cmdline *cmdline, - struct sss_tool_ctx *tool_ctx, - void *pvt) + struct sss_tool_ctx *tool_ctx) { struct override_user user = {NULL}; errno_t ret; @@ -1473,8 +1471,7 @@ static int override_user_del(struct sss_cmdline *cmdline, } static int override_user_find(struct sss_cmdline *cmdline, - struct sss_tool_ctx *tool_ctx, - void *pvt) + struct sss_tool_ctx *tool_ctx) { struct sss_domain_info *dom; bool iterate; @@ -1503,8 +1500,7 @@ static int override_user_find(struct sss_cmdline *cmdline, } static int override_user_show(struct sss_cmdline *cmdline, - struct sss_tool_ctx *tool_ctx, - void *pvt) + struct sss_tool_ctx *tool_ctx) { TALLOC_CTX *tmp_ctx; struct override_user input = {NULL}; @@ -1574,8 +1570,7 @@ static int override_user_show(struct sss_cmdline *cmdline, } static int override_user_import(struct sss_cmdline *cmdline, - struct sss_tool_ctx *tool_ctx, - void *pvt) + struct sss_tool_ctx *tool_ctx) { TALLOC_CTX *tmp_ctx; struct sss_colondb *db; @@ -1657,8 +1652,7 @@ static int override_user_import(struct sss_cmdline *cmdline, } static int override_user_export(struct sss_cmdline *cmdline, - struct sss_tool_ctx *tool_ctx, - void *pvt) + struct sss_tool_ctx *tool_ctx) { const char *filename = NULL; errno_t ret; @@ -1684,8 +1678,7 @@ static int override_user_export(struct sss_cmdline *cmdline, } static int override_group_add(struct sss_cmdline *cmdline, - struct sss_tool_ctx *tool_ctx, - void *pvt) + struct sss_tool_ctx *tool_ctx) { struct override_group group = {NULL}; errno_t ret; @@ -1715,8 +1708,7 @@ static int override_group_add(struct sss_cmdline *cmdline, } static int override_group_del(struct sss_cmdline *cmdline, - struct sss_tool_ctx *tool_ctx, - void *pvt) + struct sss_tool_ctx *tool_ctx) { struct override_group group = {NULL}; errno_t ret; @@ -1748,8 +1740,7 @@ static int override_group_del(struct sss_cmdline *cmdline, } static int override_group_find(struct sss_cmdline *cmdline, - struct sss_tool_ctx *tool_ctx, - void *pvt) + struct sss_tool_ctx *tool_ctx) { struct sss_domain_info *dom; bool iterate; @@ -1778,8 +1769,7 @@ static int override_group_find(struct sss_cmdline *cmdline, } static int override_group_show(struct sss_cmdline *cmdline, - struct sss_tool_ctx *tool_ctx, - void *pvt) + struct sss_tool_ctx *tool_ctx) { TALLOC_CTX *tmp_ctx; struct override_group input = {NULL}; @@ -1849,8 +1839,7 @@ static int override_group_show(struct sss_cmdline *cmdline, } static int override_group_import(struct sss_cmdline *cmdline, - struct sss_tool_ctx *tool_ctx, - void *pvt) + struct sss_tool_ctx *tool_ctx) { TALLOC_CTX *tmp_ctx; struct sss_colondb *db; @@ -1927,8 +1916,7 @@ static int override_group_import(struct sss_cmdline *cmdline, } static int override_group_export(struct sss_cmdline *cmdline, - struct sss_tool_ctx *tool_ctx, - void *pvt) + struct sss_tool_ctx *tool_ctx) { const char *filename = NULL; errno_t ret; @@ -1971,5 +1959,5 @@ int main(int argc, const char **argv) SSS_TOOL_LAST }; - return sss_tool_main(argc, argv, commands, NULL); + return sss_tool_main(argc, argv, commands); } diff --git a/src/tools/sssctl/sssctl.c b/src/tools/sssctl/sssctl.c index 447402f66a1..52532c9b8ff 100644 --- a/src/tools/sssctl/sssctl.c +++ b/src/tools/sssctl/sssctl.c @@ -357,5 +357,5 @@ int main(int argc, const char **argv) SSS_TOOL_LAST }; - return sss_tool_main(argc, argv, commands, NULL); + return sss_tool_main(argc, argv, commands); } diff --git a/src/tools/sssctl/sssctl.h b/src/tools/sssctl/sssctl.h index 605acff605e..12763e5f57f 100644 --- a/src/tools/sssctl/sssctl.h +++ b/src/tools/sssctl/sssctl.h @@ -60,104 +60,79 @@ errno_t sssctl_systemd_stop(void); errno_t sssctl_systemd_restart(void); errno_t sssctl_domain_list(struct sss_cmdline *cmdline, - struct sss_tool_ctx *tool_ctx, - void *pvt); + struct sss_tool_ctx *tool_ctx); errno_t sssctl_domain_status(struct sss_cmdline *cmdline, - struct sss_tool_ctx *tool_ctx, - void *pvt); + struct sss_tool_ctx *tool_ctx); errno_t sssctl_client_data_backup(struct sss_cmdline *cmdline, - struct sss_tool_ctx *tool_ctx, - void *pvt); + struct sss_tool_ctx *tool_ctx); errno_t sssctl_client_data_restore(struct sss_cmdline *cmdline, - struct sss_tool_ctx *tool_ctx, - void *pvt); + struct sss_tool_ctx *tool_ctx); errno_t sssctl_cache_remove(struct sss_cmdline *cmdline, - struct sss_tool_ctx *tool_ctx, - void *pvt); + struct sss_tool_ctx *tool_ctx); errno_t sssctl_cache_expire(struct sss_cmdline *cmdline, - struct sss_tool_ctx *tool_ctx, - void *pvt); + struct sss_tool_ctx *tool_ctx); errno_t sssctl_cache_index(struct sss_cmdline *cmdline, - struct sss_tool_ctx *tool_ctx, - void *pvt); + struct sss_tool_ctx *tool_ctx); errno_t sssctl_logs_remove(struct sss_cmdline *cmdline, - struct sss_tool_ctx *tool_ctx, - void *pvt); + struct sss_tool_ctx *tool_ctx); errno_t sssctl_logs_fetch(struct sss_cmdline *cmdline, - struct sss_tool_ctx *tool_ctx, - void *pvt); + struct sss_tool_ctx *tool_ctx); errno_t sssctl_debug_level(struct sss_cmdline *cmdline, - struct sss_tool_ctx *tool_ctx, - void *pvt); + struct sss_tool_ctx *tool_ctx); errno_t sssctl_analyze(struct sss_cmdline *cmdline, - struct sss_tool_ctx *tool_ctx, - void *pvt); + struct sss_tool_ctx *tool_ctx); errno_t sssctl_user_show(struct sss_cmdline *cmdline, - struct sss_tool_ctx *tool_ctx, - void *pvt); + struct sss_tool_ctx *tool_ctx); errno_t sssctl_group_show(struct sss_cmdline *cmdline, - struct sss_tool_ctx *tool_ctx, - void *pvt); + struct sss_tool_ctx *tool_ctx); errno_t sssctl_netgroup_show(struct sss_cmdline *cmdline, - struct sss_tool_ctx *tool_ctx, - void *pvt); + struct sss_tool_ctx *tool_ctx); errno_t sssctl_config_check(struct sss_cmdline *cmdline, - struct sss_tool_ctx *tool_ctx, - void *pvt); + struct sss_tool_ctx *tool_ctx); errno_t sssctl_user_checks(struct sss_cmdline *cmdline, - struct sss_tool_ctx *tool_ctx, - void *pvt); + struct sss_tool_ctx *tool_ctx); errno_t sssctl_access_report(struct sss_cmdline *cmdline, - struct sss_tool_ctx *tool_ctx, - void *pvt); + struct sss_tool_ctx *tool_ctx); errno_t sssctl_cert_show(struct sss_cmdline *cmdline, - struct sss_tool_ctx *tool_ctx, - void *pvt); + struct sss_tool_ctx *tool_ctx); errno_t sssctl_cert_map(struct sss_cmdline *cmdline, - struct sss_tool_ctx *tool_ctx, - void *pvt); + struct sss_tool_ctx *tool_ctx); #ifdef BUILD_PASSKEY errno_t sssctl_passkey_register(struct sss_cmdline *cmdline, - struct sss_tool_ctx *tool_ctx, - void *pvt); + struct sss_tool_ctx *tool_ctx); #endif /* BUILD_PASSKEY */ errno_t sssctl_cert_eval_rule(struct sss_cmdline *cmdline, - struct sss_tool_ctx *tool_ctx, - void *pvt); + struct sss_tool_ctx *tool_ctx); errno_t sssctl_gpo_show(struct sss_cmdline *cmdline, - struct sss_tool_ctx *tool_ctx, - void *pvt); + struct sss_tool_ctx *tool_ctx); errno_t sssctl_gpo_list(struct sss_cmdline *cmdline, - struct sss_tool_ctx *tool_ctx, - void *pvt); + struct sss_tool_ctx *tool_ctx); errno_t sssctl_gpo_remove(struct sss_cmdline *cmdline, - struct sss_tool_ctx *tool_ctx, - void *pvt); + struct sss_tool_ctx *tool_ctx); errno_t sssctl_gpo_purge(struct sss_cmdline *cmdline, - struct sss_tool_ctx *tool_ctx, - void *pvt); + struct sss_tool_ctx *tool_ctx); #endif /* _SSSCTL_H_ */ diff --git a/src/tools/sssctl/sssctl_access_report.c b/src/tools/sssctl/sssctl_access_report.c index ddcb054179a..bcc9d29b2d0 100644 --- a/src/tools/sssctl/sssctl_access_report.c +++ b/src/tools/sssctl/sssctl_access_report.c @@ -383,8 +383,7 @@ sssctl_dom_access_reporter_fn get_report_fn(const char *provider) } errno_t sssctl_access_report(struct sss_cmdline *cmdline, - struct sss_tool_ctx *tool_ctx, - void *pvt) + struct sss_tool_ctx *tool_ctx) { errno_t ret; const char *domname = NULL; diff --git a/src/tools/sssctl/sssctl_cache.c b/src/tools/sssctl/sssctl_cache.c index 77454217e2e..5c8c4fbd31b 100644 --- a/src/tools/sssctl/sssctl_cache.c +++ b/src/tools/sssctl/sssctl_cache.c @@ -641,8 +641,7 @@ struct sssctl_cache_opts { }; errno_t sssctl_user_show(struct sss_cmdline *cmdline, - struct sss_tool_ctx *tool_ctx, - void *pvt) + struct sss_tool_ctx *tool_ctx) { struct sssctl_cache_opts opts = {0}; const char *attr; @@ -689,8 +688,7 @@ errno_t sssctl_user_show(struct sss_cmdline *cmdline, } errno_t sssctl_group_show(struct sss_cmdline *cmdline, - struct sss_tool_ctx *tool_ctx, - void *pvt) + struct sss_tool_ctx *tool_ctx) { struct sssctl_cache_opts opts = {0}; const char *attr; @@ -736,8 +734,7 @@ errno_t sssctl_group_show(struct sss_cmdline *cmdline, } errno_t sssctl_netgroup_show(struct sss_cmdline *cmdline, - struct sss_tool_ctx *tool_ctx, - void *pvt) + struct sss_tool_ctx *tool_ctx) { struct sssctl_cache_opts opts = {0}; errno_t ret; @@ -767,8 +764,7 @@ errno_t sssctl_netgroup_show(struct sss_cmdline *cmdline, } errno_t sssctl_gpo_show(struct sss_cmdline *cmdline, - struct sss_tool_ctx *tool_ctx, - void *pvt) + struct sss_tool_ctx *tool_ctx) { struct sssctl_cache_opts opts = {0}; const char *attr; @@ -953,8 +949,7 @@ static errno_t sssctl_gpo_print(struct sss_domain_info *dom, } errno_t sssctl_gpo_list(struct sss_cmdline *cmdline, - struct sss_tool_ctx *tool_ctx, - void *pvt) + struct sss_tool_ctx *tool_ctx) { TALLOC_CTX *tmp_ctx = NULL; const char *domain_prompt = NULL; @@ -1121,8 +1116,7 @@ static errno_t sssctl_gpo_remove_entry(TALLOC_CTX *mem_ctx, } errno_t sssctl_gpo_remove(struct sss_cmdline *cmdline, - struct sss_tool_ctx *tool_ctx, - void *pvt) + struct sss_tool_ctx *tool_ctx) { TALLOC_CTX *tmp_ctx = NULL; struct sssctl_cache_opts opts = {0}; @@ -1233,8 +1227,7 @@ static errno_t sssctl_gpo_traverse_remove(struct sss_domain_info *dom, } errno_t sssctl_gpo_purge(struct sss_cmdline *cmdline, - struct sss_tool_ctx *tool_ctx, - void *pvt) + struct sss_tool_ctx *tool_ctx) { TALLOC_CTX *tmp_ctx = NULL; const char *domain_prompt = NULL; diff --git a/src/tools/sssctl/sssctl_cert.c b/src/tools/sssctl/sssctl_cert.c index 36385ac00df..415c2b72d8f 100644 --- a/src/tools/sssctl/sssctl_cert.c +++ b/src/tools/sssctl/sssctl_cert.c @@ -35,8 +35,7 @@ #define PEM_FOOT "-----END CERTIFICATE-----" errno_t sssctl_cert_show(struct sss_cmdline *cmdline, - struct sss_tool_ctx *tool_ctx, - void *pvt) + struct sss_tool_ctx *tool_ctx) { TALLOC_CTX *tmp_ctx = NULL; errno_t ret; @@ -92,8 +91,7 @@ errno_t sssctl_cert_show(struct sss_cmdline *cmdline, } errno_t sssctl_cert_map(struct sss_cmdline *cmdline, - struct sss_tool_ctx *tool_ctx, - void *pvt) + struct sss_tool_ctx *tool_ctx) { TALLOC_CTX *tmp_ctx = NULL; errno_t ret; @@ -194,8 +192,7 @@ void certmap_ext_debug(void *private, const char *file, long line, } errno_t sssctl_cert_eval_rule(struct sss_cmdline *cmdline, - struct sss_tool_ctx *tool_ctx, - void *pvt) + struct sss_tool_ctx *tool_ctx) { TALLOC_CTX *tmp_ctx = NULL; errno_t ret; diff --git a/src/tools/sssctl/sssctl_config.c b/src/tools/sssctl/sssctl_config.c index 101483e0902..9245de2362d 100644 --- a/src/tools/sssctl/sssctl_config.c +++ b/src/tools/sssctl/sssctl_config.c @@ -56,8 +56,7 @@ static char *sssctl_config_snippet_path(TALLOC_CTX *ctx, const char *path) } errno_t sssctl_config_check(struct sss_cmdline *cmdline, - struct sss_tool_ctx *tool_ctx, - void *pvt) + struct sss_tool_ctx *tool_ctx) { errno_t ret; struct sss_ini *init_data; diff --git a/src/tools/sssctl/sssctl_data.c b/src/tools/sssctl/sssctl_data.c index 43b9814eaf0..8682711c802 100644 --- a/src/tools/sssctl/sssctl_data.c +++ b/src/tools/sssctl/sssctl_data.c @@ -125,8 +125,7 @@ static errno_t sssctl_backup(bool force) } errno_t sssctl_client_data_backup(struct sss_cmdline *cmdline, - struct sss_tool_ctx *, - void *pvt) + struct sss_tool_ctx *) { struct sssctl_data_opts opts = {0}; errno_t ret; @@ -185,8 +184,7 @@ static errno_t sssctl_restore(bool force_start, bool force_restart) } errno_t sssctl_client_data_restore(struct sss_cmdline *cmdline, - struct sss_tool_ctx *, - void *pvt) + struct sss_tool_ctx *) { struct sssctl_data_opts opts = {0}; errno_t ret; @@ -208,8 +206,7 @@ errno_t sssctl_client_data_restore(struct sss_cmdline *cmdline, } errno_t sssctl_cache_remove(struct sss_cmdline *cmdline, - struct sss_tool_ctx *, - void *pvt) + struct sss_tool_ctx *) { struct sssctl_data_opts opts = {0}; errno_t ret; @@ -260,8 +257,7 @@ errno_t sssctl_cache_remove(struct sss_cmdline *cmdline, } errno_t sssctl_cache_expire(struct sss_cmdline *cmdline, - struct sss_tool_ctx *tool_ctx, - void *pvt) + struct sss_tool_ctx *tool_ctx) { errno_t ret; @@ -417,8 +413,7 @@ static errno_t sssctl_cache_index_action(enum sysdb_index_actions action, } errno_t sssctl_cache_index(struct sss_cmdline *cmdline, - struct sss_tool_ctx *tool_ctx, - void *pvt) + struct sss_tool_ctx *tool_ctx) { const char *attr = NULL; const char *action_str = NULL; diff --git a/src/tools/sssctl/sssctl_domains.c b/src/tools/sssctl/sssctl_domains.c index 448e4d8adee..16fa2fa79ea 100644 --- a/src/tools/sssctl/sssctl_domains.c +++ b/src/tools/sssctl/sssctl_domains.c @@ -64,8 +64,7 @@ sssctl_domain_list_get_properties(TALLOC_CTX *mem_ctx, } errno_t sssctl_domain_list(struct sss_cmdline *cmdline, - struct sss_tool_ctx *tool_ctx, - void *pvt) + struct sss_tool_ctx *tool_ctx) { TALLOC_CTX *tmp_ctx; struct sbus_sync_connection *conn; @@ -310,8 +309,7 @@ struct sssctl_domain_status_opts { }; errno_t sssctl_domain_status(struct sss_cmdline *cmdline, - struct sss_tool_ctx *tool_ctx, - void *pvt) + struct sss_tool_ctx *tool_ctx) { TALLOC_CTX *tmp_ctx = NULL; struct sssctl_domain_status_opts opts = {0}; diff --git a/src/tools/sssctl/sssctl_logs.c b/src/tools/sssctl/sssctl_logs.c index 54840ed3910..c0c1a440eda 100644 --- a/src/tools/sssctl/sssctl_logs.c +++ b/src/tools/sssctl/sssctl_logs.c @@ -418,8 +418,7 @@ int parse_debug_level(const char *strlevel) } errno_t sssctl_logs_remove(struct sss_cmdline *cmdline, - struct sss_tool_ctx *, - void *pvt) + struct sss_tool_ctx *) { struct sssctl_logs_opts opts = {0}; errno_t ret; @@ -471,8 +470,7 @@ errno_t sssctl_logs_remove(struct sss_cmdline *cmdline, } errno_t sssctl_logs_fetch(struct sss_cmdline *cmdline, - struct sss_tool_ctx *, - void *pvt) + struct sss_tool_ctx *) { const char *file = NULL; errno_t ret; @@ -512,8 +510,7 @@ errno_t sssctl_logs_fetch(struct sss_cmdline *cmdline, } errno_t sssctl_debug_level(struct sss_cmdline *cmdline, - struct sss_tool_ctx *tool_ctx, - void *pvt) + struct sss_tool_ctx *tool_ctx) { int ret; int pc_services = 0; @@ -590,8 +587,7 @@ errno_t sssctl_debug_level(struct sss_cmdline *cmdline, } errno_t sssctl_analyze(struct sss_cmdline *cmdline, - struct sss_tool_ctx *, - void *) + struct sss_tool_ctx *) { #ifndef BUILD_CHAIN_ID PRINT("ERROR: Tevent chain ID support missing, log analyzer is unsupported.\n"); diff --git a/src/tools/sssctl/sssctl_passkey.c b/src/tools/sssctl/sssctl_passkey.c index 34482cc99b7..70e877e12b0 100644 --- a/src/tools/sssctl/sssctl_passkey.c +++ b/src/tools/sssctl/sssctl_passkey.c @@ -31,8 +31,7 @@ #define SSS_PASSKEY_CHILD SSSD_LIBEXEC_PATH"/passkey_child" errno_t sssctl_passkey_register(struct sss_cmdline *cmdline, - struct sss_tool_ctx *, - void *) + struct sss_tool_ctx *) { errno_t ret; diff --git a/src/tools/sssctl/sssctl_user_checks.c b/src/tools/sssctl/sssctl_user_checks.c index d233a148d13..84329c02b87 100644 --- a/src/tools/sssctl/sssctl_user_checks.c +++ b/src/tools/sssctl/sssctl_user_checks.c @@ -216,8 +216,7 @@ static int sss_getpwnam_check(const char *user) } errno_t sssctl_user_checks(struct sss_cmdline *cmdline, - struct sss_tool_ctx *tool_ctx, - void *pvt) + struct sss_tool_ctx *tool_ctx) { pam_handle_t *pamh;