unbound-checkconf.c File Reference

The config checker checks for syntax and other errors in the unbound.conf file, and can be used to check for errors before the server is started or sigHUPped. More...

#include "config.h"
#include "util/log.h"
#include "util/config_file.h"
#include "util/module.h"
#include "util/net_help.h"
#include "util/regional.h"
#include "iterator/iterator.h"
#include "validator/validator.h"
#include "services/localzone.h"
#include <pwd.h>
#include <sys/stat.h>

Functions

static void usage ()
 Give checkconf usage, and exit (1).
static void check_mod (struct config_file *cfg, struct module_func_block *fb)
 check if module works with config
static void localzonechecks (struct config_file *cfg)
 check localzones
static void warn_hosts (const char *typ, struct config_stub *list)
 emit warnings for IP in hosts
static void interfacechecks (struct config_file *cfg)
 check interface strings
static void aclchecks (struct config_file *cfg)
 check acl ips
static int is_file (const char *fname)
 true if fname is a file
static int is_dir (const char *fname)
 true if fname is a directory
static char * fname_after_chroot (const char *fname, struct config_file *cfg, int use_chdir)
 convert a filename to full pathname in original filesys
static char * basedir (const char *fname, struct config_file *cfg)
 get base dir of a fname
static void check_chroot_filelist (const char *desc, struct config_strlist *list, const char *chrootdir, struct config_file *cfg)
 check file list, every file must be inside the chroot location
static void morechecks (struct config_file *cfg, char *fname)
 check configuration for errors
static void checkconf (char *cfgfile)
 check config file
int main (int argc, char *argv[])
 Main routine for checkconf.

Variables

int optind
 getopt global, in case header files fail to declare it.
char * optarg
 getopt global, in case header files fail to declare it.


Detailed Description

The config checker checks for syntax and other errors in the unbound.conf file, and can be used to check for errors before the server is started or sigHUPped.

Exit status 1 means an error.


Function Documentation

static void usage (  )  [static]

Give checkconf usage, and exit (1).

static char* fname_after_chroot ( const char *  fname,
struct config_file cfg,
int  use_chdir 
) [static]

convert a filename to full pathname in original filesys

Parameters:
fname,: the path name to convert. Must not be null or empty.
cfg,: config struct for chroot and chdir (if set).
use_chdir,: if false, only chroot is applied.
Returns:
pointer to static buffer which is: [chroot][chdir]fname

References config_file::chrootdir, and config_file::directory.

Referenced by basedir(), check_chroot_filelist(), and morechecks().


Variable Documentation

int optind

getopt global, in case header files fail to declare it.

char* optarg

getopt global, in case header files fail to declare it.


Generated on Sun Sep 21 16:23:29 2008 for unbound by  doxygen 1.5.6