34#include "cmdhandler.h"
40#include "clientpipe.h"
50static const char *module_str =
"update_repositorylist_cmd";
54validate_configfile(
const char* cfgfile)
56 char *kasp = NULL, *zonelist = NULL, **replist = NULL;
58 int cc_status =
check_conf(cfgfile, &kasp, &zonelist, &replist,
62 if (replist)
for (i = 0; i < repcount; i++) free(replist[i]);
74perform_update_repositorylist(
int sockfd,
engine_type* engine)
76 const char* cfgfile = ODS_SE_CFGFILE;
78 hsm_repository_t* new_reps;
80 if (validate_configfile(cfgfile)) {
81 ods_log_error_and_printf(sockfd, module_str,
82 "Unable to validate '%s' consistency.", cfgfile);
96 client_printf(sockfd,
"Could not load new repositories. Will continue with old.\n");
102 client_printf(sockfd,
"new repositories parsed successful.\n");
103 client_printf(sockfd,
"Notifying enforcer of new repositories.\n");
115 client_printf(sockfd,
116 "update repositorylist\n");
122 client_printf(sockfd,
123 "Import repositories from conf.xml into the enforcer.\n\n");
127run(
int sockfd, cmdhandler_ctx_type* context,
const char *cmd)
131 ods_log_debug(
"[%s] %s command", module_str,
134 if (!perform_update_repositorylist(sockfd, engine)) {
135 ods_log_error_and_printf(sockfd, module_str,
136 "unable to update repositorylist.");
143 "update repositorylist", &usage, &help, NULL, &run
engine_type * getglobalcontext(cmdhandler_ctx_type *context)
void engine_start_workers(engine_type *engine)
void engine_stop_workers(engine_type *engine)
int check_conf(const char *conf, char **kasp, char **zonelist, char ***repo_listout, int *repo_countout, int verbose)
hsm_repository_t * parse_conf_repositories(const char *cfgfile)
pthread_mutex_t signal_lock
pthread_cond_t signal_cond
engineconfig_type * config
hsm_repository_t * repositories
struct cmd_func_block update_repositorylist_funcblock