39 #include "clientpipe.h" 49 static const char *module_str =
"update_repositorylist_cmd";
53 validate_configfile(
const char* cfgfile)
55 char *kasp = NULL, *zonelist = NULL, **replist = NULL;
57 int cc_status =
check_conf(cfgfile, &kasp, &zonelist, &replist,
61 if (replist)
for (i = 0; i < repcount; i++) free(replist[i]);
73 perform_update_repositorylist(
int sockfd,
engine_type* engine)
75 const char* cfgfile = ODS_SE_CFGFILE;
77 hsm_repository_t* new_reps;
79 if (validate_configfile(cfgfile)) {
80 ods_log_error_and_printf(sockfd, module_str,
81 "Unable to validate '%s' consistency.", cfgfile);
95 client_printf(sockfd,
"Could not load new repositories. Will continue with old.\n");
101 client_printf(sockfd,
"new repositories parsed successful.\n");
102 client_printf(sockfd,
"Notifying enforcer of new respositories.\n");
114 client_printf(sockfd,
115 "update repositorylist\n");
121 client_printf(sockfd,
122 "Import respositories from conf.xml into the enforcer.\n\n");
126 handles(
const char *cmd, ssize_t n)
135 (void)cmd; (void)n, (
void)dbconn;
139 if (!perform_update_repositorylist(sockfd, engine)) {
140 ods_log_error_and_printf(sockfd, module_str,
141 "unable to update repositorylist.");
int check_conf(const char *conf, char **kasp, char **zonelist, char ***repo_listout, int *repo_countout, int verbose)
void ods_log_debug(const char *format,...)
void engine_start_workers(engine_type *engine)
hsm_repository_t * parse_conf_repositories(const char *cfgfile)
int(* run)(int sockfd, struct engine_struct *engine, const char *cmd, ssize_t n, db_connection_t *dbconn)
pthread_cond_t signal_cond
void engine_stop_workers(engine_type *engine)
void(* usage)(int sockfd)
engineconfig_type * config
hsm_repository_t * repositories
struct cmd_func_block * update_repositorylist_funcblock(void)
pthread_mutex_t signal_lock
int(* handles)(const char *cmd, ssize_t n)