summaryrefslogtreecommitdiff
path: root/contrib/unbound/util
diff options
context:
space:
mode:
authorDag-Erling Smørgrav <des@FreeBSD.org>2013-04-05 09:51:31 +0000
committerDag-Erling Smørgrav <des@FreeBSD.org>2013-04-05 09:51:31 +0000
commit8ed2b5240c410d3de11182efb81fb02981e34820 (patch)
treea17550a8c82df6e46c2bb87a9d9faf38d76f9933 /contrib/unbound/util
parentb7579f77d18196a58ff700756c84dc9a302a7f67 (diff)
parent697291b66c481c617cf9875497e2189bc4a4b096 (diff)
downloadsrc-test2-8ed2b5240c410d3de11182efb81fb02981e34820.tar.gz
src-test2-8ed2b5240c410d3de11182efb81fb02981e34820.zip
Notes
Diffstat (limited to 'contrib/unbound/util')
-rw-r--r--contrib/unbound/util/alloc.h5
-rw-r--r--contrib/unbound/util/config_file.c113
-rw-r--r--contrib/unbound/util/configlexer.c413
-rw-r--r--contrib/unbound/util/configlexer.lex52
-rw-r--r--contrib/unbound/util/configparser.c552
-rw-r--r--contrib/unbound/util/configparser.h36
-rw-r--r--contrib/unbound/util/data/msgparse.c5
-rw-r--r--contrib/unbound/util/iana_ports.inc40
-rw-r--r--contrib/unbound/util/log.c9
-rw-r--r--contrib/unbound/util/net_help.c84
-rw-r--r--contrib/unbound/util/net_help.h11
-rw-r--r--contrib/unbound/util/netevent.c28
-rw-r--r--contrib/unbound/util/random.c84
-rw-r--r--contrib/unbound/util/rtt.c1
-rw-r--r--contrib/unbound/util/storage/lookup3.c14
-rw-r--r--contrib/unbound/util/tube.c1
16 files changed, 883 insertions, 565 deletions
diff --git a/contrib/unbound/util/alloc.h b/contrib/unbound/util/alloc.h
index 4ed0053e2b4a..cb8d6b1bceb7 100644
--- a/contrib/unbound/util/alloc.h
+++ b/contrib/unbound/util/alloc.h
@@ -177,8 +177,11 @@ void alloc_set_id_cleanup(struct alloc_cache* alloc, void (*cleanup)(void*),
void* arg);
#ifdef UNBOUND_ALLOC_LITE
+# include <ldns/ldns.h>
# include <ldns/packet.h>
-# include <openssl/ssl.h>
+# ifdef HAVE_OPENSSL_SSL_H
+# include <openssl/ssl.h>
+# endif
# define malloc(s) unbound_stat_malloc_lite(s, __FILE__, __LINE__, __func__)
# define calloc(n,s) unbound_stat_calloc_lite(n, s, __FILE__, __LINE__, __func__)
# define free(p) unbound_stat_free_lite(p, __FILE__, __LINE__, __func__)
diff --git a/contrib/unbound/util/config_file.c b/contrib/unbound/util/config_file.c
index 8ba79d2a29ca..b946f0df0dc5 100644
--- a/contrib/unbound/util/config_file.c
+++ b/contrib/unbound/util/config_file.c
@@ -53,6 +53,10 @@
#include "util/regional.h"
#include "util/fptr_wlist.h"
#include "util/data/dname.h"
+#ifdef HAVE_GLOB_H
+# include <glob.h>
+#endif
+
/** global config during parsing */
struct config_parser_state* cfg_parser = 0;
/** lex in file */
@@ -286,7 +290,7 @@ struct config_file* config_create_forlib(void)
{ return cfg_strlist_insert(&cfg->var, strdup(val)); }
int config_set_option(struct config_file* cfg, const char* opt,
- const char* val)
+ const char* val)
{
S_NUMBER_OR_ZERO("verbosity:", verbosity)
else if(strcmp(opt, "statistics-interval:") == 0) {
@@ -458,7 +462,7 @@ void config_collate_func(char* line, void* arg)
}
int config_get_option_list(struct config_file* cfg, const char* opt,
- struct config_strlist** list)
+ struct config_strlist** list)
{
struct config_collate_arg m;
memset(&m, 0, sizeof(m));
@@ -687,8 +691,69 @@ config_read(struct config_file* cfg, const char* filename, const char* chroot)
{
FILE *in;
char *fname = (char*)filename;
+#ifdef HAVE_GLOB
+ glob_t g;
+ size_t i;
+ int r, flags;
+#endif
if(!fname)
return 1;
+
+ /* check for wildcards */
+#ifdef HAVE_GLOB
+ if(!(!strchr(fname, '*') && !strchr(fname, '?') && !strchr(fname, '[') &&
+ !strchr(fname, '{') && !strchr(fname, '~'))) {
+ verbose(VERB_QUERY, "wildcard found, processing %s", fname);
+ flags = 0
+#ifdef GLOB_ERR
+ | GLOB_ERR
+#endif
+#ifdef GLOB_NOSORT
+ | GLOB_NOSORT
+#endif
+#ifdef GLOB_BRACE
+ | GLOB_BRACE
+#endif
+#ifdef GLOB_TILDE
+ | GLOB_TILDE
+#endif
+ ;
+ memset(&g, 0, sizeof(g));
+ r = glob(fname, flags, NULL, &g);
+ if(r) {
+ /* some error */
+ globfree(&g);
+ if(r == GLOB_NOMATCH) {
+ verbose(VERB_QUERY, "include: "
+ "no matches for %s", fname);
+ return 1;
+ } else if(r == GLOB_NOSPACE) {
+ log_err("include: %s: "
+ "fnametern out of memory", fname);
+ } else if(r == GLOB_ABORTED) {
+ log_err("wildcard include: %s: expansion "
+ "aborted (%s)", fname, strerror(errno));
+ } else {
+ log_err("wildcard include: %s: expansion "
+ "failed (%s)", fname, strerror(errno));
+ }
+ /* ignore globs that yield no files */
+ return 1;
+ }
+ /* process files found, if any */
+ for(i=0; i<(size_t)g.gl_pathc; i++) {
+ if(!config_read(cfg, g.gl_pathv[i], chroot)) {
+ log_err("error reading wildcard "
+ "include: %s", g.gl_pathv[i]);
+ globfree(&g);
+ return 0;
+ }
+ }
+ globfree(&g);
+ return 1;
+ }
+#endif /* HAVE_GLOB */
+
in = fopen(fname, "r");
if(!in) {
log_err("Could not open %s: %s", fname, strerror(errno));
@@ -1003,26 +1068,26 @@ cfg_convert_timeval(const char* str)
int
cfg_count_numbers(const char* s)
{
- /* format ::= (sp num)+ sp */
- /* num ::= [-](0-9)+ */
- /* sp ::= (space|tab)* */
- int num = 0;
- while(*s) {
- while(*s && isspace((int)*s))
- s++;
- if(!*s) /* end of string */
- break;
- if(*s == '-')
- s++;
- if(!*s) /* only - not allowed */
- return 0;
- if(!isdigit((int)*s)) /* bad character */
- return 0;
- while(*s && isdigit((int)*s))
- s++;
- num++;
- }
- return num;
+ /* format ::= (sp num)+ sp */
+ /* num ::= [-](0-9)+ */
+ /* sp ::= (space|tab)* */
+ int num = 0;
+ while(*s) {
+ while(*s && isspace((int)*s))
+ s++;
+ if(!*s) /* end of string */
+ break;
+ if(*s == '-')
+ s++;
+ if(!*s) /* only - not allowed */
+ return 0;
+ if(!isdigit((int)*s)) /* bad character */
+ return 0;
+ while(*s && isdigit((int)*s))
+ s++;
+ num++;
+ }
+ return num;
}
/** all digit number */
@@ -1038,9 +1103,9 @@ static int isalldigit(const char* str, size_t l)
int
cfg_parse_memsize(const char* str, size_t* res)
{
- size_t len = (size_t)strlen(str);
+ size_t len;
size_t mult = 1;
- if(!str || len == 0) {
+ if(!str || (len=(size_t)strlen(str)) == 0) {
log_err("not a size: '%s'", str);
return 0;
}
diff --git a/contrib/unbound/util/configlexer.c b/contrib/unbound/util/configlexer.c
index 4e8ed337821e..9ee356660258 100644
--- a/contrib/unbound/util/configlexer.c
+++ b/contrib/unbound/util/configlexer.c
@@ -10,7 +10,7 @@
#define FLEX_SCANNER
#define YY_FLEX_MAJOR_VERSION 2
#define YY_FLEX_MINOR_VERSION 5
-#define YY_FLEX_SUBMINOR_VERSION 35
+#define YY_FLEX_SUBMINOR_VERSION 36
#if YY_FLEX_SUBMINOR_VERSION > 0
#define FLEX_BETA
#endif
@@ -55,7 +55,6 @@ typedef int flex_int32_t;
typedef unsigned char flex_uint8_t;
typedef unsigned short int flex_uint16_t;
typedef unsigned int flex_uint32_t;
-#endif /* ! C99 */
/* Limits of integral types. */
#ifndef INT8_MIN
@@ -86,6 +85,8 @@ typedef unsigned int flex_uint32_t;
#define UINT32_MAX (4294967295U)
#endif
+#endif /* ! C99 */
+
#endif /* ! FLEXINT_H */
#ifdef __cplusplus
@@ -154,7 +155,12 @@ typedef unsigned int flex_uint32_t;
typedef struct yy_buffer_state *YY_BUFFER_STATE;
#endif
-extern int yyleng;
+#ifndef YY_TYPEDEF_YY_SIZE_T
+#define YY_TYPEDEF_YY_SIZE_T
+typedef size_t yy_size_t;
+#endif
+
+extern yy_size_t yyleng;
extern FILE *yyin, *yyout;
@@ -180,11 +186,6 @@ extern FILE *yyin, *yyout;
#define unput(c) yyunput( c, (yytext_ptr) )
-#ifndef YY_TYPEDEF_YY_SIZE_T
-#define YY_TYPEDEF_YY_SIZE_T
-typedef size_t yy_size_t;
-#endif
-
#ifndef YY_STRUCT_YY_BUFFER_STATE
#define YY_STRUCT_YY_BUFFER_STATE
struct yy_buffer_state
@@ -202,7 +203,7 @@ struct yy_buffer_state
/* Number of characters read into yy_ch_buf, not including EOB
* characters.
*/
- int yy_n_chars;
+ yy_size_t yy_n_chars;
/* Whether we "own" the buffer - i.e., we know we created it,
* and can realloc() it to grow it, and should free() it to
@@ -272,8 +273,8 @@ static YY_BUFFER_STATE * yy_buffer_stack = 0; /**< Stack as an array. */
/* yy_hold_char holds the character lost when yytext is formed. */
static char yy_hold_char;
-static int yy_n_chars; /* number of characters read into yy_ch_buf */
-int yyleng;
+static yy_size_t yy_n_chars; /* number of characters read into yy_ch_buf */
+yy_size_t yyleng;
/* Points to current character in buffer. */
static char *yy_c_buf_p = (char *) 0;
@@ -301,7 +302,7 @@ static void yy_init_buffer (YY_BUFFER_STATE b,FILE *file );
YY_BUFFER_STATE yy_scan_buffer (char *base,yy_size_t size );
YY_BUFFER_STATE yy_scan_string (yyconst char *yy_str );
-YY_BUFFER_STATE yy_scan_bytes (yyconst char *bytes,int len );
+YY_BUFFER_STATE yy_scan_bytes (yyconst char *bytes,yy_size_t len );
void *yyalloc (yy_size_t );
void *yyrealloc (void *,yy_size_t );
@@ -1778,6 +1779,9 @@ char *yytext;
#include <ctype.h>
#include <string.h>
#include <strings.h>
+#ifdef HAVE_GLOB_H
+# include <glob.h>
+#endif
#include "util/config_file.h"
#include "util/configparser.h"
@@ -1810,6 +1814,7 @@ static int config_include_stack_ptr = 0;
static int inc_prev = 0;
static int num_args = 0;
+
static void config_start_include(const char* filename)
{
FILE *input;
@@ -1841,6 +1846,50 @@ static void config_start_include(const char* filename)
++config_include_stack_ptr;
}
+static void config_start_include_glob(const char* filename)
+{
+
+ /* check for wildcards */
+#ifdef HAVE_GLOB
+ glob_t g;
+ size_t i;
+ int r, flags;
+ if(!(!strchr(filename, '*') && !strchr(filename, '?') && !strchr(filename, '[') &&
+ !strchr(filename, '{') && !strchr(filename, '~'))) {
+ flags = 0
+#ifdef GLOB_ERR
+ | GLOB_ERR
+#endif
+#ifdef GLOB_NOSORT
+ | GLOB_NOSORT
+#endif
+#ifdef GLOB_BRACE
+ | GLOB_BRACE
+#endif
+#ifdef GLOB_TILDE
+ | GLOB_TILDE
+#endif
+ ;
+ memset(&g, 0, sizeof(g));
+ r = glob(filename, flags, NULL, &g);
+ if(r) {
+ /* some error */
+ globfree(&g);
+ config_start_include(filename); /* let original deal with it */
+ return;
+ }
+ /* process files found, if any */
+ for(i=0; i<(size_t)g.gl_pathc; i++) {
+ config_start_include(g.gl_pathv[i]);
+ }
+ globfree(&g);
+ return;
+ }
+#endif /* HAVE_GLOB */
+
+ config_start_include(filename);
+}
+
static void config_end_include(void)
{
--config_include_stack_ptr;
@@ -1861,7 +1910,7 @@ static void config_end_include(void)
#endif
#define YY_NO_INPUT 1
-#line 100 "util/configlexer.lex"
+#line 148 "util/configlexer.lex"
#ifndef YY_NO_UNPUT
#define YY_NO_UNPUT 1
#endif
@@ -1869,7 +1918,7 @@ static void config_end_include(void)
#define YY_NO_INPUT 1
#endif
-#line 1871 "<stdout>"
+#line 1920 "<stdout>"
#define INITIAL 0
#define quotedstring 1
@@ -1913,7 +1962,7 @@ FILE *yyget_out (void );
void yyset_out (FILE * out_str );
-int yyget_leng (void );
+yy_size_t yyget_leng (void );
char *yyget_text (void );
@@ -1972,7 +2021,7 @@ static int input (void );
if ( YY_CURRENT_BUFFER_LVALUE->yy_is_interactive ) \
{ \
int c = '*'; \
- unsigned n; \
+ size_t n; \
for ( n = 0; n < max_size && \
(c = getc( yyin )) != EOF && c != '\n'; ++n ) \
buf[n] = (char) c; \
@@ -2054,9 +2103,9 @@ YY_DECL
register char *yy_cp, *yy_bp;
register int yy_act;
-#line 120 "util/configlexer.lex"
+#line 168 "util/configlexer.lex"
-#line 2058 "<stdout>"
+#line 2107 "<stdout>"
if ( !(yy_init) )
{
@@ -2147,627 +2196,627 @@ do_action: /* This label is used only to access EOF actions. */
case 1:
YY_RULE_SETUP
-#line 121 "util/configlexer.lex"
+#line 169 "util/configlexer.lex"
{
LEXOUT(("SP ")); /* ignore */ }
YY_BREAK
case 2:
YY_RULE_SETUP
-#line 123 "util/configlexer.lex"
+#line 171 "util/configlexer.lex"
{
/* note that flex makes the longest match and '.' is any but not nl */
LEXOUT(("comment(%s) ", yytext)); /* ignore */ }
YY_BREAK
case 3:
YY_RULE_SETUP
-#line 126 "util/configlexer.lex"
+#line 174 "util/configlexer.lex"
{ YDVAR(0, VAR_SERVER) }
YY_BREAK
case 4:
YY_RULE_SETUP
-#line 127 "util/configlexer.lex"
+#line 175 "util/configlexer.lex"
{ YDVAR(1, VAR_NUM_THREADS) }
YY_BREAK
case 5:
YY_RULE_SETUP
-#line 128 "util/configlexer.lex"
+#line 176 "util/configlexer.lex"
{ YDVAR(1, VAR_VERBOSITY) }
YY_BREAK
case 6:
YY_RULE_SETUP
-#line 129 "util/configlexer.lex"
+#line 177 "util/configlexer.lex"
{ YDVAR(1, VAR_PORT) }
YY_BREAK
case 7:
YY_RULE_SETUP
-#line 130 "util/configlexer.lex"
+#line 178 "util/configlexer.lex"
{ YDVAR(1, VAR_OUTGOING_RANGE) }
YY_BREAK
case 8:
YY_RULE_SETUP
-#line 131 "util/configlexer.lex"
+#line 179 "util/configlexer.lex"
{ YDVAR(1, VAR_OUTGOING_PORT_PERMIT) }
YY_BREAK
case 9:
YY_RULE_SETUP
-#line 132 "util/configlexer.lex"
+#line 180 "util/configlexer.lex"
{ YDVAR(1, VAR_OUTGOING_PORT_AVOID) }
YY_BREAK
case 10:
YY_RULE_SETUP
-#line 133 "util/configlexer.lex"
+#line 181 "util/configlexer.lex"
{ YDVAR(1, VAR_OUTGOING_NUM_TCP) }
YY_BREAK
case 11:
YY_RULE_SETUP
-#line 134 "util/configlexer.lex"
+#line 182 "util/configlexer.lex"
{ YDVAR(1, VAR_INCOMING_NUM_TCP) }
YY_BREAK
case 12:
YY_RULE_SETUP
-#line 135 "util/configlexer.lex"
+#line 183 "util/configlexer.lex"
{ YDVAR(1, VAR_DO_IP4) }
YY_BREAK
case 13:
YY_RULE_SETUP
-#line 136 "util/configlexer.lex"
+#line 184 "util/configlexer.lex"
{ YDVAR(1, VAR_DO_IP6) }
YY_BREAK
case 14:
YY_RULE_SETUP
-#line 137 "util/configlexer.lex"
+#line 185 "util/configlexer.lex"
{ YDVAR(1, VAR_DO_UDP) }
YY_BREAK
case 15:
YY_RULE_SETUP
-#line 138 "util/configlexer.lex"
+#line 186 "util/configlexer.lex"
{ YDVAR(1, VAR_DO_TCP) }
YY_BREAK
case 16:
YY_RULE_SETUP
-#line 139 "util/configlexer.lex"
+#line 187 "util/configlexer.lex"
{ YDVAR(1, VAR_TCP_UPSTREAM) }
YY_BREAK
case 17:
YY_RULE_SETUP
-#line 140 "util/configlexer.lex"
+#line 188 "util/configlexer.lex"
{ YDVAR(1, VAR_SSL_UPSTREAM) }
YY_BREAK
case 18:
YY_RULE_SETUP
-#line 141 "util/configlexer.lex"
+#line 189 "util/configlexer.lex"
{ YDVAR(1, VAR_SSL_SERVICE_KEY) }
YY_BREAK
case 19:
YY_RULE_SETUP
-#line 142 "util/configlexer.lex"
+#line 190 "util/configlexer.lex"
{ YDVAR(1, VAR_SSL_SERVICE_PEM) }
YY_BREAK
case 20:
YY_RULE_SETUP
-#line 143 "util/configlexer.lex"
+#line 191 "util/configlexer.lex"
{ YDVAR(1, VAR_SSL_PORT) }
YY_BREAK
case 21:
YY_RULE_SETUP
-#line 144 "util/configlexer.lex"
+#line 192 "util/configlexer.lex"
{ YDVAR(1, VAR_DO_DAEMONIZE) }
YY_BREAK
case 22:
YY_RULE_SETUP
-#line 145 "util/configlexer.lex"
+#line 193 "util/configlexer.lex"
{ YDVAR(1, VAR_INTERFACE) }
YY_BREAK
case 23:
YY_RULE_SETUP
-#line 146 "util/configlexer.lex"
+#line 194 "util/configlexer.lex"
{ YDVAR(1, VAR_OUTGOING_INTERFACE) }
YY_BREAK
case 24:
YY_RULE_SETUP
-#line 147 "util/configlexer.lex"
+#line 195 "util/configlexer.lex"
{ YDVAR(1, VAR_INTERFACE_AUTOMATIC) }
YY_BREAK
case 25:
YY_RULE_SETUP
-#line 148 "util/configlexer.lex"
+#line 196 "util/configlexer.lex"
{ YDVAR(1, VAR_SO_RCVBUF) }
YY_BREAK
case 26:
YY_RULE_SETUP
-#line 149 "util/configlexer.lex"
+#line 197 "util/configlexer.lex"
{ YDVAR(1, VAR_SO_SNDBUF) }
YY_BREAK
case 27:
YY_RULE_SETUP
-#line 150 "util/configlexer.lex"
+#line 198 "util/configlexer.lex"
{ YDVAR(1, VAR_CHROOT) }
YY_BREAK
case 28:
YY_RULE_SETUP
-#line 151 "util/configlexer.lex"
+#line 199 "util/configlexer.lex"
{ YDVAR(1, VAR_USERNAME) }
YY_BREAK
case 29:
YY_RULE_SETUP
-#line 152 "util/configlexer.lex"
+#line 200 "util/configlexer.lex"
{ YDVAR(1, VAR_DIRECTORY) }
YY_BREAK
case 30:
YY_RULE_SETUP
-#line 153 "util/configlexer.lex"
+#line 201 "util/configlexer.lex"
{ YDVAR(1, VAR_LOGFILE) }
YY_BREAK
case 31:
YY_RULE_SETUP
-#line 154 "util/configlexer.lex"
+#line 202 "util/configlexer.lex"
{ YDVAR(1, VAR_PIDFILE) }
YY_BREAK
case 32:
YY_RULE_SETUP
-#line 155 "util/configlexer.lex"
+#line 203 "util/configlexer.lex"
{ YDVAR(1, VAR_ROOT_HINTS) }
YY_BREAK
case 33:
YY_RULE_SETUP
-#line 156 "util/configlexer.lex"
+#line 204 "util/configlexer.lex"
{ YDVAR(1, VAR_EDNS_BUFFER_SIZE) }
YY_BREAK
case 34:
YY_RULE_SETUP
-#line 157 "util/configlexer.lex"
+#line 205 "util/configlexer.lex"
{ YDVAR(1, VAR_MSG_BUFFER_SIZE) }
YY_BREAK
case 35:
YY_RULE_SETUP
-#line 158 "util/configlexer.lex"
+#line 206 "util/configlexer.lex"
{ YDVAR(1, VAR_MSG_CACHE_SIZE) }
YY_BREAK
case 36:
YY_RULE_SETUP
-#line 159 "util/configlexer.lex"
+#line 207 "util/configlexer.lex"
{ YDVAR(1, VAR_MSG_CACHE_SLABS) }
YY_BREAK
case 37:
YY_RULE_SETUP
-#line 160 "util/configlexer.lex"
+#line 208 "util/configlexer.lex"
{ YDVAR(1, VAR_RRSET_CACHE_SIZE) }
YY_BREAK
case 38:
YY_RULE_SETUP
-#line 161 "util/configlexer.lex"
+#line 209 "util/configlexer.lex"
{ YDVAR(1, VAR_RRSET_CACHE_SLABS) }
YY_BREAK
case 39:
YY_RULE_SETUP
-#line 162 "util/configlexer.lex"
+#line 210 "util/configlexer.lex"
{ YDVAR(1, VAR_CACHE_MAX_TTL) }
YY_BREAK
case 40:
YY_RULE_SETUP
-#line 163 "util/configlexer.lex"
+#line 211 "util/configlexer.lex"
{ YDVAR(1, VAR_CACHE_MIN_TTL) }
YY_BREAK
case 41:
YY_RULE_SETUP
-#line 164 "util/configlexer.lex"
+#line 212 "util/configlexer.lex"
{ YDVAR(1, VAR_INFRA_HOST_TTL) }
YY_BREAK
case 42:
YY_RULE_SETUP
-#line 165 "util/configlexer.lex"
+#line 213 "util/configlexer.lex"
{ YDVAR(1, VAR_INFRA_LAME_TTL) }
YY_BREAK
case 43:
YY_RULE_SETUP
-#line 166 "util/configlexer.lex"
+#line 214 "util/configlexer.lex"
{ YDVAR(1, VAR_INFRA_CACHE_SLABS) }
YY_BREAK
case 44:
YY_RULE_SETUP
-#line 167 "util/configlexer.lex"
+#line 215 "util/configlexer.lex"
{ YDVAR(1, VAR_INFRA_CACHE_NUMHOSTS) }
YY_BREAK
case 45:
YY_RULE_SETUP
-#line 168 "util/configlexer.lex"
+#line 216 "util/configlexer.lex"
{ YDVAR(1, VAR_INFRA_CACHE_LAME_SIZE) }
YY_BREAK
case 46:
YY_RULE_SETUP
-#line 169 "util/configlexer.lex"
+#line 217 "util/configlexer.lex"
{ YDVAR(1, VAR_NUM_QUERIES_PER_THREAD) }
YY_BREAK
case 47:
YY_RULE_SETUP
-#line 170 "util/configlexer.lex"
+#line 218 "util/configlexer.lex"
{ YDVAR(1, VAR_JOSTLE_TIMEOUT) }
YY_BREAK
case 48:
YY_RULE_SETUP
-#line 171 "util/configlexer.lex"
+#line 219 "util/configlexer.lex"
{ YDVAR(1, VAR_TARGET_FETCH_POLICY) }
YY_BREAK
case 49:
YY_RULE_SETUP
-#line 172 "util/configlexer.lex"
+#line 220 "util/configlexer.lex"
{ YDVAR(1, VAR_HARDEN_SHORT_BUFSIZE) }
YY_BREAK
case 50:
YY_RULE_SETUP
-#line 173 "util/configlexer.lex"
+#line 221 "util/configlexer.lex"
{ YDVAR(1, VAR_HARDEN_LARGE_QUERIES) }
YY_BREAK
case 51:
YY_RULE_SETUP
-#line 174 "util/configlexer.lex"
+#line 222 "util/configlexer.lex"
{ YDVAR(1, VAR_HARDEN_GLUE) }
YY_BREAK
case 52:
YY_RULE_SETUP
-#line 175 "util/configlexer.lex"
+#line 223 "util/configlexer.lex"
{ YDVAR(1, VAR_HARDEN_DNSSEC_STRIPPED) }
YY_BREAK
case 53:
YY_RULE_SETUP
-#line 176 "util/configlexer.lex"
+#line 224 "util/configlexer.lex"
{ YDVAR(1, VAR_HARDEN_BELOW_NXDOMAIN) }
YY_BREAK
case 54:
YY_RULE_SETUP
-#line 177 "util/configlexer.lex"
+#line 225 "util/configlexer.lex"
{ YDVAR(1, VAR_HARDEN_REFERRAL_PATH) }
YY_BREAK
case 55:
YY_RULE_SETUP
-#line 178 "util/configlexer.lex"
+#line 226 "util/configlexer.lex"
{ YDVAR(1, VAR_USE_CAPS_FOR_ID) }
YY_BREAK
case 56:
YY_RULE_SETUP
-#line 179 "util/configlexer.lex"
+#line 227 "util/configlexer.lex"
{ YDVAR(1, VAR_UNWANTED_REPLY_THRESHOLD) }
YY_BREAK
case 57:
YY_RULE_SETUP
-#line 180 "util/configlexer.lex"
+#line 228 "util/configlexer.lex"
{ YDVAR(1, VAR_PRIVATE_ADDRESS) }
YY_BREAK
case 58:
YY_RULE_SETUP
-#line 181 "util/configlexer.lex"
+#line 229 "util/configlexer.lex"
{ YDVAR(1, VAR_PRIVATE_DOMAIN) }
YY_BREAK
case 59:
YY_RULE_SETUP
-#line 182 "util/configlexer.lex"
+#line 230 "util/configlexer.lex"
{ YDVAR(1, VAR_PREFETCH_KEY) }
YY_BREAK
case 60:
YY_RULE_SETUP
-#line 183 "util/configlexer.lex"
+#line 231 "util/configlexer.lex"
{ YDVAR(1, VAR_PREFETCH) }
YY_BREAK
case 61:
YY_RULE_SETUP
-#line 184 "util/configlexer.lex"
+#line 232 "util/configlexer.lex"
{ YDVAR(0, VAR_STUB_ZONE) }
YY_BREAK
case 62:
YY_RULE_SETUP
-#line 185 "util/configlexer.lex"
+#line 233 "util/configlexer.lex"
{ YDVAR(1, VAR_NAME) }
YY_BREAK
case 63:
YY_RULE_SETUP
-#line 186 "util/configlexer.lex"
+#line 234 "util/configlexer.lex"
{ YDVAR(1, VAR_STUB_ADDR) }
YY_BREAK
case 64:
YY_RULE_SETUP
-#line 187 "util/configlexer.lex"
+#line 235 "util/configlexer.lex"
{ YDVAR(1, VAR_STUB_HOST) }
YY_BREAK
case 65:
YY_RULE_SETUP
-#line 188 "util/configlexer.lex"
+#line 236 "util/configlexer.lex"
{ YDVAR(1, VAR_STUB_PRIME) }
YY_BREAK
case 66:
YY_RULE_SETUP
-#line 189 "util/configlexer.lex"
+#line 237 "util/configlexer.lex"
{ YDVAR(1, VAR_STUB_FIRST) }
YY_BREAK
case 67:
YY_RULE_SETUP
-#line 190 "util/configlexer.lex"
+#line 238 "util/configlexer.lex"
{ YDVAR(0, VAR_FORWARD_ZONE) }
YY_BREAK
case 68:
YY_RULE_SETUP
-#line 191 "util/configlexer.lex"
+#line 239 "util/configlexer.lex"
{ YDVAR(1, VAR_FORWARD_ADDR) }
YY_BREAK
case 69:
YY_RULE_SETUP
-#line 192 "util/configlexer.lex"
+#line 240 "util/configlexer.lex"
{ YDVAR(1, VAR_FORWARD_HOST) }
YY_BREAK
case 70:
YY_RULE_SETUP
-#line 193 "util/configlexer.lex"
+#line 241 "util/configlexer.lex"
{ YDVAR(1, VAR_FORWARD_FIRST) }
YY_BREAK
case 71:
YY_RULE_SETUP
-#line 194 "util/configlexer.lex"
+#line 242 "util/configlexer.lex"
{ YDVAR(1, VAR_DO_NOT_QUERY_ADDRESS) }
YY_BREAK
case 72:
YY_RULE_SETUP
-#line 195 "util/configlexer.lex"
+#line 243 "util/configlexer.lex"
{ YDVAR(1, VAR_DO_NOT_QUERY_LOCALHOST) }
YY_BREAK
case 73:
YY_RULE_SETUP
-#line 196 "util/configlexer.lex"
+#line 244 "util/configlexer.lex"
{ YDVAR(2, VAR_ACCESS_CONTROL) }
YY_BREAK
case 74:
YY_RULE_SETUP
-#line 197 "util/configlexer.lex"
+#line 245 "util/configlexer.lex"
{ YDVAR(1, VAR_HIDE_IDENTITY) }
YY_BREAK
case 75:
YY_RULE_SETUP
-#line 198 "util/configlexer.lex"
+#line 246 "util/configlexer.lex"
{ YDVAR(1, VAR_HIDE_VERSION) }
YY_BREAK
case 76:
YY_RULE_SETUP
-#line 199 "util/configlexer.lex"
+#line 247 "util/configlexer.lex"
{ YDVAR(1, VAR_IDENTITY) }
YY_BREAK
case 77:
YY_RULE_SETUP
-#line 200 "util/configlexer.lex"
+#line 248 "util/configlexer.lex"
{ YDVAR(1, VAR_VERSION) }
YY_BREAK
case 78:
YY_RULE_SETUP
-#line 201 "util/configlexer.lex"
+#line 249 "util/configlexer.lex"
{ YDVAR(1, VAR_MODULE_CONF) }
YY_BREAK
case 79:
YY_RULE_SETUP
-#line 202 "util/configlexer.lex"
+#line 250 "util/configlexer.lex"
{ YDVAR(1, VAR_DLV_ANCHOR) }
YY_BREAK
case 80:
YY_RULE_SETUP
-#line 203 "util/configlexer.lex"
+#line 251 "util/configlexer.lex"
{ YDVAR(1, VAR_DLV_ANCHOR_FILE) }
YY_BREAK
case 81:
YY_RULE_SETUP
-#line 204 "util/configlexer.lex"
+#line 252 "util/configlexer.lex"
{ YDVAR(1, VAR_TRUST_ANCHOR_FILE) }
YY_BREAK
case 82:
YY_RULE_SETUP
-#line 205 "util/configlexer.lex"
+#line 253 "util/configlexer.lex"
{ YDVAR(1, VAR_AUTO_TRUST_ANCHOR_FILE) }
YY_BREAK
case 83:
YY_RULE_SETUP
-#line 206 "util/configlexer.lex"
+#line 254 "util/configlexer.lex"
{ YDVAR(1, VAR_TRUSTED_KEYS_FILE) }
YY_BREAK
case 84:
YY_RULE_SETUP
-#line 207 "util/configlexer.lex"
+#line 255 "util/configlexer.lex"
{ YDVAR(1, VAR_TRUST_ANCHOR) }
YY_BREAK
case 85:
YY_RULE_SETUP
-#line 208 "util/configlexer.lex"
+#line 256 "util/configlexer.lex"
{ YDVAR(1, VAR_VAL_OVERRIDE_DATE) }
YY_BREAK
case 86:
YY_RULE_SETUP
-#line 209 "util/configlexer.lex"
+#line 257 "util/configlexer.lex"
{ YDVAR(1, VAR_VAL_SIG_SKEW_MIN) }
YY_BREAK
case 87:
YY_RULE_SETUP
-#line 210 "util/configlexer.lex"
+#line 258 "util/configlexer.lex"
{ YDVAR(1, VAR_VAL_SIG_SKEW_MAX) }
YY_BREAK
case 88:
YY_RULE_SETUP
-#line 211 "util/configlexer.lex"
+#line 259 "util/configlexer.lex"
{ YDVAR(1, VAR_BOGUS_TTL) }
YY_BREAK
case 89:
YY_RULE_SETUP
-#line 212 "util/configlexer.lex"
+#line 260 "util/configlexer.lex"
{ YDVAR(1, VAR_VAL_CLEAN_ADDITIONAL) }
YY_BREAK
case 90:
YY_RULE_SETUP
-#line 213 "util/configlexer.lex"
+#line 261 "util/configlexer.lex"
{ YDVAR(1, VAR_VAL_PERMISSIVE_MODE) }
YY_BREAK
case 91:
YY_RULE_SETUP
-#line 214 "util/configlexer.lex"
+#line 262 "util/configlexer.lex"
{ YDVAR(1, VAR_IGNORE_CD_FLAG) }
YY_BREAK
case 92:
YY_RULE_SETUP
-#line 215 "util/configlexer.lex"
+#line 263 "util/configlexer.lex"
{ YDVAR(1, VAR_VAL_LOG_LEVEL) }
YY_BREAK
case 93:
YY_RULE_SETUP
-#line 216 "util/configlexer.lex"
+#line 264 "util/configlexer.lex"
{ YDVAR(1, VAR_KEY_CACHE_SIZE) }
YY_BREAK
case 94:
YY_RULE_SETUP
-#line 217 "util/configlexer.lex"
+#line 265 "util/configlexer.lex"
{ YDVAR(1, VAR_KEY_CACHE_SLABS) }
YY_BREAK
case 95:
YY_RULE_SETUP
-#line 218 "util/configlexer.lex"
+#line 266 "util/configlexer.lex"
{ YDVAR(1, VAR_NEG_CACHE_SIZE) }
YY_BREAK
case 96:
YY_RULE_SETUP
-#line 219 "util/configlexer.lex"
+#line 267 "util/configlexer.lex"
{
YDVAR(1, VAR_VAL_NSEC3_KEYSIZE_ITERATIONS) }
YY_BREAK
case 97:
YY_RULE_SETUP
-#line 221 "util/configlexer.lex"
+#line 269 "util/configlexer.lex"
{ YDVAR(1, VAR_ADD_HOLDDOWN) }
YY_BREAK
case 98:
YY_RULE_SETUP
-#line 222 "util/configlexer.lex"
+#line 270 "util/configlexer.lex"
{ YDVAR(1, VAR_DEL_HOLDDOWN) }
YY_BREAK
case 99:
YY_RULE_SETUP
-#line 223 "util/configlexer.lex"
+#line 271 "util/configlexer.lex"
{ YDVAR(1, VAR_KEEP_MISSING) }
YY_BREAK
case 100:
YY_RULE_SETUP
-#line 224 "util/configlexer.lex"
+#line 272 "util/configlexer.lex"
{ YDVAR(1, VAR_USE_SYSLOG) }
YY_BREAK
case 101:
YY_RULE_SETUP
-#line 225 "util/configlexer.lex"
+#line 273 "util/configlexer.lex"
{ YDVAR(1, VAR_LOG_TIME_ASCII) }
YY_BREAK
case 102:
YY_RULE_SETUP
-#line 226 "util/configlexer.lex"
+#line 274 "util/configlexer.lex"
{ YDVAR(1, VAR_LOG_QUERIES) }
YY_BREAK
case 103:
YY_RULE_SETUP
-#line 227 "util/configlexer.lex"
+#line 275 "util/configlexer.lex"
{ YDVAR(2, VAR_LOCAL_ZONE) }
YY_BREAK
case 104:
YY_RULE_SETUP
-#line 228 "util/configlexer.lex"
+#line 276 "util/configlexer.lex"
{ YDVAR(1, VAR_LOCAL_DATA) }
YY_BREAK
case 105:
YY_RULE_SETUP
-#line 229 "util/configlexer.lex"
+#line 277 "util/configlexer.lex"
{ YDVAR(1, VAR_LOCAL_DATA_PTR) }
YY_BREAK
case 106:
YY_RULE_SETUP
-#line 230 "util/configlexer.lex"
+#line 278 "util/configlexer.lex"
{ YDVAR(1, VAR_STATISTICS_INTERVAL) }
YY_BREAK
case 107:
YY_RULE_SETUP
-#line 231 "util/configlexer.lex"
+#line 279 "util/configlexer.lex"
{ YDVAR(1, VAR_STATISTICS_CUMULATIVE) }
YY_BREAK
case 108:
YY_RULE_SETUP
-#line 232 "util/configlexer.lex"
+#line 280 "util/configlexer.lex"
{ YDVAR(1, VAR_EXTENDED_STATISTICS) }
YY_BREAK
case 109:
YY_RULE_SETUP
-#line 233 "util/configlexer.lex"
+#line 281 "util/configlexer.lex"
{ YDVAR(0, VAR_REMOTE_CONTROL) }
YY_BREAK
case 110:
YY_RULE_SETUP
-#line 234 "util/configlexer.lex"
+#line 282 "util/configlexer.lex"
{ YDVAR(1, VAR_CONTROL_ENABLE) }
YY_BREAK
case 111:
YY_RULE_SETUP
-#line 235 "util/configlexer.lex"
+#line 283 "util/configlexer.lex"
{ YDVAR(1, VAR_CONTROL_INTERFACE) }
YY_BREAK
case 112:
YY_RULE_SETUP
-#line 236 "util/configlexer.lex"
+#line 284 "util/configlexer.lex"
{ YDVAR(1, VAR_CONTROL_PORT) }
YY_BREAK
case 113:
YY_RULE_SETUP
-#line 237 "util/configlexer.lex"
+#line 285 "util/configlexer.lex"
{ YDVAR(1, VAR_SERVER_KEY_FILE) }
YY_BREAK
case 114:
YY_RULE_SETUP
-#line 238 "util/configlexer.lex"
+#line 286 "util/configlexer.lex"
{ YDVAR(1, VAR_SERVER_CERT_FILE) }
YY_BREAK
case 115:
YY_RULE_SETUP
-#line 239 "util/configlexer.lex"
+#line 287 "util/configlexer.lex"
{ YDVAR(1, VAR_CONTROL_KEY_FILE) }
YY_BREAK
case 116:
YY_RULE_SETUP
-#line 240 "util/configlexer.lex"
+#line 288 "util/configlexer.lex"
{ YDVAR(1, VAR_CONTROL_CERT_FILE) }
YY_BREAK
case 117:
YY_RULE_SETUP
-#line 241 "util/configlexer.lex"
+#line 289 "util/configlexer.lex"
{ YDVAR(1, VAR_PYTHON_SCRIPT) }
YY_BREAK
case 118:
YY_RULE_SETUP
-#line 242 "util/configlexer.lex"
+#line 290 "util/configlexer.lex"
{ YDVAR(0, VAR_PYTHON) }
YY_BREAK
case 119:
YY_RULE_SETUP
-#line 243 "util/configlexer.lex"
+#line 291 "util/configlexer.lex"
{ YDVAR(1, VAR_DOMAIN_INSECURE) }
YY_BREAK
case 120:
YY_RULE_SETUP
-#line 244 "util/configlexer.lex"
+#line 292 "util/configlexer.lex"
{ YDVAR(1, VAR_MINIMAL_RESPONSES) }
YY_BREAK
case 121:
YY_RULE_SETUP
-#line 245 "util/configlexer.lex"
+#line 293 "util/configlexer.lex"
{ YDVAR(1, VAR_RRSET_ROUNDROBIN) }
YY_BREAK
case 122:
/* rule 122 can match eol */
YY_RULE_SETUP
-#line 246 "util/configlexer.lex"
+#line 294 "util/configlexer.lex"
{ LEXOUT(("NL\n")); cfg_parser->line++; }
YY_BREAK
/* Quoted strings. Strip leading and ending quotes */
case 123:
YY_RULE_SETUP
-#line 249 "util/configlexer.lex"
+#line 297 "util/configlexer.lex"
{ BEGIN(quotedstring); LEXOUT(("QS ")); }
YY_BREAK
case YY_STATE_EOF(quotedstring):
-#line 250 "util/configlexer.lex"
+#line 298 "util/configlexer.lex"
{
yyerror("EOF inside quoted string");
if(--num_args == 0) { BEGIN(INITIAL); }
@@ -2776,19 +2825,19 @@ case YY_STATE_EOF(quotedstring):
YY_BREAK
case 124:
YY_RULE_SETUP
-#line 255 "util/configlexer.lex"
+#line 303 "util/configlexer.lex"
{ LEXOUT(("STR(%s) ", yytext)); yymore(); }
YY_BREAK
case 125:
/* rule 125 can match eol */
YY_RULE_SETUP
-#line 256 "util/configlexer.lex"
+#line 304 "util/configlexer.lex"
{ yyerror("newline inside quoted string, no end \"");
cfg_parser->line++; BEGIN(INITIAL); }
YY_BREAK
case 126:
YY_RULE_SETUP
-#line 258 "util/configlexer.lex"
+#line 306 "util/configlexer.lex"
{
LEXOUT(("QE "));
if(--num_args == 0) { BEGIN(INITIAL); }
@@ -2803,11 +2852,11 @@ YY_RULE_SETUP
/* Single Quoted strings. Strip leading and ending quotes */
case 127:
YY_RULE_SETUP
-#line 270 "util/configlexer.lex"
+#line 318 "util/configlexer.lex"
{ BEGIN(singlequotedstr); LEXOUT(("SQS ")); }
YY_BREAK
case YY_STATE_EOF(singlequotedstr):
-#line 271 "util/configlexer.lex"
+#line 319 "util/configlexer.lex"
{
yyerror("EOF inside quoted string");
if(--num_args == 0) { BEGIN(INITIAL); }
@@ -2816,19 +2865,19 @@ case YY_STATE_EOF(singlequotedstr):
YY_BREAK
case 128:
YY_RULE_SETUP
-#line 276 "util/configlexer.lex"
+#line 324 "util/configlexer.lex"
{ LEXOUT(("STR(%s) ", yytext)); yymore(); }
YY_BREAK
case 129:
/* rule 129 can match eol */
YY_RULE_SETUP
-#line 277 "util/configlexer.lex"
+#line 325 "util/configlexer.lex"
{ yyerror("newline inside quoted string, no end '");
cfg_parser->line++; BEGIN(INITIAL); }
YY_BREAK
case 130:
YY_RULE_SETUP
-#line 279 "util/configlexer.lex"
+#line 327 "util/configlexer.lex"
{
LEXOUT(("SQE "));
if(--num_args == 0) { BEGIN(INITIAL); }
@@ -2843,12 +2892,12 @@ YY_RULE_SETUP
/* include: directive */
case 131:
YY_RULE_SETUP
-#line 291 "util/configlexer.lex"
+#line 339 "util/configlexer.lex"
{
LEXOUT(("v(%s) ", yytext)); inc_prev = YYSTATE; BEGIN(include); }
YY_BREAK
case YY_STATE_EOF(include):
-#line 293 "util/configlexer.lex"
+#line 341 "util/configlexer.lex"
{
yyerror("EOF inside include directive");
BEGIN(inc_prev);
@@ -2856,31 +2905,31 @@ case YY_STATE_EOF(include):
YY_BREAK
case 132:
YY_RULE_SETUP
-#line 297 "util/configlexer.lex"
+#line 345 "util/configlexer.lex"
{ LEXOUT(("ISP ")); /* ignore */ }
YY_BREAK
case 133:
/* rule 133 can match eol */
YY_RULE_SETUP
-#line 298 "util/configlexer.lex"
+#line 346 "util/configlexer.lex"
{ LEXOUT(("NL\n")); cfg_parser->line++;}
YY_BREAK
case 134:
YY_RULE_SETUP
-#line 299 "util/configlexer.lex"
+#line 347 "util/configlexer.lex"
{ LEXOUT(("IQS ")); BEGIN(include_quoted); }
YY_BREAK
case 135:
YY_RULE_SETUP
-#line 300 "util/configlexer.lex"
+#line 348 "util/configlexer.lex"
{
LEXOUT(("Iunquotedstr(%s) ", yytext));
- config_start_include(yytext);
+ config_start_include_glob(yytext);
BEGIN(inc_prev);
}
YY_BREAK
case YY_STATE_EOF(include_quoted):
-#line 305 "util/configlexer.lex"
+#line 353 "util/configlexer.lex"
{
yyerror("EOF inside quoted string");
BEGIN(inc_prev);
@@ -2888,29 +2937,29 @@ case YY_STATE_EOF(include_quoted):
YY_BREAK
case 136:
YY_RULE_SETUP
-#line 309 "util/configlexer.lex"
+#line 357 "util/configlexer.lex"
{ LEXOUT(("ISTR(%s) ", yytext)); yymore(); }
YY_BREAK
case 137:
/* rule 137 can match eol */
YY_RULE_SETUP
-#line 310 "util/configlexer.lex"
+#line 358 "util/configlexer.lex"
{ yyerror("newline before \" in include name");
cfg_parser->line++; BEGIN(inc_prev); }
YY_BREAK
case 138:
YY_RULE_SETUP
-#line 312 "util/configlexer.lex"
+#line 360 "util/configlexer.lex"
{
LEXOUT(("IQE "));
yytext[yyleng - 1] = '\0';
- config_start_include(yytext);
+ config_start_include_glob(yytext);
BEGIN(inc_prev);
}
YY_BREAK
case YY_STATE_EOF(INITIAL):
case YY_STATE_EOF(val):
-#line 318 "util/configlexer.lex"
+#line 366 "util/configlexer.lex"
{
yy_set_bol(1); /* Set beginning of line, so "^" rules match. */
if (config_include_stack_ptr == 0) {
@@ -2923,31 +2972,31 @@ case YY_STATE_EOF(val):
YY_BREAK
case 139:
YY_RULE_SETUP
-#line 328 "util/configlexer.lex"
+#line 376 "util/configlexer.lex"
{ LEXOUT(("unquotedstr(%s) ", yytext));
if(--num_args == 0) { BEGIN(INITIAL); }
yylval.str = strdup(yytext); return STRING_ARG; }
YY_BREAK
case 140:
YY_RULE_SETUP
-#line 332 "util/configlexer.lex"
+#line 380 "util/configlexer.lex"
{
ub_c_error_msg("unknown keyword '%s'", yytext);
}
YY_BREAK
case 141:
YY_RULE_SETUP
-#line 336 "util/configlexer.lex"
+#line 384 "util/configlexer.lex"
{
ub_c_error_msg("stray '%s'", yytext);
}
YY_BREAK
case 142:
YY_RULE_SETUP
-#line 340 "util/configlexer.lex"
+#line 388 "util/configlexer.lex"
ECHO;
YY_BREAK
-#line 2949 "<stdout>"
+#line 2998 "<stdout>"
case YY_END_OF_BUFFER:
{
@@ -3131,21 +3180,21 @@ static int yy_get_next_buffer (void)
else
{
- int num_to_read =
+ yy_size_t num_to_read =
YY_CURRENT_BUFFER_LVALUE->yy_buf_size - number_to_move - 1;
while ( num_to_read <= 0 )
{ /* Not enough room in the buffer - grow it. */
/* just a shorter name for the current buffer */
- YY_BUFFER_STATE b = YY_CURRENT_BUFFER;
+ YY_BUFFER_STATE b = YY_CURRENT_BUFFER_LVALUE;
int yy_c_buf_p_offset =
(int) ((yy_c_buf_p) - b->yy_ch_buf);
if ( b->yy_is_our_buffer )
{
- int new_size = b->yy_buf_size * 2;
+ yy_size_t new_size = b->yy_buf_size * 2;
if ( new_size <= 0 )
b->yy_buf_size += b->yy_buf_size / 8;
@@ -3176,7 +3225,7 @@ static int yy_get_next_buffer (void)
/* Read in more data. */
YY_INPUT( (&YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move]),
- (yy_n_chars), (size_t) num_to_read );
+ (yy_n_chars), num_to_read );
YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars);
}
@@ -3271,7 +3320,7 @@ static int yy_get_next_buffer (void)
yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
yy_is_jam = (yy_current_state == 1342);
- return yy_is_jam ? 0 : yy_current_state;
+ return yy_is_jam ? 0 : yy_current_state;
}
#ifndef YY_NO_INPUT
@@ -3298,7 +3347,7 @@ static int yy_get_next_buffer (void)
else
{ /* need more input */
- int offset = (yy_c_buf_p) - (yytext_ptr);
+ yy_size_t offset = (yy_c_buf_p) - (yytext_ptr);
++(yy_c_buf_p);
switch ( yy_get_next_buffer( ) )
@@ -3458,10 +3507,6 @@ static void yy_load_buffer_state (void)
yyfree((void *) b );
}
-#ifndef __cplusplus
-extern int isatty (int );
-#endif /* __cplusplus */
-
/* Initializes or reinitializes a buffer.
* This function is sometimes called more than once on the same buffer,
* such as during a yyrestart() or at EOF.
@@ -3574,7 +3619,7 @@ void yypop_buffer_state (void)
*/
static void yyensure_buffer_stack (void)
{
- int num_to_alloc;
+ yy_size_t num_to_alloc;
if (!(yy_buffer_stack)) {
@@ -3666,12 +3711,12 @@ YY_BUFFER_STATE yy_scan_string (yyconst char * yystr )
/** Setup the input buffer state to scan the given bytes. The next call to yylex() will
* scan from a @e copy of @a bytes.
- * @param bytes the byte buffer to scan
- * @param len the number of bytes in the buffer pointed to by @a bytes.
+ * @param yybytes the byte buffer to scan
+ * @param _yybytes_len the number of bytes in the buffer pointed to by @a bytes.
*
* @return the newly allocated buffer state object.
*/
-YY_BUFFER_STATE yy_scan_bytes (yyconst char * yybytes, int _yybytes_len )
+YY_BUFFER_STATE yy_scan_bytes (yyconst char * yybytes, yy_size_t _yybytes_len )
{
YY_BUFFER_STATE b;
char *buf;
@@ -3758,7 +3803,7 @@ FILE *yyget_out (void)
/** Get the length of the current token.
*
*/
-int yyget_leng (void)
+yy_size_t yyget_leng (void)
{
return yyleng;
}
@@ -3906,7 +3951,7 @@ void yyfree (void * ptr )
#define YYTABLES_NAME "yytables"
-#line 340 "util/configlexer.lex"
+#line 388 "util/configlexer.lex"
diff --git a/contrib/unbound/util/configlexer.lex b/contrib/unbound/util/configlexer.lex
index ed808aafc393..4694cdd821e7 100644
--- a/contrib/unbound/util/configlexer.lex
+++ b/contrib/unbound/util/configlexer.lex
@@ -11,6 +11,9 @@
#include <ctype.h>
#include <string.h>
#include <strings.h>
+#ifdef HAVE_GLOB_H
+# include <glob.h>
+#endif
#include "util/config_file.h"
#include "util/configparser.h"
@@ -43,6 +46,7 @@ static int config_include_stack_ptr = 0;
static int inc_prev = 0;
static int num_args = 0;
+
static void config_start_include(const char* filename)
{
FILE *input;
@@ -74,6 +78,50 @@ static void config_start_include(const char* filename)
++config_include_stack_ptr;
}
+static void config_start_include_glob(const char* filename)
+{
+
+ /* check for wildcards */
+#ifdef HAVE_GLOB
+ glob_t g;
+ size_t i;
+ int r, flags;
+ if(!(!strchr(filename, '*') && !strchr(filename, '?') && !strchr(filename, '[') &&
+ !strchr(filename, '{') && !strchr(filename, '~'))) {
+ flags = 0
+#ifdef GLOB_ERR
+ | GLOB_ERR
+#endif
+#ifdef GLOB_NOSORT
+ | GLOB_NOSORT
+#endif
+#ifdef GLOB_BRACE
+ | GLOB_BRACE
+#endif
+#ifdef GLOB_TILDE
+ | GLOB_TILDE
+#endif
+ ;
+ memset(&g, 0, sizeof(g));
+ r = glob(filename, flags, NULL, &g);
+ if(r) {
+ /* some error */
+ globfree(&g);
+ config_start_include(filename); /* let original deal with it */
+ return;
+ }
+ /* process files found, if any */
+ for(i=0; i<(size_t)g.gl_pathc; i++) {
+ config_start_include(g.gl_pathv[i]);
+ }
+ globfree(&g);
+ return;
+ }
+#endif /* HAVE_GLOB */
+
+ config_start_include(filename);
+}
+
static void config_end_include(void)
{
--config_include_stack_ptr;
@@ -299,7 +347,7 @@ rrset-roundrobin{COLON} { YDVAR(1, VAR_RRSET_ROUNDROBIN) }
<include>\" { LEXOUT(("IQS ")); BEGIN(include_quoted); }
<include>{UNQUOTEDLETTER}* {
LEXOUT(("Iunquotedstr(%s) ", yytext));
- config_start_include(yytext);
+ config_start_include_glob(yytext);
BEGIN(inc_prev);
}
<include_quoted><<EOF>> {
@@ -312,7 +360,7 @@ rrset-roundrobin{COLON} { YDVAR(1, VAR_RRSET_ROUNDROBIN) }
<include_quoted>\" {
LEXOUT(("IQE "));
yytext[yyleng - 1] = '\0';
- config_start_include(yytext);
+ config_start_include_glob(yytext);
BEGIN(inc_prev);
}
<INITIAL,val><<EOF>> {
diff --git a/contrib/unbound/util/configparser.c b/contrib/unbound/util/configparser.c
index 6ed60dfad68f..70de0ccb3e31 100644
--- a/contrib/unbound/util/configparser.c
+++ b/contrib/unbound/util/configparser.c
@@ -1,8 +1,8 @@
-/* A Bison parser, made by GNU Bison 2.5. */
+/* A Bison parser, made by GNU Bison 2.6.1. */
/* Bison implementation for Yacc-like parsers in C
- Copyright (C) 1984, 1989-1990, 2000-2011 Free Software Foundation, Inc.
+ Copyright (C) 1984, 1989-1990, 2000-2012 Free Software Foundation, Inc.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -44,7 +44,7 @@
#define YYBISON 1
/* Bison version. */
-#define YYBISON_VERSION "2.5"
+#define YYBISON_VERSION "2.6.1"
/* Skeleton name. */
#define YYSKELETON_NAME "yacc.c"
@@ -58,14 +58,11 @@
/* Pull parsers. */
#define YYPULL 1
-/* Using locations. */
-#define YYLSP_NEEDED 0
/* Copy the first part of user declarations. */
-
-/* Line 268 of yacc.c */
+/* Line 336 of yacc.c */
#line 38 "util/configparser.y"
#include "config.h"
@@ -93,14 +90,16 @@ extern struct config_parser_state* cfg_parser;
#endif
+/* Line 336 of yacc.c */
+#line 95 "util/configparser.c"
-/* Line 268 of yacc.c */
-#line 99 "util/configparser.c"
-
-/* Enabling traces. */
-#ifndef YYDEBUG
-# define YYDEBUG 0
-#endif
+# ifndef YY_NULL
+# if defined __cplusplus && 201103L <= __cplusplus
+# define YY_NULL nullptr
+# else
+# define YY_NULL 0
+# endif
+# endif
/* Enabling verbose error messages. */
#ifdef YYERROR_VERBOSE
@@ -110,11 +109,17 @@ extern struct config_parser_state* cfg_parser;
# define YYERROR_VERBOSE 0
#endif
-/* Enabling the token table. */
-#ifndef YYTOKEN_TABLE
-# define YYTOKEN_TABLE 0
+/* In a future release of Bison, this section will be replaced
+ by #include "configparser.h". */
+#ifndef YY_UTIL_CONFIGPARSER_H
+# define YY_UTIL_CONFIGPARSER_H
+/* Enabling traces. */
+#ifndef YYDEBUG
+# define YYDEBUG 0
+#endif
+#if YYDEBUG
+extern int yydebug;
#endif
-
/* Tokens. */
#ifndef YYTOKENTYPE
@@ -382,32 +387,45 @@ extern struct config_parser_state* cfg_parser;
-
#if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED
typedef union YYSTYPE
{
-
-/* Line 293 of yacc.c */
+/* Line 350 of yacc.c */
#line 64 "util/configparser.y"
char* str;
-
-/* Line 293 of yacc.c */
-#line 399 "util/configparser.c"
+/* Line 350 of yacc.c */
+#line 401 "util/configparser.c"
} YYSTYPE;
# define YYSTYPE_IS_TRIVIAL 1
# define yystype YYSTYPE /* obsolescent; will be withdrawn */
# define YYSTYPE_IS_DECLARED 1
#endif
+extern YYSTYPE yylval;
-/* Copy the second part of user declarations. */
+#ifdef YYPARSE_PARAM
+#if defined __STDC__ || defined __cplusplus
+int yyparse (void *YYPARSE_PARAM);
+#else
+int yyparse ();
+#endif
+#else /* ! YYPARSE_PARAM */
+#if defined __STDC__ || defined __cplusplus
+int yyparse (void);
+#else
+int yyparse ();
+#endif
+#endif /* ! YYPARSE_PARAM */
+#endif /* !YY_UTIL_CONFIGPARSER_H */
+
+/* Copy the second part of user declarations. */
-/* Line 343 of yacc.c */
-#line 411 "util/configparser.c"
+/* Line 353 of yacc.c */
+#line 429 "util/configparser.c"
#ifdef short
# undef short
@@ -513,6 +531,7 @@ YYID (yyi)
# if ! defined _ALLOCA_H && ! defined EXIT_SUCCESS && (defined __STDC__ || defined __C99__FUNC__ \
|| defined __cplusplus || defined _MSC_VER)
# include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
+ /* Use EXIT_SUCCESS as a witness for stdlib.h. */
# ifndef EXIT_SUCCESS
# define EXIT_SUCCESS 0
# endif
@@ -604,20 +623,20 @@ union yyalloc
#endif
#if defined YYCOPY_NEEDED && YYCOPY_NEEDED
-/* Copy COUNT objects from FROM to TO. The source and destination do
+/* Copy COUNT objects from SRC to DST. The source and destination do
not overlap. */
# ifndef YYCOPY
# if defined __GNUC__ && 1 < __GNUC__
-# define YYCOPY(To, From, Count) \
- __builtin_memcpy (To, From, (Count) * sizeof (*(From)))
+# define YYCOPY(Dst, Src, Count) \
+ __builtin_memcpy (Dst, Src, (Count) * sizeof (*(Src)))
# else
-# define YYCOPY(To, From, Count) \
- do \
- { \
- YYSIZE_T yyi; \
- for (yyi = 0; yyi < (Count); yyi++) \
- (To)[yyi] = (From)[yyi]; \
- } \
+# define YYCOPY(Dst, Src, Count) \
+ do \
+ { \
+ YYSIZE_T yyi; \
+ for (yyi = 0; yyi < (Count); yyi++) \
+ (Dst)[yyi] = (Src)[yyi]; \
+ } \
while (YYID (0))
# endif
# endif
@@ -821,7 +840,7 @@ static const yytype_uint16 yyrline[] =
};
#endif
-#if YYDEBUG || YYERROR_VERBOSE || YYTOKEN_TABLE
+#if YYDEBUG || YYERROR_VERBOSE || 0
/* YYTNAME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM.
First, the terminals, then, starting at YYNTOKENS, nonterminals. */
static const char *const yytname[] =
@@ -917,7 +936,7 @@ static const char *const yytname[] =
"rc_control_enable", "rc_control_port", "rc_control_interface",
"rc_server_key_file", "rc_server_cert_file", "rc_control_key_file",
"rc_control_cert_file", "pythonstart", "contents_py", "content_py",
- "py_script", 0
+ "py_script", YY_NULL
};
#endif
@@ -1269,17 +1288,18 @@ static const yytype_uint16 yystos[] =
#define YYRECOVERING() (!!yyerrstatus)
-#define YYBACKUP(Token, Value) \
-do \
- if (yychar == YYEMPTY && yylen == 1) \
- { \
- yychar = (Token); \
- yylval = (Value); \
- YYPOPSTACK (1); \
- goto yybackup; \
- } \
- else \
- { \
+#define YYBACKUP(Token, Value) \
+do \
+ if (yychar == YYEMPTY) \
+ { \
+ yychar = (Token); \
+ yylval = (Value); \
+ YYPOPSTACK (yylen); \
+ yystate = *yyssp; \
+ goto yybackup; \
+ } \
+ else \
+ { \
yyerror (YY_("syntax error: cannot back up")); \
YYERROR; \
} \
@@ -1289,32 +1309,33 @@ while (YYID (0))
#define YYTERROR 1
#define YYERRCODE 256
-
/* YYLLOC_DEFAULT -- Set CURRENT to span from RHS[1] to RHS[N].
If N is 0, then set CURRENT to the empty location which ends
the previous symbol: RHS[0] (always defined). */
-#define YYRHSLOC(Rhs, K) ((Rhs)[K])
#ifndef YYLLOC_DEFAULT
-# define YYLLOC_DEFAULT(Current, Rhs, N) \
- do \
- if (YYID (N)) \
- { \
- (Current).first_line = YYRHSLOC (Rhs, 1).first_line; \
- (Current).first_column = YYRHSLOC (Rhs, 1).first_column; \
- (Current).last_line = YYRHSLOC (Rhs, N).last_line; \
- (Current).last_column = YYRHSLOC (Rhs, N).last_column; \
- } \
- else \
- { \
- (Current).first_line = (Current).last_line = \
- YYRHSLOC (Rhs, 0).last_line; \
- (Current).first_column = (Current).last_column = \
- YYRHSLOC (Rhs, 0).last_column; \
- } \
+# define YYLLOC_DEFAULT(Current, Rhs, N) \
+ do \
+ if (YYID (N)) \
+ { \
+ (Current).first_line = YYRHSLOC (Rhs, 1).first_line; \
+ (Current).first_column = YYRHSLOC (Rhs, 1).first_column; \
+ (Current).last_line = YYRHSLOC (Rhs, N).last_line; \
+ (Current).last_column = YYRHSLOC (Rhs, N).last_column; \
+ } \
+ else \
+ { \
+ (Current).first_line = (Current).last_line = \
+ YYRHSLOC (Rhs, 0).last_line; \
+ (Current).first_column = (Current).last_column = \
+ YYRHSLOC (Rhs, 0).last_column; \
+ } \
while (YYID (0))
#endif
+#define YYRHSLOC(Rhs, K) ((Rhs)[K])
+
+
/* This macro is provided for backward compatibility. */
@@ -1374,6 +1395,8 @@ yy_symbol_value_print (yyoutput, yytype, yyvaluep)
YYSTYPE const * const yyvaluep;
#endif
{
+ FILE *yyo = yyoutput;
+ YYUSE (yyo);
if (!yyvaluep)
return;
# ifdef YYPRINT
@@ -1625,12 +1648,12 @@ static int
yysyntax_error (YYSIZE_T *yymsg_alloc, char **yymsg,
yytype_int16 *yyssp, int yytoken)
{
- YYSIZE_T yysize0 = yytnamerr (0, yytname[yytoken]);
+ YYSIZE_T yysize0 = yytnamerr (YY_NULL, yytname[yytoken]);
YYSIZE_T yysize = yysize0;
YYSIZE_T yysize1;
enum { YYERROR_VERBOSE_ARGS_MAXIMUM = 5 };
/* Internationalized format string. */
- const char *yyformat = 0;
+ const char *yyformat = YY_NULL;
/* Arguments of yyformat. */
char const *yyarg[YYERROR_VERBOSE_ARGS_MAXIMUM];
/* Number of reported tokens (one for the "unexpected", one per
@@ -1690,7 +1713,7 @@ yysyntax_error (YYSIZE_T *yymsg_alloc, char **yymsg,
break;
}
yyarg[yycount++] = yytname[yyx];
- yysize1 = yysize + yytnamerr (0, yytname[yyx]);
+ yysize1 = yysize + yytnamerr (YY_NULL, yytname[yyx]);
if (! (yysize <= yysize1
&& yysize1 <= YYSTACK_ALLOC_MAXIMUM))
return 2;
@@ -1782,20 +1805,6 @@ yydestruct (yymsg, yytype, yyvaluep)
}
-/* Prevent warnings from -Wmissing-prototypes. */
-#ifdef YYPARSE_PARAM
-#if defined __STDC__ || defined __cplusplus
-int yyparse (void *YYPARSE_PARAM);
-#else
-int yyparse ();
-#endif
-#else /* ! YYPARSE_PARAM */
-#if defined __STDC__ || defined __cplusplus
-int yyparse (void);
-#else
-int yyparse ();
-#endif
-#endif /* ! YYPARSE_PARAM */
/* The lookahead symbol. */
@@ -1842,7 +1851,7 @@ yyparse ()
`yyss': related to states.
`yyvs': related to semantic values.
- Refer to the stacks thru separate pointers, to allow yyoverflow
+ Refer to the stacks through separate pointers, to allow yyoverflow
to reallocate them elsewhere. */
/* The state stack. */
@@ -1896,7 +1905,6 @@ yyparse ()
The wasted elements are never initialized. */
yyssp = yyss;
yyvsp = yyvs;
-
goto yysetstate;
/*------------------------------------------------------------.
@@ -2074,8 +2082,7 @@ yyreduce:
switch (yyn)
{
case 9:
-
-/* Line 1806 of yacc.c */
+/* Line 1787 of yacc.c */
#line 118 "util/configparser.y"
{
OUTYY(("\nP(server:)\n"));
@@ -2083,8 +2090,7 @@ yyreduce:
break;
case 110:
-
-/* Line 1806 of yacc.c */
+/* Line 1787 of yacc.c */
#line 167 "util/configparser.y"
{
struct config_stub* s;
@@ -2099,8 +2105,7 @@ yyreduce:
break;
case 118:
-
-/* Line 1806 of yacc.c */
+/* Line 1787 of yacc.c */
#line 183 "util/configparser.y"
{
struct config_stub* s;
@@ -2115,8 +2120,7 @@ yyreduce:
break;
case 125:
-
-/* Line 1806 of yacc.c */
+/* Line 1787 of yacc.c */
#line 199 "util/configparser.y"
{
OUTYY(("P(server_num_threads:%s)\n", (yyvsp[(2) - (2)].str)));
@@ -2128,8 +2132,7 @@ yyreduce:
break;
case 126:
-
-/* Line 1806 of yacc.c */
+/* Line 1787 of yacc.c */
#line 208 "util/configparser.y"
{
OUTYY(("P(server_verbosity:%s)\n", (yyvsp[(2) - (2)].str)));
@@ -2141,8 +2144,7 @@ yyreduce:
break;
case 127:
-
-/* Line 1806 of yacc.c */
+/* Line 1787 of yacc.c */
#line 217 "util/configparser.y"
{
OUTYY(("P(server_statistics_interval:%s)\n", (yyvsp[(2) - (2)].str)));
@@ -2156,8 +2158,7 @@ yyreduce:
break;
case 128:
-
-/* Line 1806 of yacc.c */
+/* Line 1787 of yacc.c */
#line 228 "util/configparser.y"
{
OUTYY(("P(server_statistics_cumulative:%s)\n", (yyvsp[(2) - (2)].str)));
@@ -2169,8 +2170,7 @@ yyreduce:
break;
case 129:
-
-/* Line 1806 of yacc.c */
+/* Line 1787 of yacc.c */
#line 237 "util/configparser.y"
{
OUTYY(("P(server_extended_statistics:%s)\n", (yyvsp[(2) - (2)].str)));
@@ -2182,8 +2182,7 @@ yyreduce:
break;
case 130:
-
-/* Line 1806 of yacc.c */
+/* Line 1787 of yacc.c */
#line 246 "util/configparser.y"
{
OUTYY(("P(server_port:%s)\n", (yyvsp[(2) - (2)].str)));
@@ -2195,8 +2194,7 @@ yyreduce:
break;
case 131:
-
-/* Line 1806 of yacc.c */
+/* Line 1787 of yacc.c */
#line 255 "util/configparser.y"
{
OUTYY(("P(server_interface:%s)\n", (yyvsp[(2) - (2)].str)));
@@ -2212,8 +2210,7 @@ yyreduce:
break;
case 132:
-
-/* Line 1806 of yacc.c */
+/* Line 1787 of yacc.c */
#line 268 "util/configparser.y"
{
OUTYY(("P(server_outgoing_interface:%s)\n", (yyvsp[(2) - (2)].str)));
@@ -2231,8 +2228,7 @@ yyreduce:
break;
case 133:
-
-/* Line 1806 of yacc.c */
+/* Line 1787 of yacc.c */
#line 283 "util/configparser.y"
{
OUTYY(("P(server_outgoing_range:%s)\n", (yyvsp[(2) - (2)].str)));
@@ -2244,8 +2240,7 @@ yyreduce:
break;
case 134:
-
-/* Line 1806 of yacc.c */
+/* Line 1787 of yacc.c */
#line 292 "util/configparser.y"
{
OUTYY(("P(server_outgoing_port_permit:%s)\n", (yyvsp[(2) - (2)].str)));
@@ -2257,8 +2252,7 @@ yyreduce:
break;
case 135:
-
-/* Line 1806 of yacc.c */
+/* Line 1787 of yacc.c */
#line 301 "util/configparser.y"
{
OUTYY(("P(server_outgoing_port_avoid:%s)\n", (yyvsp[(2) - (2)].str)));
@@ -2270,8 +2264,7 @@ yyreduce:
break;
case 136:
-
-/* Line 1806 of yacc.c */
+/* Line 1787 of yacc.c */
#line 310 "util/configparser.y"
{
OUTYY(("P(server_outgoing_num_tcp:%s)\n", (yyvsp[(2) - (2)].str)));
@@ -2283,8 +2276,7 @@ yyreduce:
break;
case 137:
-
-/* Line 1806 of yacc.c */
+/* Line 1787 of yacc.c */
#line 319 "util/configparser.y"
{
OUTYY(("P(server_incoming_num_tcp:%s)\n", (yyvsp[(2) - (2)].str)));
@@ -2296,8 +2288,7 @@ yyreduce:
break;
case 138:
-
-/* Line 1806 of yacc.c */
+/* Line 1787 of yacc.c */
#line 328 "util/configparser.y"
{
OUTYY(("P(server_interface_automatic:%s)\n", (yyvsp[(2) - (2)].str)));
@@ -2309,8 +2300,7 @@ yyreduce:
break;
case 139:
-
-/* Line 1806 of yacc.c */
+/* Line 1787 of yacc.c */
#line 337 "util/configparser.y"
{
OUTYY(("P(server_do_ip4:%s)\n", (yyvsp[(2) - (2)].str)));
@@ -2322,8 +2312,7 @@ yyreduce:
break;
case 140:
-
-/* Line 1806 of yacc.c */
+/* Line 1787 of yacc.c */
#line 346 "util/configparser.y"
{
OUTYY(("P(server_do_ip6:%s)\n", (yyvsp[(2) - (2)].str)));
@@ -2335,8 +2324,7 @@ yyreduce:
break;
case 141:
-
-/* Line 1806 of yacc.c */
+/* Line 1787 of yacc.c */
#line 355 "util/configparser.y"
{
OUTYY(("P(server_do_udp:%s)\n", (yyvsp[(2) - (2)].str)));
@@ -2348,8 +2336,7 @@ yyreduce:
break;
case 142:
-
-/* Line 1806 of yacc.c */
+/* Line 1787 of yacc.c */
#line 364 "util/configparser.y"
{
OUTYY(("P(server_do_tcp:%s)\n", (yyvsp[(2) - (2)].str)));
@@ -2361,8 +2348,7 @@ yyreduce:
break;
case 143:
-
-/* Line 1806 of yacc.c */
+/* Line 1787 of yacc.c */
#line 373 "util/configparser.y"
{
OUTYY(("P(server_tcp_upstream:%s)\n", (yyvsp[(2) - (2)].str)));
@@ -2374,8 +2360,7 @@ yyreduce:
break;
case 144:
-
-/* Line 1806 of yacc.c */
+/* Line 1787 of yacc.c */
#line 382 "util/configparser.y"
{
OUTYY(("P(server_ssl_upstream:%s)\n", (yyvsp[(2) - (2)].str)));
@@ -2387,8 +2372,7 @@ yyreduce:
break;
case 145:
-
-/* Line 1806 of yacc.c */
+/* Line 1787 of yacc.c */
#line 391 "util/configparser.y"
{
OUTYY(("P(server_ssl_service_key:%s)\n", (yyvsp[(2) - (2)].str)));
@@ -2398,8 +2382,7 @@ yyreduce:
break;
case 146:
-
-/* Line 1806 of yacc.c */
+/* Line 1787 of yacc.c */
#line 398 "util/configparser.y"
{
OUTYY(("P(server_ssl_service_pem:%s)\n", (yyvsp[(2) - (2)].str)));
@@ -2409,8 +2392,7 @@ yyreduce:
break;
case 147:
-
-/* Line 1806 of yacc.c */
+/* Line 1787 of yacc.c */
#line 405 "util/configparser.y"
{
OUTYY(("P(server_ssl_port:%s)\n", (yyvsp[(2) - (2)].str)));
@@ -2422,8 +2404,7 @@ yyreduce:
break;
case 148:
-
-/* Line 1806 of yacc.c */
+/* Line 1787 of yacc.c */
#line 414 "util/configparser.y"
{
OUTYY(("P(server_do_daemonize:%s)\n", (yyvsp[(2) - (2)].str)));
@@ -2435,8 +2416,7 @@ yyreduce:
break;
case 149:
-
-/* Line 1806 of yacc.c */
+/* Line 1787 of yacc.c */
#line 423 "util/configparser.y"
{
OUTYY(("P(server_use_syslog:%s)\n", (yyvsp[(2) - (2)].str)));
@@ -2453,8 +2433,7 @@ yyreduce:
break;
case 150:
-
-/* Line 1806 of yacc.c */
+/* Line 1787 of yacc.c */
#line 437 "util/configparser.y"
{
OUTYY(("P(server_log_time_ascii:%s)\n", (yyvsp[(2) - (2)].str)));
@@ -2466,8 +2445,7 @@ yyreduce:
break;
case 151:
-
-/* Line 1806 of yacc.c */
+/* Line 1787 of yacc.c */
#line 446 "util/configparser.y"
{
OUTYY(("P(server_log_queries:%s)\n", (yyvsp[(2) - (2)].str)));
@@ -2479,8 +2457,7 @@ yyreduce:
break;
case 152:
-
-/* Line 1806 of yacc.c */
+/* Line 1787 of yacc.c */
#line 455 "util/configparser.y"
{
OUTYY(("P(server_chroot:%s)\n", (yyvsp[(2) - (2)].str)));
@@ -2490,8 +2467,7 @@ yyreduce:
break;
case 153:
-
-/* Line 1806 of yacc.c */
+/* Line 1787 of yacc.c */
#line 462 "util/configparser.y"
{
OUTYY(("P(server_username:%s)\n", (yyvsp[(2) - (2)].str)));
@@ -2501,8 +2477,7 @@ yyreduce:
break;
case 154:
-
-/* Line 1806 of yacc.c */
+/* Line 1787 of yacc.c */
#line 469 "util/configparser.y"
{
OUTYY(("P(server_directory:%s)\n", (yyvsp[(2) - (2)].str)));
@@ -2512,8 +2487,7 @@ yyreduce:
break;
case 155:
-
-/* Line 1806 of yacc.c */
+/* Line 1787 of yacc.c */
#line 476 "util/configparser.y"
{
OUTYY(("P(server_logfile:%s)\n", (yyvsp[(2) - (2)].str)));
@@ -2524,8 +2498,7 @@ yyreduce:
break;
case 156:
-
-/* Line 1806 of yacc.c */
+/* Line 1787 of yacc.c */
#line 484 "util/configparser.y"
{
OUTYY(("P(server_pidfile:%s)\n", (yyvsp[(2) - (2)].str)));
@@ -2535,8 +2508,7 @@ yyreduce:
break;
case 157:
-
-/* Line 1806 of yacc.c */
+/* Line 1787 of yacc.c */
#line 491 "util/configparser.y"
{
OUTYY(("P(server_root_hints:%s)\n", (yyvsp[(2) - (2)].str)));
@@ -2546,8 +2518,7 @@ yyreduce:
break;
case 158:
-
-/* Line 1806 of yacc.c */
+/* Line 1787 of yacc.c */
#line 498 "util/configparser.y"
{
OUTYY(("P(server_dlv_anchor_file:%s)\n", (yyvsp[(2) - (2)].str)));
@@ -2557,8 +2528,7 @@ yyreduce:
break;
case 159:
-
-/* Line 1806 of yacc.c */
+/* Line 1787 of yacc.c */
#line 505 "util/configparser.y"
{
OUTYY(("P(server_dlv_anchor:%s)\n", (yyvsp[(2) - (2)].str)));
@@ -2568,8 +2538,7 @@ yyreduce:
break;
case 160:
-
-/* Line 1806 of yacc.c */
+/* Line 1787 of yacc.c */
#line 512 "util/configparser.y"
{
OUTYY(("P(server_auto_trust_anchor_file:%s)\n", (yyvsp[(2) - (2)].str)));
@@ -2580,8 +2549,7 @@ yyreduce:
break;
case 161:
-
-/* Line 1806 of yacc.c */
+/* Line 1787 of yacc.c */
#line 520 "util/configparser.y"
{
OUTYY(("P(server_trust_anchor_file:%s)\n", (yyvsp[(2) - (2)].str)));
@@ -2592,8 +2560,7 @@ yyreduce:
break;
case 162:
-
-/* Line 1806 of yacc.c */
+/* Line 1787 of yacc.c */
#line 528 "util/configparser.y"
{
OUTYY(("P(server_trusted_keys_file:%s)\n", (yyvsp[(2) - (2)].str)));
@@ -2604,8 +2571,7 @@ yyreduce:
break;
case 163:
-
-/* Line 1806 of yacc.c */
+/* Line 1787 of yacc.c */
#line 536 "util/configparser.y"
{
OUTYY(("P(server_trust_anchor:%s)\n", (yyvsp[(2) - (2)].str)));
@@ -2615,8 +2581,7 @@ yyreduce:
break;
case 164:
-
-/* Line 1806 of yacc.c */
+/* Line 1787 of yacc.c */
#line 543 "util/configparser.y"
{
OUTYY(("P(server_domain_insecure:%s)\n", (yyvsp[(2) - (2)].str)));
@@ -2626,8 +2591,7 @@ yyreduce:
break;
case 165:
-
-/* Line 1806 of yacc.c */
+/* Line 1787 of yacc.c */
#line 550 "util/configparser.y"
{
OUTYY(("P(server_hide_identity:%s)\n", (yyvsp[(2) - (2)].str)));
@@ -2639,8 +2603,7 @@ yyreduce:
break;
case 166:
-
-/* Line 1806 of yacc.c */
+/* Line 1787 of yacc.c */
#line 559 "util/configparser.y"
{
OUTYY(("P(server_hide_version:%s)\n", (yyvsp[(2) - (2)].str)));
@@ -2652,8 +2615,7 @@ yyreduce:
break;
case 167:
-
-/* Line 1806 of yacc.c */
+/* Line 1787 of yacc.c */
#line 568 "util/configparser.y"
{
OUTYY(("P(server_identity:%s)\n", (yyvsp[(2) - (2)].str)));
@@ -2663,8 +2625,7 @@ yyreduce:
break;
case 168:
-
-/* Line 1806 of yacc.c */
+/* Line 1787 of yacc.c */
#line 575 "util/configparser.y"
{
OUTYY(("P(server_version:%s)\n", (yyvsp[(2) - (2)].str)));
@@ -2674,8 +2635,7 @@ yyreduce:
break;
case 169:
-
-/* Line 1806 of yacc.c */
+/* Line 1787 of yacc.c */
#line 582 "util/configparser.y"
{
OUTYY(("P(server_so_rcvbuf:%s)\n", (yyvsp[(2) - (2)].str)));
@@ -2686,8 +2646,7 @@ yyreduce:
break;
case 170:
-
-/* Line 1806 of yacc.c */
+/* Line 1787 of yacc.c */
#line 590 "util/configparser.y"
{
OUTYY(("P(server_so_sndbuf:%s)\n", (yyvsp[(2) - (2)].str)));
@@ -2698,8 +2657,7 @@ yyreduce:
break;
case 171:
-
-/* Line 1806 of yacc.c */
+/* Line 1787 of yacc.c */
#line 598 "util/configparser.y"
{
OUTYY(("P(server_edns_buffer_size:%s)\n", (yyvsp[(2) - (2)].str)));
@@ -2715,8 +2673,7 @@ yyreduce:
break;
case 172:
-
-/* Line 1806 of yacc.c */
+/* Line 1787 of yacc.c */
#line 611 "util/configparser.y"
{
OUTYY(("P(server_msg_buffer_size:%s)\n", (yyvsp[(2) - (2)].str)));
@@ -2730,8 +2687,7 @@ yyreduce:
break;
case 173:
-
-/* Line 1806 of yacc.c */
+/* Line 1787 of yacc.c */
#line 622 "util/configparser.y"
{
OUTYY(("P(server_msg_cache_size:%s)\n", (yyvsp[(2) - (2)].str)));
@@ -2742,8 +2698,7 @@ yyreduce:
break;
case 174:
-
-/* Line 1806 of yacc.c */
+/* Line 1787 of yacc.c */
#line 630 "util/configparser.y"
{
OUTYY(("P(server_msg_cache_slabs:%s)\n", (yyvsp[(2) - (2)].str)));
@@ -2759,8 +2714,7 @@ yyreduce:
break;
case 175:
-
-/* Line 1806 of yacc.c */
+/* Line 1787 of yacc.c */
#line 643 "util/configparser.y"
{
OUTYY(("P(server_num_queries_per_thread:%s)\n", (yyvsp[(2) - (2)].str)));
@@ -2772,8 +2726,7 @@ yyreduce:
break;
case 176:
-
-/* Line 1806 of yacc.c */
+/* Line 1787 of yacc.c */
#line 652 "util/configparser.y"
{
OUTYY(("P(server_jostle_timeout:%s)\n", (yyvsp[(2) - (2)].str)));
@@ -2785,8 +2738,7 @@ yyreduce:
break;
case 177:
-
-/* Line 1806 of yacc.c */
+/* Line 1787 of yacc.c */
#line 661 "util/configparser.y"
{
OUTYY(("P(server_rrset_cache_size:%s)\n", (yyvsp[(2) - (2)].str)));
@@ -2797,8 +2749,7 @@ yyreduce:
break;
case 178:
-
-/* Line 1806 of yacc.c */
+/* Line 1787 of yacc.c */
#line 669 "util/configparser.y"
{
OUTYY(("P(server_rrset_cache_slabs:%s)\n", (yyvsp[(2) - (2)].str)));
@@ -2814,8 +2765,7 @@ yyreduce:
break;
case 179:
-
-/* Line 1806 of yacc.c */
+/* Line 1787 of yacc.c */
#line 682 "util/configparser.y"
{
OUTYY(("P(server_infra_host_ttl:%s)\n", (yyvsp[(2) - (2)].str)));
@@ -2827,8 +2777,7 @@ yyreduce:
break;
case 180:
-
-/* Line 1806 of yacc.c */
+/* Line 1787 of yacc.c */
#line 691 "util/configparser.y"
{
OUTYY(("P(server_infra_lame_ttl:%s)\n", (yyvsp[(2) - (2)].str)));
@@ -2839,8 +2788,7 @@ yyreduce:
break;
case 181:
-
-/* Line 1806 of yacc.c */
+/* Line 1787 of yacc.c */
#line 699 "util/configparser.y"
{
OUTYY(("P(server_infra_cache_numhosts:%s)\n", (yyvsp[(2) - (2)].str)));
@@ -2852,8 +2800,7 @@ yyreduce:
break;
case 182:
-
-/* Line 1806 of yacc.c */
+/* Line 1787 of yacc.c */
#line 708 "util/configparser.y"
{
OUTYY(("P(server_infra_cache_lame_size:%s)\n", (yyvsp[(2) - (2)].str)));
@@ -2864,8 +2811,7 @@ yyreduce:
break;
case 183:
-
-/* Line 1806 of yacc.c */
+/* Line 1787 of yacc.c */
#line 716 "util/configparser.y"
{
OUTYY(("P(server_infra_cache_slabs:%s)\n", (yyvsp[(2) - (2)].str)));
@@ -2881,8 +2827,7 @@ yyreduce:
break;
case 184:
-
-/* Line 1806 of yacc.c */
+/* Line 1787 of yacc.c */
#line 729 "util/configparser.y"
{
OUTYY(("P(server_target_fetch_policy:%s)\n", (yyvsp[(2) - (2)].str)));
@@ -2892,8 +2837,7 @@ yyreduce:
break;
case 185:
-
-/* Line 1806 of yacc.c */
+/* Line 1787 of yacc.c */
#line 736 "util/configparser.y"
{
OUTYY(("P(server_harden_short_bufsize:%s)\n", (yyvsp[(2) - (2)].str)));
@@ -2906,8 +2850,7 @@ yyreduce:
break;
case 186:
-
-/* Line 1806 of yacc.c */
+/* Line 1787 of yacc.c */
#line 746 "util/configparser.y"
{
OUTYY(("P(server_harden_large_queries:%s)\n", (yyvsp[(2) - (2)].str)));
@@ -2920,8 +2863,7 @@ yyreduce:
break;
case 187:
-
-/* Line 1806 of yacc.c */
+/* Line 1787 of yacc.c */
#line 756 "util/configparser.y"
{
OUTYY(("P(server_harden_glue:%s)\n", (yyvsp[(2) - (2)].str)));
@@ -2934,8 +2876,7 @@ yyreduce:
break;
case 188:
-
-/* Line 1806 of yacc.c */
+/* Line 1787 of yacc.c */
#line 766 "util/configparser.y"
{
OUTYY(("P(server_harden_dnssec_stripped:%s)\n", (yyvsp[(2) - (2)].str)));
@@ -2948,8 +2889,7 @@ yyreduce:
break;
case 189:
-
-/* Line 1806 of yacc.c */
+/* Line 1787 of yacc.c */
#line 776 "util/configparser.y"
{
OUTYY(("P(server_harden_below_nxdomain:%s)\n", (yyvsp[(2) - (2)].str)));
@@ -2962,8 +2902,7 @@ yyreduce:
break;
case 190:
-
-/* Line 1806 of yacc.c */
+/* Line 1787 of yacc.c */
#line 786 "util/configparser.y"
{
OUTYY(("P(server_harden_referral_path:%s)\n", (yyvsp[(2) - (2)].str)));
@@ -2976,8 +2915,7 @@ yyreduce:
break;
case 191:
-
-/* Line 1806 of yacc.c */
+/* Line 1787 of yacc.c */
#line 796 "util/configparser.y"
{
OUTYY(("P(server_use_caps_for_id:%s)\n", (yyvsp[(2) - (2)].str)));
@@ -2990,8 +2928,7 @@ yyreduce:
break;
case 192:
-
-/* Line 1806 of yacc.c */
+/* Line 1787 of yacc.c */
#line 806 "util/configparser.y"
{
OUTYY(("P(server_private_address:%s)\n", (yyvsp[(2) - (2)].str)));
@@ -3001,8 +2938,7 @@ yyreduce:
break;
case 193:
-
-/* Line 1806 of yacc.c */
+/* Line 1787 of yacc.c */
#line 813 "util/configparser.y"
{
OUTYY(("P(server_private_domain:%s)\n", (yyvsp[(2) - (2)].str)));
@@ -3012,8 +2948,7 @@ yyreduce:
break;
case 194:
-
-/* Line 1806 of yacc.c */
+/* Line 1787 of yacc.c */
#line 820 "util/configparser.y"
{
OUTYY(("P(server_prefetch:%s)\n", (yyvsp[(2) - (2)].str)));
@@ -3025,8 +2960,7 @@ yyreduce:
break;
case 195:
-
-/* Line 1806 of yacc.c */
+/* Line 1787 of yacc.c */
#line 829 "util/configparser.y"
{
OUTYY(("P(server_prefetch_key:%s)\n", (yyvsp[(2) - (2)].str)));
@@ -3038,8 +2972,7 @@ yyreduce:
break;
case 196:
-
-/* Line 1806 of yacc.c */
+/* Line 1787 of yacc.c */
#line 838 "util/configparser.y"
{
OUTYY(("P(server_unwanted_reply_threshold:%s)\n", (yyvsp[(2) - (2)].str)));
@@ -3051,8 +2984,7 @@ yyreduce:
break;
case 197:
-
-/* Line 1806 of yacc.c */
+/* Line 1787 of yacc.c */
#line 847 "util/configparser.y"
{
OUTYY(("P(server_do_not_query_address:%s)\n", (yyvsp[(2) - (2)].str)));
@@ -3062,8 +2994,7 @@ yyreduce:
break;
case 198:
-
-/* Line 1806 of yacc.c */
+/* Line 1787 of yacc.c */
#line 854 "util/configparser.y"
{
OUTYY(("P(server_do_not_query_localhost:%s)\n", (yyvsp[(2) - (2)].str)));
@@ -3076,8 +3007,7 @@ yyreduce:
break;
case 199:
-
-/* Line 1806 of yacc.c */
+/* Line 1787 of yacc.c */
#line 864 "util/configparser.y"
{
OUTYY(("P(server_access_control:%s %s)\n", (yyvsp[(2) - (3)].str), (yyvsp[(3) - (3)].str)));
@@ -3094,8 +3024,7 @@ yyreduce:
break;
case 200:
-
-/* Line 1806 of yacc.c */
+/* Line 1787 of yacc.c */
#line 878 "util/configparser.y"
{
OUTYY(("P(server_module_conf:%s)\n", (yyvsp[(2) - (2)].str)));
@@ -3105,8 +3034,7 @@ yyreduce:
break;
case 201:
-
-/* Line 1806 of yacc.c */
+/* Line 1787 of yacc.c */
#line 885 "util/configparser.y"
{
OUTYY(("P(server_val_override_date:%s)\n", (yyvsp[(2) - (2)].str)));
@@ -3127,8 +3055,7 @@ yyreduce:
break;
case 202:
-
-/* Line 1806 of yacc.c */
+/* Line 1787 of yacc.c */
#line 903 "util/configparser.y"
{
OUTYY(("P(server_val_sig_skew_min:%s)\n", (yyvsp[(2) - (2)].str)));
@@ -3144,8 +3071,7 @@ yyreduce:
break;
case 203:
-
-/* Line 1806 of yacc.c */
+/* Line 1787 of yacc.c */
#line 916 "util/configparser.y"
{
OUTYY(("P(server_val_sig_skew_max:%s)\n", (yyvsp[(2) - (2)].str)));
@@ -3161,8 +3087,7 @@ yyreduce:
break;
case 204:
-
-/* Line 1806 of yacc.c */
+/* Line 1787 of yacc.c */
#line 929 "util/configparser.y"
{
OUTYY(("P(server_cache_max_ttl:%s)\n", (yyvsp[(2) - (2)].str)));
@@ -3174,8 +3099,7 @@ yyreduce:
break;
case 205:
-
-/* Line 1806 of yacc.c */
+/* Line 1787 of yacc.c */
#line 938 "util/configparser.y"
{
OUTYY(("P(server_cache_min_ttl:%s)\n", (yyvsp[(2) - (2)].str)));
@@ -3187,8 +3111,7 @@ yyreduce:
break;
case 206:
-
-/* Line 1806 of yacc.c */
+/* Line 1787 of yacc.c */
#line 947 "util/configparser.y"
{
OUTYY(("P(server_bogus_ttl:%s)\n", (yyvsp[(2) - (2)].str)));
@@ -3200,8 +3123,7 @@ yyreduce:
break;
case 207:
-
-/* Line 1806 of yacc.c */
+/* Line 1787 of yacc.c */
#line 956 "util/configparser.y"
{
OUTYY(("P(server_val_clean_additional:%s)\n", (yyvsp[(2) - (2)].str)));
@@ -3214,8 +3136,7 @@ yyreduce:
break;
case 208:
-
-/* Line 1806 of yacc.c */
+/* Line 1787 of yacc.c */
#line 966 "util/configparser.y"
{
OUTYY(("P(server_val_permissive_mode:%s)\n", (yyvsp[(2) - (2)].str)));
@@ -3228,8 +3149,7 @@ yyreduce:
break;
case 209:
-
-/* Line 1806 of yacc.c */
+/* Line 1787 of yacc.c */
#line 976 "util/configparser.y"
{
OUTYY(("P(server_ignore_cd_flag:%s)\n", (yyvsp[(2) - (2)].str)));
@@ -3241,8 +3161,7 @@ yyreduce:
break;
case 210:
-
-/* Line 1806 of yacc.c */
+/* Line 1787 of yacc.c */
#line 985 "util/configparser.y"
{
OUTYY(("P(server_val_log_level:%s)\n", (yyvsp[(2) - (2)].str)));
@@ -3254,8 +3173,7 @@ yyreduce:
break;
case 211:
-
-/* Line 1806 of yacc.c */
+/* Line 1787 of yacc.c */
#line 994 "util/configparser.y"
{
OUTYY(("P(server_val_nsec3_keysize_iterations:%s)\n", (yyvsp[(2) - (2)].str)));
@@ -3265,8 +3183,7 @@ yyreduce:
break;
case 212:
-
-/* Line 1806 of yacc.c */
+/* Line 1787 of yacc.c */
#line 1001 "util/configparser.y"
{
OUTYY(("P(server_add_holddown:%s)\n", (yyvsp[(2) - (2)].str)));
@@ -3278,8 +3195,7 @@ yyreduce:
break;
case 213:
-
-/* Line 1806 of yacc.c */
+/* Line 1787 of yacc.c */
#line 1010 "util/configparser.y"
{
OUTYY(("P(server_del_holddown:%s)\n", (yyvsp[(2) - (2)].str)));
@@ -3291,8 +3207,7 @@ yyreduce:
break;
case 214:
-
-/* Line 1806 of yacc.c */
+/* Line 1787 of yacc.c */
#line 1019 "util/configparser.y"
{
OUTYY(("P(server_keep_missing:%s)\n", (yyvsp[(2) - (2)].str)));
@@ -3304,8 +3219,7 @@ yyreduce:
break;
case 215:
-
-/* Line 1806 of yacc.c */
+/* Line 1787 of yacc.c */
#line 1028 "util/configparser.y"
{
OUTYY(("P(server_key_cache_size:%s)\n", (yyvsp[(2) - (2)].str)));
@@ -3316,8 +3230,7 @@ yyreduce:
break;
case 216:
-
-/* Line 1806 of yacc.c */
+/* Line 1787 of yacc.c */
#line 1036 "util/configparser.y"
{
OUTYY(("P(server_key_cache_slabs:%s)\n", (yyvsp[(2) - (2)].str)));
@@ -3333,8 +3246,7 @@ yyreduce:
break;
case 217:
-
-/* Line 1806 of yacc.c */
+/* Line 1787 of yacc.c */
#line 1049 "util/configparser.y"
{
OUTYY(("P(server_neg_cache_size:%s)\n", (yyvsp[(2) - (2)].str)));
@@ -3345,8 +3257,7 @@ yyreduce:
break;
case 218:
-
-/* Line 1806 of yacc.c */
+/* Line 1787 of yacc.c */
#line 1057 "util/configparser.y"
{
OUTYY(("P(server_local_zone:%s %s)\n", (yyvsp[(2) - (3)].str), (yyvsp[(3) - (3)].str)));
@@ -3371,8 +3282,7 @@ yyreduce:
break;
case 219:
-
-/* Line 1806 of yacc.c */
+/* Line 1787 of yacc.c */
#line 1079 "util/configparser.y"
{
OUTYY(("P(server_local_data:%s)\n", (yyvsp[(2) - (2)].str)));
@@ -3382,8 +3292,7 @@ yyreduce:
break;
case 220:
-
-/* Line 1806 of yacc.c */
+/* Line 1787 of yacc.c */
#line 1086 "util/configparser.y"
{
char* ptr;
@@ -3401,8 +3310,7 @@ yyreduce:
break;
case 221:
-
-/* Line 1806 of yacc.c */
+/* Line 1787 of yacc.c */
#line 1101 "util/configparser.y"
{
OUTYY(("P(server_minimal_responses:%s)\n", (yyvsp[(2) - (2)].str)));
@@ -3415,8 +3323,7 @@ yyreduce:
break;
case 222:
-
-/* Line 1806 of yacc.c */
+/* Line 1787 of yacc.c */
#line 1111 "util/configparser.y"
{
OUTYY(("P(server_rrset_roundrobin:%s)\n", (yyvsp[(2) - (2)].str)));
@@ -3429,8 +3336,7 @@ yyreduce:
break;
case 223:
-
-/* Line 1806 of yacc.c */
+/* Line 1787 of yacc.c */
#line 1121 "util/configparser.y"
{
OUTYY(("P(name:%s)\n", (yyvsp[(2) - (2)].str)));
@@ -3443,8 +3349,7 @@ yyreduce:
break;
case 224:
-
-/* Line 1806 of yacc.c */
+/* Line 1787 of yacc.c */
#line 1131 "util/configparser.y"
{
OUTYY(("P(stub-host:%s)\n", (yyvsp[(2) - (2)].str)));
@@ -3454,8 +3359,7 @@ yyreduce:
break;
case 225:
-
-/* Line 1806 of yacc.c */
+/* Line 1787 of yacc.c */
#line 1138 "util/configparser.y"
{
OUTYY(("P(stub-addr:%s)\n", (yyvsp[(2) - (2)].str)));
@@ -3465,8 +3369,7 @@ yyreduce:
break;
case 226:
-
-/* Line 1806 of yacc.c */
+/* Line 1787 of yacc.c */
#line 1145 "util/configparser.y"
{
OUTYY(("P(stub-first:%s)\n", (yyvsp[(2) - (2)].str)));
@@ -3478,8 +3381,7 @@ yyreduce:
break;
case 227:
-
-/* Line 1806 of yacc.c */
+/* Line 1787 of yacc.c */
#line 1154 "util/configparser.y"
{
OUTYY(("P(stub-prime:%s)\n", (yyvsp[(2) - (2)].str)));
@@ -3492,8 +3394,7 @@ yyreduce:
break;
case 228:
-
-/* Line 1806 of yacc.c */
+/* Line 1787 of yacc.c */
#line 1164 "util/configparser.y"
{
OUTYY(("P(name:%s)\n", (yyvsp[(2) - (2)].str)));
@@ -3506,8 +3407,7 @@ yyreduce:
break;
case 229:
-
-/* Line 1806 of yacc.c */
+/* Line 1787 of yacc.c */
#line 1174 "util/configparser.y"
{
OUTYY(("P(forward-host:%s)\n", (yyvsp[(2) - (2)].str)));
@@ -3517,8 +3417,7 @@ yyreduce:
break;
case 230:
-
-/* Line 1806 of yacc.c */
+/* Line 1787 of yacc.c */
#line 1181 "util/configparser.y"
{
OUTYY(("P(forward-addr:%s)\n", (yyvsp[(2) - (2)].str)));
@@ -3528,8 +3427,7 @@ yyreduce:
break;
case 231:
-
-/* Line 1806 of yacc.c */
+/* Line 1787 of yacc.c */
#line 1188 "util/configparser.y"
{
OUTYY(("P(forward-first:%s)\n", (yyvsp[(2) - (2)].str)));
@@ -3541,8 +3439,7 @@ yyreduce:
break;
case 232:
-
-/* Line 1806 of yacc.c */
+/* Line 1787 of yacc.c */
#line 1197 "util/configparser.y"
{
OUTYY(("\nP(remote-control:)\n"));
@@ -3550,8 +3447,7 @@ yyreduce:
break;
case 242:
-
-/* Line 1806 of yacc.c */
+/* Line 1787 of yacc.c */
#line 1208 "util/configparser.y"
{
OUTYY(("P(control_enable:%s)\n", (yyvsp[(2) - (2)].str)));
@@ -3564,8 +3460,7 @@ yyreduce:
break;
case 243:
-
-/* Line 1806 of yacc.c */
+/* Line 1787 of yacc.c */
#line 1218 "util/configparser.y"
{
OUTYY(("P(control_port:%s)\n", (yyvsp[(2) - (2)].str)));
@@ -3577,8 +3472,7 @@ yyreduce:
break;
case 244:
-
-/* Line 1806 of yacc.c */
+/* Line 1787 of yacc.c */
#line 1227 "util/configparser.y"
{
OUTYY(("P(control_interface:%s)\n", (yyvsp[(2) - (2)].str)));
@@ -3588,8 +3482,7 @@ yyreduce:
break;
case 245:
-
-/* Line 1806 of yacc.c */
+/* Line 1787 of yacc.c */
#line 1234 "util/configparser.y"
{
OUTYY(("P(rc_server_key_file:%s)\n", (yyvsp[(2) - (2)].str)));
@@ -3599,8 +3492,7 @@ yyreduce:
break;
case 246:
-
-/* Line 1806 of yacc.c */
+/* Line 1787 of yacc.c */
#line 1241 "util/configparser.y"
{
OUTYY(("P(rc_server_cert_file:%s)\n", (yyvsp[(2) - (2)].str)));
@@ -3610,8 +3502,7 @@ yyreduce:
break;
case 247:
-
-/* Line 1806 of yacc.c */
+/* Line 1787 of yacc.c */
#line 1248 "util/configparser.y"
{
OUTYY(("P(rc_control_key_file:%s)\n", (yyvsp[(2) - (2)].str)));
@@ -3621,8 +3512,7 @@ yyreduce:
break;
case 248:
-
-/* Line 1806 of yacc.c */
+/* Line 1787 of yacc.c */
#line 1255 "util/configparser.y"
{
OUTYY(("P(rc_control_cert_file:%s)\n", (yyvsp[(2) - (2)].str)));
@@ -3632,8 +3522,7 @@ yyreduce:
break;
case 249:
-
-/* Line 1806 of yacc.c */
+/* Line 1787 of yacc.c */
#line 1262 "util/configparser.y"
{
OUTYY(("\nP(python:)\n"));
@@ -3641,8 +3530,7 @@ yyreduce:
break;
case 253:
-
-/* Line 1806 of yacc.c */
+/* Line 1787 of yacc.c */
#line 1271 "util/configparser.y"
{
OUTYY(("P(python-script:%s)\n", (yyvsp[(2) - (2)].str)));
@@ -3652,9 +3540,8 @@ yyreduce:
break;
-
-/* Line 1806 of yacc.c */
-#line 3658 "util/configparser.c"
+/* Line 1787 of yacc.c */
+#line 3545 "util/configparser.c"
default: break;
}
/* User semantic actions sometimes alter yychar, and that requires
@@ -3841,7 +3728,7 @@ yyabortlab:
yyresult = 1;
goto yyreturn;
-#if !defined(yyoverflow) || YYERROR_VERBOSE
+#if !defined yyoverflow || YYERROR_VERBOSE
/*-------------------------------------------------.
| yyexhaustedlab -- memory exhaustion comes here. |
`-------------------------------------------------*/
@@ -3883,8 +3770,7 @@ yyreturn:
}
-
-/* Line 2067 of yacc.c */
+/* Line 2048 of yacc.c */
#line 1276 "util/configparser.y"
diff --git a/contrib/unbound/util/configparser.h b/contrib/unbound/util/configparser.h
index 06dd5d9f3071..8d9c3c4826eb 100644
--- a/contrib/unbound/util/configparser.h
+++ b/contrib/unbound/util/configparser.h
@@ -1,8 +1,8 @@
-/* A Bison parser, made by GNU Bison 2.5. */
+/* A Bison parser, made by GNU Bison 2.6.1. */
/* Bison interface for Yacc-like parsers in C
- Copyright (C) 1984, 1989-1990, 2000-2011 Free Software Foundation, Inc.
+ Copyright (C) 1984, 1989-1990, 2000-2012 Free Software Foundation, Inc.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -30,6 +30,15 @@
This special exception was added by the Free Software Foundation in
version 2.2 of Bison. */
+#ifndef YY_UTIL_CONFIGPARSER_H
+# define YY_UTIL_CONFIGPARSER_H
+/* Enabling traces. */
+#ifndef YYDEBUG
+# define YYDEBUG 0
+#endif
+#if YYDEBUG
+extern int yydebug;
+#endif
/* Tokens. */
#ifndef YYTOKENTYPE
@@ -297,20 +306,17 @@
-
#if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED
typedef union YYSTYPE
{
-
-/* Line 2068 of yacc.c */
+/* Line 2049 of yacc.c */
#line 64 "util/configparser.y"
char* str;
-
-/* Line 2068 of yacc.c */
-#line 314 "util/configparser.h"
+/* Line 2049 of yacc.c */
+#line 320 "util/configparser.h"
} YYSTYPE;
# define YYSTYPE_IS_TRIVIAL 1
# define yystype YYSTYPE /* obsolescent; will be withdrawn */
@@ -319,4 +325,18 @@ typedef union YYSTYPE
extern YYSTYPE yylval;
+#ifdef YYPARSE_PARAM
+#if defined __STDC__ || defined __cplusplus
+int yyparse (void *YYPARSE_PARAM);
+#else
+int yyparse ();
+#endif
+#else /* ! YYPARSE_PARAM */
+#if defined __STDC__ || defined __cplusplus
+int yyparse (void);
+#else
+int yyparse ();
+#endif
+#endif /* ! YYPARSE_PARAM */
+#endif /* !YY_UTIL_CONFIGPARSER_H */
diff --git a/contrib/unbound/util/data/msgparse.c b/contrib/unbound/util/data/msgparse.c
index a03f543e827b..2791ae560865 100644
--- a/contrib/unbound/util/data/msgparse.c
+++ b/contrib/unbound/util/data/msgparse.c
@@ -39,7 +39,6 @@
#include "config.h"
#include <ldns/ldns.h>
#include "util/data/msgparse.h"
-#include "util/net_help.h"
#include "util/data/dname.h"
#include "util/data/packed_rrset.h"
#include "util/storage/lookup3.h"
@@ -655,8 +654,10 @@ calc_size(ldns_buffer* pkt, uint16_t type, struct rr_parse* rr)
len = 0;
break;
case LDNS_RDF_TYPE_STR:
- if(pkt_len < 1)
+ if(pkt_len < 1) {
+ /* NOTREACHED, due to 'while(>0)' */
return 0; /* len byte exceeds rdata */
+ }
len = ldns_buffer_current(pkt)[0] + 1;
break;
default:
diff --git a/contrib/unbound/util/iana_ports.inc b/contrib/unbound/util/iana_ports.inc
index 8508d7e9f014..c2c7a2156403 100644
--- a/contrib/unbound/util/iana_ports.inc
+++ b/contrib/unbound/util/iana_ports.inc
@@ -692,7 +692,7 @@
1022,
1025,
1026,
-1028,
+1027,
1029,
1030,
1031,
@@ -895,6 +895,7 @@
1229,
1230,
1231,
+1232,
1233,
1234,
1235,
@@ -3848,6 +3849,7 @@
4425,
4426,
4430,
+4432,
4441,
4442,
4443,
@@ -3870,6 +3872,7 @@
4486,
4488,
4500,
+4534,
4535,
4536,
4537,
@@ -3957,6 +3960,7 @@
4743,
4744,
4745,
+4747,
4749,
4750,
4751,
@@ -4053,6 +4057,7 @@
5050,
5051,
5052,
+5053,
5055,
5056,
5057,
@@ -4232,6 +4237,7 @@
5556,
5567,
5568,
+5569,
5573,
5580,
5581,
@@ -4256,6 +4262,7 @@
5632,
5633,
5634,
+5670,
5671,
5672,
5673,
@@ -4350,6 +4357,7 @@
6085,
6086,
6087,
+6088,
6100,
6101,
6102,
@@ -4363,6 +4371,7 @@
6110,
6111,
6112,
+6118,
6122,
6123,
6124,
@@ -4382,6 +4391,7 @@
6162,
6163,
6200,
+6201,
6222,
6241,
6242,
@@ -4397,6 +4407,7 @@
6306,
6315,
6316,
+6317,
6320,
6321,
6322,
@@ -4441,6 +4452,7 @@
6508,
6509,
6510,
+6511,
6514,
6515,
6543,
@@ -4466,6 +4478,7 @@
6626,
6627,
6628,
+6633,
6657,
6670,
6671,
@@ -4485,6 +4498,7 @@
6769,
6770,
6771,
+6784,
6785,
6786,
6787,
@@ -4541,6 +4555,7 @@
7070,
7071,
7080,
+7095,
7099,
7100,
7101,
@@ -4651,6 +4666,7 @@
7799,
7800,
7801,
+7802,
7810,
7845,
7846,
@@ -4694,6 +4710,7 @@
8057,
8058,
8059,
+8060,
8074,
8080,
8081,
@@ -4758,6 +4775,7 @@
8442,
8443,
8444,
+8445,
8450,
8472,
8473,
@@ -4768,6 +4786,7 @@
8555,
8567,
8600,
+8609,
8610,
8611,
8612,
@@ -4781,6 +4800,7 @@
8763,
8764,
8765,
+8766,
8770,
8786,
8787,
@@ -4866,6 +4886,7 @@
9217,
9222,
9255,
+9277,
9278,
9279,
9280,
@@ -4929,7 +4950,7 @@
9801,
9802,
9875,
-9876,
+9878,
9888,
9889,
9898,
@@ -5000,6 +5021,7 @@
10805,
10810,
10860,
+10880,
10990,
11000,
11001,
@@ -5023,6 +5045,7 @@
11600,
11720,
11751,
+11796,
11876,
11877,
11967,
@@ -5067,9 +5090,11 @@
13820,
13821,
13822,
+13894,
13929,
14000,
14001,
+14002,
14033,
14034,
14141,
@@ -5147,6 +5172,7 @@
19539,
19540,
19541,
+19788,
19999,
20000,
20001,
@@ -5210,6 +5236,7 @@
24242,
24249,
24321,
+24322,
24386,
24465,
24554,
@@ -5217,6 +5244,7 @@
24677,
24678,
24680,
+24850,
24922,
25000,
25001,
@@ -5233,6 +5261,8 @@
25901,
25902,
25903,
+25954,
+25955,
26000,
26133,
26208,
@@ -5250,6 +5280,7 @@
27999,
28000,
28119,
+28200,
28240,
29167,
30001,
@@ -5313,19 +5344,21 @@
42508,
42509,
42510,
+43000,
43188,
43189,
43190,
+43210,
43439,
43440,
43441,
44321,
44322,
-44323,
44544,
44553,
44600,
44818,
+44900,
45000,
45054,
45678,
@@ -5333,6 +5366,7 @@
45966,
46999,
47000,
+47100,
47557,
47624,
47806,
diff --git a/contrib/unbound/util/log.c b/contrib/unbound/util/log.c
index fc07dc6a9cba..8c09c7ce3122 100644
--- a/contrib/unbound/util/log.c
+++ b/contrib/unbound/util/log.c
@@ -171,6 +171,8 @@ log_vmsg(int pri, const char* type,
#if defined(HAVE_STRFTIME) && defined(HAVE_LOCALTIME_R)
char tmbuf[32];
struct tm tm;
+#elif defined(UB_ON_WINDOWS)
+ char tmbuf[128], dtbuf[128];
#endif
(void)pri;
vsnprintf(message, sizeof(message), format, args);
@@ -218,6 +220,13 @@ log_vmsg(int pri, const char* type,
fprintf(logfile, "%s %s[%d:%x] %s: %s\n", tmbuf,
ident, (int)getpid(), tid?*tid:0, type, message);
} else
+#elif defined(UB_ON_WINDOWS)
+ if(log_time_asc && GetTimeFormat(LOCALE_USER_DEFAULT, 0, NULL, NULL,
+ tmbuf, sizeof(tmbuf)) && GetDateFormat(LOCALE_USER_DEFAULT, 0,
+ NULL, NULL, dtbuf, sizeof(dtbuf))) {
+ fprintf(logfile, "%s %s %s[%d:%x] %s: %s\n", dtbuf, tmbuf,
+ ident, (int)getpid(), tid?*tid:0, type, message);
+ } else
#endif
fprintf(logfile, "[%u] %s[%d:%x] %s: %s\n", (unsigned)now,
ident, (int)getpid(), tid?*tid:0, type, message);
diff --git a/contrib/unbound/util/net_help.c b/contrib/unbound/util/net_help.c
index 6be5fcc3132a..64bd876dcbb1 100644
--- a/contrib/unbound/util/net_help.c
+++ b/contrib/unbound/util/net_help.c
@@ -45,8 +45,12 @@
#include "util/module.h"
#include "util/regional.h"
#include <fcntl.h>
+#ifdef HAVE_OPENSSL_SSL_H
#include <openssl/ssl.h>
+#endif
+#ifdef HAVE_OPENSSL_ERR_H
#include <openssl/err.h>
+#endif
/** max length of an IP address (the address portion) that we allow */
#define MAX_ADDR_STRLEN 128 /* characters */
@@ -565,6 +569,7 @@ void sock_list_merge(struct sock_list** list, struct regional* region,
void
log_crypto_err(const char* str)
{
+#ifdef HAVE_SSL
/* error:[error code]:[library name]:[function name]:[reason string] */
char buf[128];
unsigned long e;
@@ -574,10 +579,14 @@ log_crypto_err(const char* str)
ERR_error_string_n(e, buf, sizeof(buf));
log_err("and additionally crypto %s", buf);
}
+#else
+ (void)str;
+#endif /* HAVE_SSL */
}
void* listen_sslctx_create(char* key, char* pem, char* verifypem)
{
+#ifdef HAVE_SSL
SSL_CTX* ctx = SSL_CTX_new(SSLv23_server_method());
if(!ctx) {
log_crypto_err("could not SSL_CTX_new");
@@ -619,10 +628,15 @@ void* listen_sslctx_create(char* key, char* pem, char* verifypem)
SSL_CTX_set_verify(ctx, SSL_VERIFY_PEER, NULL);
}
return ctx;
+#else
+ (void)key; (void)pem; (void)verifypem;
+ return NULL;
+#endif
}
void* connect_sslctx_create(char* key, char* pem, char* verifypem)
{
+#ifdef HAVE_SSL
SSL_CTX* ctx = SSL_CTX_new(SSLv23_client_method());
if(!ctx) {
log_crypto_err("could not allocate SSL_CTX pointer");
@@ -662,10 +676,15 @@ void* connect_sslctx_create(char* key, char* pem, char* verifypem)
SSL_CTX_set_verify(ctx, SSL_VERIFY_PEER, NULL);
}
return ctx;
+#else
+ (void)key; (void)pem; (void)verifypem;
+ return NULL;
+#endif
}
void* incoming_ssl_fd(void* sslctx, int fd)
{
+#ifdef HAVE_SSL
SSL* ssl = SSL_new((SSL_CTX*)sslctx);
if(!ssl) {
log_crypto_err("could not SSL_new");
@@ -679,10 +698,15 @@ void* incoming_ssl_fd(void* sslctx, int fd)
return NULL;
}
return ssl;
+#else
+ (void)sslctx; (void)fd;
+ return NULL;
+#endif
}
void* outgoing_ssl_fd(void* sslctx, int fd)
{
+#ifdef HAVE_SSL
SSL* ssl = SSL_new((SSL_CTX*)sslctx);
if(!ssl) {
log_crypto_err("could not SSL_new");
@@ -696,4 +720,64 @@ void* outgoing_ssl_fd(void* sslctx, int fd)
return NULL;
}
return ssl;
+#else
+ (void)sslctx; (void)fd;
+ return NULL;
+#endif
+}
+
+#if defined(HAVE_SSL) && defined(OPENSSL_THREADS) && !defined(THREADS_DISABLED)
+/** global lock list for openssl locks */
+static lock_basic_t *ub_openssl_locks = NULL;
+
+/** callback that gets thread id for openssl */
+static unsigned long
+ub_crypto_id_cb(void)
+{
+ return (unsigned long)ub_thread_self();
}
+
+static void
+ub_crypto_lock_cb(int mode, int type, const char *ATTR_UNUSED(file),
+ int ATTR_UNUSED(line))
+{
+ if((mode&CRYPTO_LOCK)) {
+ lock_basic_lock(&ub_openssl_locks[type]);
+ } else {
+ lock_basic_unlock(&ub_openssl_locks[type]);
+ }
+}
+#endif /* OPENSSL_THREADS */
+
+int ub_openssl_lock_init(void)
+{
+#if defined(HAVE_SSL) && defined(OPENSSL_THREADS) && !defined(THREADS_DISABLED)
+ int i;
+ ub_openssl_locks = (lock_basic_t*)malloc(
+ sizeof(lock_basic_t)*CRYPTO_num_locks());
+ if(!ub_openssl_locks)
+ return 0;
+ for(i=0; i<CRYPTO_num_locks(); i++) {
+ lock_basic_init(&ub_openssl_locks[i]);
+ }
+ CRYPTO_set_id_callback(&ub_crypto_id_cb);
+ CRYPTO_set_locking_callback(&ub_crypto_lock_cb);
+#endif /* OPENSSL_THREADS */
+ return 1;
+}
+
+void ub_openssl_lock_delete(void)
+{
+#if defined(HAVE_SSL) && defined(OPENSSL_THREADS) && !defined(THREADS_DISABLED)
+ int i;
+ if(!ub_openssl_locks)
+ return;
+ CRYPTO_set_id_callback(NULL);
+ CRYPTO_set_locking_callback(NULL);
+ for(i=0; i<CRYPTO_num_locks(); i++) {
+ lock_basic_destroy(&ub_openssl_locks[i]);
+ }
+ free(ub_openssl_locks);
+#endif /* OPENSSL_THREADS */
+}
+
diff --git a/contrib/unbound/util/net_help.h b/contrib/unbound/util/net_help.h
index e0c0ebea1757..05b5087b4129 100644
--- a/contrib/unbound/util/net_help.h
+++ b/contrib/unbound/util/net_help.h
@@ -369,4 +369,15 @@ void* incoming_ssl_fd(void* sslctx, int fd);
*/
void* outgoing_ssl_fd(void* sslctx, int fd);
+/**
+ * Initialize openssl locking for thread safety
+ * @return false on failure (alloc failure).
+ */
+int ub_openssl_lock_init(void);
+
+/**
+ * De-init the allocated openssl locks
+ */
+void ub_openssl_lock_delete(void);
+
#endif /* NET_HELP_H */
diff --git a/contrib/unbound/util/netevent.c b/contrib/unbound/util/netevent.c
index 5b869765cc32..c5a7d8029f86 100644
--- a/contrib/unbound/util/netevent.c
+++ b/contrib/unbound/util/netevent.c
@@ -44,8 +44,12 @@
#include "util/log.h"
#include "util/net_help.h"
#include "util/fptr_wlist.h"
+#ifdef HAVE_OPENSSL_SSL_H
#include <openssl/ssl.h>
+#endif
+#ifdef HAVE_OPENSSL_ERR_H
#include <openssl/err.h>
+#endif
/* -------- Start of local definitions -------- */
/** if CMSG_ALIGN is not defined on this platform, a workaround */
@@ -91,7 +95,13 @@
# endif /* USE_WINSOCK */
#else /* USE_MINI_EVENT */
/* we use libevent */
-# include <event.h>
+# ifdef HAVE_EVENT_H
+# include <event.h>
+# else
+# include "event2/event.h"
+# include "event2/event_struct.h"
+# include "event2/event_compat.h"
+# endif
#endif /* USE_MINI_EVENT */
/**
@@ -846,9 +856,11 @@ reclaim_tcp_handler(struct comm_point* c)
{
log_assert(c->type == comm_tcp);
if(c->ssl) {
+#ifdef HAVE_SSL
SSL_shutdown(c->ssl);
SSL_free(c->ssl);
c->ssl = NULL;
+#endif
}
comm_point_close(c);
if(c->tcp_parent) {
@@ -893,6 +905,7 @@ tcp_callback_reader(struct comm_point* c)
}
/** continue ssl handshake */
+#ifdef HAVE_SSL
static int
ssl_handshake(struct comm_point* c)
{
@@ -955,11 +968,13 @@ ssl_handshake(struct comm_point* c)
c->ssl_shake_state = comm_ssl_shake_none;
return 1;
}
+#endif /* HAVE_SSL */
/** ssl read callback on TCP */
static int
ssl_handle_read(struct comm_point* c)
{
+#ifdef HAVE_SSL
int r;
if(c->ssl_shake_state != comm_ssl_shake_none) {
if(!ssl_handshake(c))
@@ -1036,12 +1051,17 @@ ssl_handle_read(struct comm_point* c)
tcp_callback_reader(c);
}
return 1;
+#else
+ (void)c;
+ return 0;
+#endif /* HAVE_SSL */
}
/** ssl write callback on TCP */
static int
ssl_handle_write(struct comm_point* c)
{
+#ifdef HAVE_SSL
int r;
if(c->ssl_shake_state != comm_ssl_shake_none) {
if(!ssl_handshake(c))
@@ -1115,6 +1135,10 @@ ssl_handle_write(struct comm_point* c)
tcp_callback_writer(c);
}
return 1;
+#else
+ (void)c;
+ return 0;
+#endif /* HAVE_SSL */
}
/** handle ssl tcp connection with dns contents */
@@ -1844,8 +1868,10 @@ comm_point_delete(struct comm_point* c)
if(!c)
return;
if(c->type == comm_tcp && c->ssl) {
+#ifdef HAVE_SSL
SSL_shutdown(c->ssl);
SSL_free(c->ssl);
+#endif
}
comm_point_close(c);
if(c->tcp_handlers) {
diff --git a/contrib/unbound/util/random.c b/contrib/unbound/util/random.c
index 72c58a2b4df5..5d71fcfa4c12 100644
--- a/contrib/unbound/util/random.c
+++ b/contrib/unbound/util/random.c
@@ -60,10 +60,25 @@
#include "config.h"
#include "util/random.h"
#include "util/log.h"
+#ifdef HAVE_SSL
#include <openssl/rand.h>
#include <openssl/rc4.h>
#include <openssl/err.h>
+#elif defined(HAVE_NSS)
+/* nspr4 */
+#include "prerror.h"
+/* nss3 */
+#include "secport.h"
+#include "pk11pub.h"
+#endif
+/**
+ * Max random value. Similar to RAND_MAX, but more portable
+ * (mingw uses only 15 bits random).
+ */
+#define MAX_VALUE 0x7fffffff
+
+#ifdef HAVE_SSL
/**
* Struct with per-thread random state.
* Keeps SSL types away from the header file.
@@ -78,12 +93,6 @@ struct ub_randstate {
/** Size of key to use (must be multiple of 8) */
#define SEED_SIZE 24
-/**
- * Max random value. Similar to RAND_MAX, but more portable
- * (mingw uses only 15 bits random).
- */
-#define MAX_VALUE 0x7fffffff
-
/** Number of bytes to reseed after */
#define REKEY_BYTES (1 << 24)
@@ -140,6 +149,16 @@ ub_arc4random_stir(struct ub_randstate* s, struct ub_randstate* from)
return;
}
}
+#ifdef HAVE_FIPS_MODE
+ if(FIPS_mode()) {
+ /* RC4 is not allowed, get some trustworthy randomness */
+ /* double certainty here, this routine should not be
+ * called in FIPS_mode */
+ memset(rand_buf, 0, sizeof(rand_buf));
+ s->rc4_ready = REKEY_BYTES;
+ return;
+ }
+#endif /* FIPS_MODE */
RC4_set_key(&s->rc4, SEED_SIZE, (unsigned char*)rand_buf);
/*
@@ -164,6 +183,9 @@ ub_initstate(unsigned int seed, struct ub_randstate* from)
return NULL;
}
ub_systemseed(seed);
+#ifdef HAVE_FIPS_MODE
+ if(!FIPS_mode())
+#endif
ub_arc4random_stir(s, from);
return s;
}
@@ -172,6 +194,20 @@ long int
ub_random(struct ub_randstate* s)
{
unsigned int r = 0;
+#ifdef HAVE_FIPS_MODE
+ if(FIPS_mode()) {
+ /* RC4 is not allowed, get some trustworthy randomness */
+ /* we use pseudo bytes: it tries to return secure randomness
+ * but returns 'something' if that fails. We need something
+ * else if it fails, because we cannot block here */
+ if(RAND_pseudo_bytes((unsigned char*)&r, (int)sizeof(r))
+ == -1) {
+ log_err("FIPSmode, no arc4random but RAND failed "
+ "(error %ld)", ERR_get_error());
+ }
+ return (long int)((r) % (((unsigned)MAX_VALUE + 1)));
+ }
+#endif /* FIPS_MODE */
if (s->rc4_ready <= 0) {
ub_arc4random_stir(s, NULL);
}
@@ -182,6 +218,42 @@ ub_random(struct ub_randstate* s)
return (long int)((r) % (((unsigned)MAX_VALUE + 1)));
}
+#elif defined(HAVE_NSS)
+
+/* not much to remember for NSS since we use its pk11_random, placeholder */
+struct ub_randstate {
+ int ready;
+};
+
+void ub_systemseed(unsigned int ATTR_UNUSED(seed))
+{
+}
+
+struct ub_randstate* ub_initstate(unsigned int ATTR_UNUSED(seed),
+ struct ub_randstate* ATTR_UNUSED(from))
+{
+ struct ub_randstate* s = (struct ub_randstate*)calloc(1, sizeof(*s));
+ if(!s) {
+ log_err("malloc failure in random init");
+ return NULL;
+ }
+ return s;
+}
+
+long int ub_random(struct ub_randstate* ATTR_UNUSED(state))
+{
+ long int x;
+ /* random 31 bit value. */
+ SECStatus s = PK11_GenerateRandom((unsigned char*)&x, (int)sizeof(x));
+ if(s != SECSuccess) {
+ log_err("PK11_GenerateRandom error: %s",
+ PORT_ErrorToString(PORT_GetError()));
+ }
+ return x & MAX_VALUE;
+}
+
+#endif /* HAVE_SSL or HAVE_NSS */
+
long int
ub_random_max(struct ub_randstate* state, long int x)
{
diff --git a/contrib/unbound/util/rtt.c b/contrib/unbound/util/rtt.c
index df1d437e4791..c888b0864f06 100644
--- a/contrib/unbound/util/rtt.c
+++ b/contrib/unbound/util/rtt.c
@@ -41,7 +41,6 @@
*/
#include "config.h"
#include "util/rtt.h"
-#include "util/log.h"
/** calculate RTO from rtt information */
static int
diff --git a/contrib/unbound/util/storage/lookup3.c b/contrib/unbound/util/storage/lookup3.c
index 65e0ad2a57cb..845cc388624b 100644
--- a/contrib/unbound/util/storage/lookup3.c
+++ b/contrib/unbound/util/storage/lookup3.c
@@ -1,4 +1,5 @@
/*
+ February 2013(Wouter) patch defines for BSD endianness, from Brad Smith.
January 2012(Wouter) added randomised initial value, fallout from 28c3.
March 2007(Wouter) adapted from lookup3.c original, add config.h include.
added #ifdef VALGRIND to remove 298,384,660 'unused variable k8' warnings.
@@ -52,6 +53,12 @@ on 1 byte), but shoehorning those bytes into integers efficiently is messy.
#ifdef linux
# include <endian.h> /* attempt to define endianness */
#endif
+#if defined(__FreeBSD__) || defined(__NetBSD__) || defined(__DragonFly__)
+#include <sys/endian.h> /* attempt to define endianness */
+#endif
+#ifdef __OpenBSD__
+#include <machine/endian.h> /* attempt to define endianness */
+#endif
/* random initial value */
static uint32_t raninit = 0xdeadbeef;
@@ -68,12 +75,19 @@ hash_set_raninit(uint32_t v)
*/
#if (defined(__BYTE_ORDER) && defined(__LITTLE_ENDIAN) && \
__BYTE_ORDER == __LITTLE_ENDIAN) || \
+ (defined(_BYTE_ORDER) && defined(_LITTLE_ENDIAN) && \
+ _BYTE_ORDER == _LITTLE_ENDIAN) || \
(defined(i386) || defined(__i386__) || defined(__i486__) || \
defined(__i586__) || defined(__i686__) || defined(vax) || defined(MIPSEL))
# define HASH_LITTLE_ENDIAN 1
# define HASH_BIG_ENDIAN 0
+#elif (!defined(_BYTE_ORDER) && !defined(__BYTE_ORDER) && defined(_BIG_ENDIAN))
+# define HASH_LITTLE_ENDIAN 0
+# define HASH_BIG_ENDIAN 1
#elif (defined(__BYTE_ORDER) && defined(__BIG_ENDIAN) && \
__BYTE_ORDER == __BIG_ENDIAN) || \
+ (defined(_BYTE_ORDER) && defined(_BIG_ENDIAN) && \
+ _BYTE_ORDER == _BIG_ENDIAN) || \
(defined(sparc) || defined(POWERPC) || defined(mc68000) || defined(sel))
# define HASH_LITTLE_ENDIAN 0
# define HASH_BIG_ENDIAN 1
diff --git a/contrib/unbound/util/tube.c b/contrib/unbound/util/tube.c
index 67294e056c4b..28c51d79d16d 100644
--- a/contrib/unbound/util/tube.c
+++ b/contrib/unbound/util/tube.c
@@ -360,6 +360,7 @@ int tube_read_msg(struct tube* tube, uint8_t** buf, uint32_t* len,
}
d += r;
}
+ log_assert(*len < 65536*2);
*buf = (uint8_t*)malloc(*len);
if(!*buf) {
log_err("tube read out of memory");