43 static const char* conf_str =
"config";
49 strdup_or_null(
const char *s)
63 const char* rngfile = ODS_SE_RNGDIR
"/conf.rng";
66 if (!cfgfile || cfgfile[0] == 0) {
67 ods_log_error(
"[%s] failed to read: no filename given", conf_str);
80 cfgfd = ods_fopen(cfgfile, NULL,
"r");
84 ods_log_error(
"[%s] failed to read: malloc failed", conf_str);
132 ecfg->
verbosity = cmdline_verbosity > 0 ?
142 ods_log_error(
"[%s] failed to read: unable to open file %s", conf_str,
156 ods_log_error(
"[%s] check failed: config does not exist", conf_str);
157 return ODS_STATUS_CFG_ERR;
160 ods_log_error(
"[%s] check failed: no policy filename", conf_str);
161 return ODS_STATUS_CFG_ERR;
164 ods_log_error(
"[%s] check failed: no zonelist filename", conf_str);
165 return ODS_STATUS_CFG_ERR;
168 ods_log_error(
"[%s] check failed: no socket filename", conf_str);
169 return ODS_STATUS_CFG_ERR;
173 return ODS_STATUS_CFG_ERR;
178 return ODS_STATUS_OK;
194 fprintf(out,
"<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n");
196 ods_log_assert(config);
198 fprintf(out,
"<Configuration>\n");
201 fprintf(out,
"\t<Common>\n");
203 fprintf(out,
"\t\t<Logging>\n");
204 fprintf(out,
"\t\t\t<Syslog>\n");
205 fprintf(out,
"\t\t\t\t<Facility>%s</Facility>\n",
207 fprintf(out,
"\t\t\t</Syslog>\n");
208 fprintf(out,
"\t\t</Logging>\n");
210 fprintf(out,
"\t\t<Logging>\n");
211 fprintf(out,
"\t\t\t<File>\n");
212 fprintf(out,
"\t\t\t\t<Filename>%s</Filename>\n",
214 fprintf(out,
"\t\t\t</File>\n");
215 fprintf(out,
"\t\t</Logging>\n");
218 fprintf(out,
"\t\t<PolicyFile>%s</PolicyFile>\n",
220 fprintf(out,
"\t\t<ZoneListFile>%s</ZoneListFile>\n",
223 fprintf(out,
"\t\t<ZoneFetchFile>%s</ZoneFetchFile>\n",
227 fprintf(out,
"\t</Common>\n");
230 fprintf(out,
"\t<Enforcer>\n");
232 fprintf(out,
"\t\t<Privileges>\n");
234 fprintf(out,
"\t\t<User>%s</User>\n", config->
username);
237 fprintf(out,
"\t\t<Group>%s</Group>\n", config->
group);
240 fprintf(out,
"\t\t<Directory>%s</Directory>\n",
243 fprintf(out,
"\t\t</Privileges>\n");
245 fprintf(out,
"\t\t<WorkingDirectory>%s</WorkingDirectory>\n",
247 fprintf(out,
"\t\t<WorkerThreads>%i</WorkerThreads>\n",
250 fprintf(out,
"\t\t<ManualKeyGeneration/>\n");
253 fprintf(out,
"\t\t<DelegationSignerSubmitCommand>%s</DelegationSignerSubmitCommand>\n",
257 fprintf(out,
"\t\t<DelegationSignerRetractCommand>%s</DelegationSignerRetractCommand>\n",
260 fprintf(out,
"\t</Enforcer>\n");
262 fprintf(out,
"</Configuration>\n");
292 free((
void*) config->
group);
293 free((
void*) config->
chroot);
const char * delegation_signer_submit_command
void engine_config_cleanup(engineconfig_type *config)
void engine_config_print(FILE *out, engineconfig_type *config)
int parse_conf_worker_threads(const char *cfgfile)
const char * cfg_filename
int parse_conf_db_port(const char *cfgfile)
time_t parse_conf_automatic_keygen_period(const char *cfgfile)
const char * parse_conf_db_host(const char *cfgfile)
hsm_repository_t * parse_conf_repositories(const char *cfgfile)
const char * zonelist_filename
engineconfig_type * engine_config(const char *cfgfile, int cmdline_verbosity, engineconfig_type *oldcfg)
const char * policy_filename
time_t automatic_keygen_duration
int parse_conf_use_syslog(const char *cfgfile)
const char * parse_conf_clisock_filename(const char *cfgfile)
ods_status parse_file_check(const char *cfgfile, const char *rngfile)
void ods_log_error(const char *format,...)
const char * parse_conf_delegation_signer_submit_command(const char *cfgfile)
const char * delegation_signer_retract_command
const char * parse_conf_working_dir(const char *cfgfile)
int parse_conf_manual_keygen(const char *cfgfile)
const char * log_filename
const char * clisock_filename
const char * parse_conf_policy_filename(const char *cfgfile)
const char * parse_conf_group(const char *cfgfile)
const char * parse_conf_log_filename(const char *cfgfile)
hsm_repository_t * repositories
const char * zonefetch_filename
const char * parse_conf_db_password(const char *cfgfile)
const char * parse_conf_chroot(const char *cfgfile)
const char * parse_conf_datastore(const char *cfgfile)
engineconfig_database_type_t parse_conf_db_type(const char *cfgfile)
void ods_log_verbose(const char *format,...)
ods_status engine_config_check(engineconfig_type *config)
const char * parse_conf_username(const char *cfgfile)
const char * parse_conf_zonefetch_filename(const char *cfgfile)
int parse_conf_verbosity(const char *cfgfile)
const char * parse_conf_zonelist_filename(const char *cfgfile)
const char * parse_conf_pid_filename(const char *cfgfile)
engineconfig_database_type_t db_type
const char * parse_conf_delegation_signer_retract_command(const char *cfgfile)
const char * pid_filename
const char * parse_conf_db_username(const char *cfgfile)