OpenDNSSEC-enforcer  1.4.5
Macros | Functions
daemon_util.c File Reference
#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"
Include dependency graph for daemon_util.c:

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)

Macro Definition Documentation

#define _GNU_SOURCE

Definition at line 41 of file daemon_util.c.

Function Documentation

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 623 of file daemon_util.c.

References DAEMONCONFIG::configfile, DAEMONCONFIG::debug, DAEMONCONFIG::gid, log_msg(), DAEMONCONFIG::once, optarg, DAEMONCONFIG::pidfile, DAEMONCONFIG::policy, DAEMONCONFIG::program, DAEMONCONFIG::uid, and DAEMONCONFIG::username.

Referenced by main().

int createPidDir ( DAEMONCONFIG config)

Definition at line 536 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 1142 of file daemon_util.c.

Referenced by cmd_dbbackup(), cmd_setup(), db_connect(), and server_main().

int get_log_user ( const char *  username,
int *  usernumber 
)

Definition at line 1196 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,
  ... 
)
void log_switch ( int  facility,
const char *  facility_name,
const char *  program_name,
int  verbose 
)

Definition at line 275 of file daemon_util.c.

References log_msg().

Referenced by ReadConfig().

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.

Referenced by getPermsForDrop(), and ReadConfig().

int make_directory ( DAEMONCONFIG config,
const char *  path 
)
int ReadConfig ( DAEMONCONFIG config,
int  verbose 
)
int release_lite_lock ( FILE *  lock_fd)

Definition at line 1176 of file daemon_util.c.

Referenced by db_disconnect(), and server_main().

int write_data ( DAEMONCONFIG config,
FILE *  file,
const void *  data,
size_t  size 
)

Definition at line 416 of file daemon_util.c.

References log_msg().

Referenced by writepid().

int writepid ( DAEMONCONFIG config)