OpenDNSSEC-enforcer
2.1.6
|
Go to the documentation of this file.
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);
70 ods_log_verbose(
"[%s] read cfgfile: %s", conf_str, cfgfile);
74 ods_log_error(
"[%s] failed to read: unable to parse file %s",
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 ?
144 ods_log_error(
"[%s] failed to read: unable to open file %s", conf_str,
158 ods_log_error(
"[%s] check failed: config does not exist", conf_str);
159 return ODS_STATUS_CFG_ERR;
162 ods_log_error(
"[%s] check failed: no policy filename", conf_str);
163 return ODS_STATUS_CFG_ERR;
166 ods_log_error(
"[%s] check failed: no zonelist filename", conf_str);
167 return ODS_STATUS_CFG_ERR;
170 ods_log_error(
"[%s] check failed: no socket filename", conf_str);
171 return ODS_STATUS_CFG_ERR;
174 ods_log_error(
"[%s] check failed: no datastore", conf_str);
175 return ODS_STATUS_CFG_ERR;
180 return ODS_STATUS_OK;
196 fprintf(out,
"<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n");
198 ods_log_assert(config);
200 fprintf(out,
"<Configuration>\n");
203 fprintf(out,
"\t<Common>\n");
205 fprintf(out,
"\t\t<Logging>\n");
206 fprintf(out,
"\t\t\t<Syslog>\n");
207 fprintf(out,
"\t\t\t\t<Facility>%s</Facility>\n",
209 fprintf(out,
"\t\t\t</Syslog>\n");
210 fprintf(out,
"\t\t</Logging>\n");
212 fprintf(out,
"\t\t<Logging>\n");
213 fprintf(out,
"\t\t\t<File>\n");
214 fprintf(out,
"\t\t\t\t<Filename>%s</Filename>\n",
216 fprintf(out,
"\t\t\t</File>\n");
217 fprintf(out,
"\t\t</Logging>\n");
220 fprintf(out,
"\t\t<PolicyFile>%s</PolicyFile>\n",
222 fprintf(out,
"\t\t<ZoneListFile>%s</ZoneListFile>\n",
225 fprintf(out,
"\t\t<ZoneFetchFile>%s</ZoneFetchFile>\n",
229 fprintf(out,
"\t</Common>\n");
232 fprintf(out,
"\t<Enforcer>\n");
234 fprintf(out,
"\t\t<Privileges>\n");
236 fprintf(out,
"\t\t<User>%s</User>\n", config->
username);
239 fprintf(out,
"\t\t<Group>%s</Group>\n", config->
group);
242 fprintf(out,
"\t\t<Directory>%s</Directory>\n",
245 fprintf(out,
"\t\t</Privileges>\n");
247 fprintf(out,
"\t\t<WorkingDirectory>%s</WorkingDirectory>\n",
249 fprintf(out,
"\t\t<WorkerThreads>%i</WorkerThreads>\n",
252 fprintf(out,
"\t\t<ManualKeyGeneration/>\n");
255 fprintf(out,
"\t\t<DelegationSignerSubmitCommand>%s</DelegationSignerSubmitCommand>\n",
259 fprintf(out,
"\t\t<DelegationSignerRetractCommand>%s</DelegationSignerRetractCommand>\n",
262 fprintf(out,
"\t</Enforcer>\n");
264 fprintf(out,
"</Configuration>\n");
294 free((
void*) config->
group);
295 free((
void*) config->
chroot);
void engine_config_cleanup(engineconfig_type *config)
hsm_repository_t * repositories
ods_status parse_file_check(const char *cfgfile, const char *rngfile)
const char * parse_conf_chroot(const char *cfgfile)
const char * parse_conf_zonefetch_filename(const char *cfgfile)
int parse_conf_worker_threads(const char *cfgfile)
engineconfig_database_type_t db_type
const char * delegation_signer_retract_command
const char * pid_filename
const char * parse_conf_db_password(const char *cfgfile)
const char * parse_conf_policy_filename(const char *cfgfile)
time_t automatic_keygen_duration
const char * clisock_filename
const char * policy_filename
const char * parse_conf_pid_filename(const char *cfgfile)
const char * parse_conf_delegation_signer_submit_command(const char *cfgfile)
engineconfig_database_type_t parse_conf_db_type(const char *cfgfile)
time_t parse_conf_rollover_notification(const char *cfgfile)
const char * parse_conf_username(const char *cfgfile)
const char * parse_conf_db_host(const char *cfgfile)
const char * parse_conf_datastore(const char *cfgfile)
time_t parse_conf_automatic_keygen_period(const char *cfgfile)
const char * log_filename
const char * parse_conf_db_username(const char *cfgfile)
const char * cfg_filename
hsm_repository_t * parse_conf_repositories(const char *cfgfile)
const char * zonelist_filename
void engine_config_print(FILE *out, engineconfig_type *config)
ods_status engine_config_check(engineconfig_type *config)
time_t rollover_notification
int parse_conf_verbosity(const char *cfgfile)
const char * parse_conf_clisock_filename(const char *cfgfile)
const char * parse_conf_log_filename(const char *cfgfile)
const char * parse_conf_zonelist_filename(const char *cfgfile)
const char * parse_conf_delegation_signer_retract_command(const char *cfgfile)
const char * zonefetch_filename
int parse_conf_use_syslog(const char *cfgfile)
int parse_conf_db_port(const char *cfgfile)
int parse_conf_manual_keygen(const char *cfgfile)
const char * parse_conf_group(const char *cfgfile)
engineconfig_type * engine_config(const char *cfgfile, int cmdline_verbosity, engineconfig_type *oldcfg)
const char * delegation_signer_submit_command
const char * parse_conf_working_dir(const char *cfgfile)