43 static const char* conf_str =
"config";
54 const char* rngfile = ODS_SE_RNGDIR
"/conf.rng";
62 ods_log_error(
"[%s] unable to create config: parse error in %s",
67 cfgfd = ods_fopen(cfgfile, NULL,
"r");
69 ods_log_verbose(
"[%s] read cfgfile: %s", conf_str, cfgfile);
87 if (cmdline_verbosity > 0) {
99 ods_log_error(
"[%s] unable to create config: failed to open file %s",
113 ods_log_error(
"[%s] config-check failed: no config", conf_str);
114 return ODS_STATUS_CFG_ERR;
117 ods_log_error(
"[%s] config-check failed: no config filename",
119 return ODS_STATUS_CFG_ERR;
122 ods_log_error(
"[%s] config-check failed: no zonelist filename",
124 return ODS_STATUS_CFG_ERR;
127 ods_log_error(
"[%s] config-check failed: no socket filename",
129 return ODS_STATUS_CFG_ERR;
132 ods_log_error(
"[%s] config-check failed: no listener",
134 return ODS_STATUS_CFG_ERR;
137 return ODS_STATUS_OK;
151 fprintf(out,
"<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n");
153 fprintf(out,
"<Configuration>\n");
156 fprintf(out,
"\t<Common>\n");
158 fprintf(out,
"\t\t<Logging>\n");
159 fprintf(out,
"\t\t\t<Syslog>\n");
160 fprintf(out,
"\t\t\t\t<Facility>%s</Facility>\n",
162 fprintf(out,
"\t\t\t</Syslog>\n");
163 fprintf(out,
"\t\t</Logging>\n");
165 fprintf(out,
"\t\t<Logging>\n");
166 fprintf(out,
"\t\t\t<File>\n");
167 fprintf(out,
"\t\t\t\t<Filename>%s</Filename>\n",
169 fprintf(out,
"\t\t\t</File>\n");
170 fprintf(out,
"\t\t</Logging>\n");
172 fprintf(out,
"\t</Common>\n");
175 fprintf(out,
"\t<Enforcer>\n");
176 fprintf(out,
"\t\t<ZoneListFile>%s</ZoneListFile>\n",
178 fprintf(out,
"\t</Enforcer>\n");
181 fprintf(out,
"\t<Signer>\n");
183 fprintf(out,
"\t\t<Privileges>\n");
185 fprintf(out,
"\t\t<User>%s</User>\n", config->
username);
188 fprintf(out,
"\t\t<Group>%s</Group>\n", config->
group);
191 fprintf(out,
"\t\t<Directory>%s</Directory>\n",
194 fprintf(out,
"\t\t</Privileges>\n");
198 fprintf(out,
"\t\t<Listener>\n");
201 fprintf(out,
"\t\t\t<Interface>");
203 fprintf(out,
"<Address>%s</Address>",
207 fprintf(out,
"<Port>%s</Port>",
210 fprintf(out,
"<Interface>\n");
212 fprintf(out,
"\t\t</Listener>\n");
216 fprintf(out,
"\t\t<WorkingDirectory>%s</WorkingDirectory>\n",
218 fprintf(out,
"\t\t<WorkerThreads>%i</WorkerThreads>\n",
220 fprintf(out,
"\t\t<SignerThreads>%i</SignerThreads>\n",
223 fprintf(out,
"\t\t<NotifyCommand>%s</NotifyCommand>\n",
226 fprintf(out,
"\t</Signer>\n");
228 fprintf(out,
"</Configuration>\n");
258 free((
void*)config->
group);
259 free((
void*)config->
chroot);
engineconfig_type * engine_config(const char *cfgfile, int cmdline_verbosity)
void engine_config_cleanup(engineconfig_type *config)
void engine_config_print(FILE *out, engineconfig_type *config)
ods_status engine_config_check(engineconfig_type *config)
const char * parse_conf_pid_filename(const char *cfgfile)
const char * parse_conf_log_filename(const char *cfgfile)
const char * parse_conf_notify_command(const char *cfgfile)
const char * parse_conf_chroot(const char *cfgfile)
const char * parse_conf_working_dir(const char *cfgfile)
int parse_conf_worker_threads(const char *cfgfile)
int parse_conf_signer_threads(const char *cfgfile)
int parse_conf_use_syslog(const char *cfgfile)
const char * parse_conf_clisock_filename(const char *cfgfile)
const char * parse_conf_zonelist_filename(const char *cfgfile)
listener_type * parse_conf_listener(const char *cfgfile)
const char * parse_conf_group(const char *cfgfile)
hsm_repository_t * parse_conf_repositories(const char *cfgfile)
const char * parse_conf_username(const char *cfgfile)
int parse_conf_verbosity(const char *cfgfile)
ods_status parse_file_check(const char *cfgfile, const char *rngfile)
void listener_cleanup(listener_type *listener)
listener_type * interfaces
const char * cfg_filename
const char * notify_command
const char * clisock_filename
hsm_repository_t * repositories
const char * pid_filename
const char * zonelist_filename
const char * log_filename
interface_type * interfaces