OpenDNSSEC-enforcer
1.4.9
|
#include "config.h"
#include <stdlib.h>
#include <stdio.h>
#include <unistd.h>
#include <string.h>
#include <syslog.h>
#include <stdarg.h>
#include <errno.h>
#include <pwd.h>
#include <grp.h>
#include <ctype.h>
#include <signal.h>
#include <fcntl.h>
#include <sys/select.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <libxml/tree.h>
#include <libxml/parser.h>
#include <libxml/xpath.h>
#include <libxml/xpathInternals.h>
#include <libxml/relaxng.h>
#include "daemon.h"
#include "daemon_util.h"
#include "ksm/database.h"
#include "ksm/datetime.h"
#include "ksm/string_util.h"
#include "ksm/string_util2.h"
Go to the source code of this file.
Macros | |
#define | _GNU_SOURCE |
Functions | |
int | getPermsForDrop (DAEMONCONFIG *config) |
void | log_init (int facility, const char *program_name) |
void | log_switch (int facility, const char *facility_name, const char *program_name, int verbose) |
void | log_msg (DAEMONCONFIG *config, int priority, const char *format,...) |
void | ksm_log_msg (const char *format) |
void | log_xml_error (void *ignore, const char *format,...) |
void | log_xml_warn (void *ignore, const char *format,...) |
int | write_data (DAEMONCONFIG *config, FILE *file, const void *data, size_t size) |
int | writepid (DAEMONCONFIG *config) |
int | createPidDir (DAEMONCONFIG *config) |
int | make_directory (DAEMONCONFIG *config, const char *path) |
void | cmdlParse (DAEMONCONFIG *config, int *argc, char **argv) |
int | ReadConfig (DAEMONCONFIG *config, int verbose) |
int | get_lite_lock (char *lock_filename, FILE *lock_fd) |
int | release_lite_lock (FILE *lock_fd) |
int | get_log_user (const char *username, int *usernumber) |
#define _GNU_SOURCE |
Definition at line 41 of file daemon_util.c.
void cmdlParse | ( | DAEMONCONFIG * | , |
int * | , | ||
char ** | |||
) |
Use _r() functions on platforms that have. They are thread safe versions of the normal syslog functions. Platforms without _r() usually have thread safe normal functions.
Definition at line 624 of file daemon_util.c.
References DAEMONCONFIG::configfile, DAEMONCONFIG::debug, DAEMONCONFIG::fork, DAEMONCONFIG::gid, log_msg(), DAEMONCONFIG::once, optarg, DAEMONCONFIG::pidfile, DAEMONCONFIG::pidfile_set, DAEMONCONFIG::policy, DAEMONCONFIG::program, DAEMONCONFIG::uid, and DAEMONCONFIG::username.
Referenced by main().
int createPidDir | ( | DAEMONCONFIG * | config | ) |
Definition at line 537 of file daemon_util.c.
References log_msg(), make_directory(), DAEMONCONFIG::pidfile, StrAppend(), StrFree, and StrStrdup().
Referenced by main().
int get_lite_lock | ( | char * | lock_filename, |
FILE * | lock_fd | ||
) |
Definition at line 1169 of file daemon_util.c.
Referenced by server_main().
int get_log_user | ( | const char * | username, |
int * | usernumber | ||
) |
Definition at line 1223 of file daemon_util.c.
References DEFAULT_LOG_FACILITY, StrFree, StrStrdup(), and StrToUpper().
Referenced by ReadConfig().
int getPermsForDrop | ( | DAEMONCONFIG * | config | ) |
Use _r() functions on platforms that have. They are thread safe versions of the normal syslog functions. Platforms without _r() usually have thread safe normal functions.
Definition at line 91 of file daemon_util.c.
References DAEMONCONFIG::configfile, DAEMONCONFIG::gid, DAEMONCONFIG::groupname, log_msg(), log_xml_error(), log_xml_warn(), StrAppend(), StrFree, StrStrdup(), DAEMONCONFIG::uid, and DAEMONCONFIG::username.
Referenced by main().
void ksm_log_msg | ( | const char * | format | ) |
Definition at line 313 of file daemon_util.c.
Referenced by main().
void log_init | ( | int | facility, |
const char * | program_name | ||
) |
Definition at line 265 of file daemon_util.c.
Referenced by main().
void log_msg | ( | DAEMONCONFIG * | config, |
int | priority, | ||
const char * | format, | ||
... | |||
) |
Definition at line 294 of file daemon_util.c.
References DAEMONCONFIG::debug.
Referenced by allocateKeysToZone(), check_hsm_connection(), cmdlParse(), commGenSignConf(), createPidDir(), do_communication(), do_keygen(), do_purge(), get_lite_lock(), getPermsForDrop(), kaspSetPolicyDefaults(), log_switch(), main(), make_directory(), NewDSSet(), read_zonelist_filename(), ReadConfig(), server_init(), server_main(), write_data(), and writepid().
void log_switch | ( | int | facility, |
const char * | facility_name, | ||
const char * | program_name, | ||
int | verbose | ||
) |
void log_xml_error | ( | void * | ignore, |
const char * | format, | ||
... | |||
) |
Definition at line 354 of file daemon_util.c.
Referenced by getPermsForDrop(), and ReadConfig().
void log_xml_warn | ( | void * | ignore, |
const char * | format, | ||
... | |||
) |
Definition at line 372 of file daemon_util.c.
References AUTHOR_NAME, and COPYRIGHT_STR.
Referenced by getPermsForDrop(), and ReadConfig().
int make_directory | ( | DAEMONCONFIG * | config, |
const char * | path | ||
) |
Definition at line 579 of file daemon_util.c.
References DAEMONCONFIG::gid, log_msg(), make_directory(), StrFree, StrStrdup(), and DAEMONCONFIG::uid.
Referenced by createPidDir(), and make_directory().
int ReadConfig | ( | DAEMONCONFIG * | config, |
int | verbose | ||
) |
Definition at line 717 of file daemon_util.c.
References DAEMONCONFIG::configfile, DbFlavour(), DEFAULT_LOG_FACILITY, DEFAULT_LOG_FACILITY_STRING, DAEMONCONFIG::DSSubCKA_ID, DAEMONCONFIG::DSSubmitCmd, DtXMLIntervalSeconds(), get_log_user(), DAEMONCONFIG::host, DAEMONCONFIG::interval, log_msg(), log_switch(), DAEMONCONFIG::log_user, log_xml_error(), log_xml_warn(), DAEMONCONFIG::manualKeyGeneration, MYSQL_DB, DAEMONCONFIG::password, DAEMONCONFIG::pidfile, DAEMONCONFIG::pidfile_set, DAEMONCONFIG::port, DAEMONCONFIG::program, DAEMONCONFIG::rolloverNotify, DAEMONCONFIG::schema, SQLITE_DB, StrFree, StrStrdup(), and DAEMONCONFIG::user.
Referenced by server_main().
int release_lite_lock | ( | FILE * | lock_fd | ) |
Definition at line 1203 of file daemon_util.c.
Referenced by server_main().
int write_data | ( | DAEMONCONFIG * | config, |
FILE * | file, | ||
const void * | data, | ||
size_t | size | ||
) |
int writepid | ( | DAEMONCONFIG * | config | ) |
Definition at line 468 of file daemon_util.c.
References daemon_our_pidfile, DAEMONCONFIG::gid, log_msg(), DAEMONCONFIG::pid, DAEMONCONFIG::pidfile, DAEMONCONFIG::uid, and write_data().
Referenced by server_main().