- In unbound.conf directory: dir immediately changes to that directory,

so that include: file below that is relative to that directory.
  With chroot, make the directory an absolute path inside chroot.


git-svn-id: file:///svn/unbound/trunk@3775 be551aaa-1e26-0410-a405-d3ace91eadb9
This commit is contained in:
Wouter Wijngaards 2016-06-09 22:59:07 +00:00
parent 2cd83d1b58
commit 12f96dc321
4 changed files with 341 additions and 355 deletions

View file

@ -1,5 +1,8 @@
10 June 2016: Wouter 10 June 2016: Wouter
- And delete service.conf.shipped on uninstall. - And delete service.conf.shipped on uninstall.
- In unbound.conf directory: dir immediately changes to that directory,
so that include: file below that is relative to that directory.
With chroot, make the directory an absolute path inside chroot.
9 June 2016: Wouter 9 June 2016: Wouter
- Trunk is called 1.5.10 (with previous fixes already in there to 2 - Trunk is called 1.5.10 (with previous fixes already in there to 2

View file

@ -9,8 +9,8 @@
#define FLEX_SCANNER #define FLEX_SCANNER
#define YY_FLEX_MAJOR_VERSION 2 #define YY_FLEX_MAJOR_VERSION 2
#define YY_FLEX_MINOR_VERSION 6 #define YY_FLEX_MINOR_VERSION 5
#define YY_FLEX_SUBMINOR_VERSION 0 #define YY_FLEX_SUBMINOR_VERSION 39
#if YY_FLEX_SUBMINOR_VERSION > 0 #if YY_FLEX_SUBMINOR_VERSION > 0
#define FLEX_BETA #define FLEX_BETA
#endif #endif
@ -143,15 +143,7 @@ typedef unsigned int flex_uint32_t;
/* Size of default input buffer. */ /* Size of default input buffer. */
#ifndef YY_BUF_SIZE #ifndef YY_BUF_SIZE
#ifdef __ia64__
/* On IA-64, the buffer size is 16k, not 8k.
* Moreover, YY_BUF_SIZE is 2*YY_READ_BUF_SIZE in the general case.
* Ditto for the __ia64__ case accordingly.
*/
#define YY_BUF_SIZE 32768
#else
#define YY_BUF_SIZE 16384 #define YY_BUF_SIZE 16384
#endif /* __ia64__ */
#endif #endif
/* The state buf must be large enough to hold one state per character in the main buffer. /* The state buf must be large enough to hold one state per character in the main buffer.
@ -184,7 +176,7 @@ extern FILE *yyin, *yyout;
do \ do \
{ \ { \
/* Undo effects of setting up yytext. */ \ /* Undo effects of setting up yytext. */ \
yy_size_t yyless_macro_arg = (n); \ int yyless_macro_arg = (n); \
YY_LESS_LINENO(yyless_macro_arg);\ YY_LESS_LINENO(yyless_macro_arg);\
*yy_cp = (yy_hold_char); \ *yy_cp = (yy_hold_char); \
YY_RESTORE_YY_MORE_OFFSET \ YY_RESTORE_YY_MORE_OFFSET \
@ -354,17 +346,11 @@ extern int yylineno;
int yylineno = 1; int yylineno = 1;
extern char *yytext; extern char *yytext;
#ifdef yytext_ptr
#undef yytext_ptr
#endif
#define yytext_ptr yytext #define yytext_ptr yytext
static yy_state_type yy_get_previous_state (void ); static yy_state_type yy_get_previous_state (void );
static yy_state_type yy_try_NUL_trans (yy_state_type current_state ); static yy_state_type yy_try_NUL_trans (yy_state_type current_state );
static int yy_get_next_buffer (void ); static int yy_get_next_buffer (void );
#if defined(__GNUC__) && __GNUC__ >= 3
__attribute__((__noreturn__))
#endif
static void yy_fatal_error (yyconst char msg[] ); static void yy_fatal_error (yyconst char msg[] );
/* Done after the current pattern has been matched and before the /* Done after the current pattern has been matched and before the
@ -597,7 +583,7 @@ static yyconst flex_int16_t yy_accept[1874] =
155, 159, 0 155, 159, 0
} ; } ;
static yyconst YY_CHAR yy_ec[256] = static yyconst flex_int32_t yy_ec[256] =
{ 0, { 0,
1, 1, 1, 1, 1, 1, 1, 1, 2, 3, 1, 1, 1, 1, 1, 1, 1, 1, 2, 3,
1, 1, 4, 1, 1, 1, 1, 1, 1, 1, 1, 1, 4, 1, 1, 1, 1, 1, 1, 1,
@ -629,7 +615,7 @@ static yyconst YY_CHAR yy_ec[256] =
1, 1, 1, 1, 1 1, 1, 1, 1, 1
} ; } ;
static yyconst YY_CHAR yy_meta[40] = static yyconst flex_int32_t yy_meta[40] =
{ 0, { 0,
1, 2, 3, 4, 5, 1, 6, 1, 1, 1, 1, 2, 3, 4, 5, 1, 6, 1, 1, 1,
1, 7, 1, 1, 1, 1, 1, 1, 1, 1, 1, 7, 1, 1, 1, 1, 1, 1, 1, 1,
@ -637,7 +623,7 @@ static yyconst YY_CHAR yy_meta[40] =
1, 1, 1, 1, 1, 1, 1, 1, 1 1, 1, 1, 1, 1, 1, 1, 1, 1
} ; } ;
static yyconst flex_uint16_t yy_base[1888] = static yyconst flex_int16_t yy_base[1888] =
{ 0, { 0,
0, 0, 37, 40, 44, 51, 63, 75, 56, 68, 0, 0, 37, 40, 44, 51, 63, 75, 56, 68,
87, 108, 2327, 2209, 50, 3703, 3703, 3703, 129, 94, 87, 108, 2327, 2209, 50, 3703, 3703, 3703, 129, 94,
@ -1059,7 +1045,7 @@ static yyconst flex_int16_t yy_def[1888] =
1873, 1873, 1873, 1873, 1873, 1873, 1873 1873, 1873, 1873, 1873, 1873, 1873, 1873
} ; } ;
static yyconst flex_uint16_t yy_nxt[3743] = static yyconst flex_int16_t yy_nxt[3743] =
{ 0, { 0,
14, 15, 16, 17, 18, 19, 18, 14, 14, 14, 14, 15, 16, 17, 18, 19, 18, 14, 14, 14,
14, 18, 20, 21, 14, 22, 23, 24, 25, 14, 14, 18, 20, 21, 14, 22, 23, 24, 25, 14,
@ -2093,7 +2079,7 @@ static void config_end_include(void)
#define YY_NO_INPUT 1 #define YY_NO_INPUT 1
#endif #endif
#line 2095 "<stdout>" #line 2081 "<stdout>"
#define INITIAL 0 #define INITIAL 0
#define quotedstring 1 #define quotedstring 1
@ -2131,11 +2117,11 @@ void yyset_extra (YY_EXTRA_TYPE user_defined );
FILE *yyget_in (void ); FILE *yyget_in (void );
void yyset_in (FILE * _in_str ); void yyset_in (FILE * in_str );
FILE *yyget_out (void ); FILE *yyget_out (void );
void yyset_out (FILE * _out_str ); void yyset_out (FILE * out_str );
yy_size_t yyget_leng (void ); yy_size_t yyget_leng (void );
@ -2143,7 +2129,7 @@ char *yyget_text (void );
int yyget_lineno (void ); int yyget_lineno (void );
void yyset_lineno (int _line_number ); void yyset_lineno (int line_number );
/* Macros after this point can all be overridden by user definitions in /* Macros after this point can all be overridden by user definitions in
* section 1. * section 1.
@ -2157,10 +2143,6 @@ extern int yywrap (void );
#endif #endif
#endif #endif
#ifndef YY_NO_UNPUT
#endif
#ifndef yytext_ptr #ifndef yytext_ptr
static void yy_flex_strncpy (char *,yyconst char *,int ); static void yy_flex_strncpy (char *,yyconst char *,int );
#endif #endif
@ -2181,12 +2163,7 @@ static int input (void );
/* Amount of stuff to slurp up with each read. */ /* Amount of stuff to slurp up with each read. */
#ifndef YY_READ_BUF_SIZE #ifndef YY_READ_BUF_SIZE
#ifdef __ia64__
/* On IA-64, the buffer size is 16k, not 8k */
#define YY_READ_BUF_SIZE 16384
#else
#define YY_READ_BUF_SIZE 8192 #define YY_READ_BUF_SIZE 8192
#endif /* __ia64__ */
#endif #endif
/* Copy whatever the last rule matched to the standard output. */ /* Copy whatever the last rule matched to the standard output. */
@ -2273,7 +2250,7 @@ extern int yylex (void);
/* Code executed at the end of each rule. */ /* Code executed at the end of each rule. */
#ifndef YY_BREAK #ifndef YY_BREAK
#define YY_BREAK /*LINTED*/break; #define YY_BREAK break;
#endif #endif
#define YY_RULE_SETUP \ #define YY_RULE_SETUP \
@ -2283,9 +2260,9 @@ extern int yylex (void);
*/ */
YY_DECL YY_DECL
{ {
yy_state_type yy_current_state; register yy_state_type yy_current_state;
char *yy_cp, *yy_bp; register char *yy_cp, *yy_bp;
int yy_act; register int yy_act;
if ( !(yy_init) ) if ( !(yy_init) )
{ {
@ -2316,9 +2293,9 @@ YY_DECL
{ {
#line 201 "./util/configlexer.lex" #line 201 "./util/configlexer.lex"
#line 2318 "<stdout>" #line 2295 "<stdout>"
while ( /*CONSTCOND*/1 ) /* loops until end-of-file is reached */ while ( 1 ) /* loops until end-of-file is reached */
{ {
(yy_more_len) = 0; (yy_more_len) = 0;
if ( (yy_more_flag) ) if ( (yy_more_flag) )
@ -2340,7 +2317,7 @@ YY_DECL
yy_match: yy_match:
do do
{ {
YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)] ; register YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)] ;
if ( yy_accept[yy_current_state] ) if ( yy_accept[yy_current_state] )
{ {
(yy_last_accepting_state) = yy_current_state; (yy_last_accepting_state) = yy_current_state;
@ -3413,7 +3390,7 @@ YY_RULE_SETUP
#line 473 "./util/configlexer.lex" #line 473 "./util/configlexer.lex"
ECHO; ECHO;
YY_BREAK YY_BREAK
#line 3415 "<stdout>" #line 3392 "<stdout>"
case YY_END_OF_BUFFER: case YY_END_OF_BUFFER:
{ {
@ -3554,9 +3531,9 @@ ECHO;
*/ */
static int yy_get_next_buffer (void) static int yy_get_next_buffer (void)
{ {
char *dest = YY_CURRENT_BUFFER_LVALUE->yy_ch_buf; register char *dest = YY_CURRENT_BUFFER_LVALUE->yy_ch_buf;
char *source = (yytext_ptr); register char *source = (yytext_ptr);
yy_size_t number_to_move, i; register int number_to_move, i;
int ret_val; int ret_val;
if ( (yy_c_buf_p) > &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars) + 1] ) if ( (yy_c_buf_p) > &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars) + 1] )
@ -3585,7 +3562,7 @@ static int yy_get_next_buffer (void)
/* Try to read more data. */ /* Try to read more data. */
/* First move last chars to start of buffer. */ /* First move last chars to start of buffer. */
number_to_move = (yy_size_t) ((yy_c_buf_p) - (yytext_ptr)) - 1; number_to_move = (int) ((yy_c_buf_p) - (yytext_ptr)) - 1;
for ( i = 0; i < number_to_move; ++i ) for ( i = 0; i < number_to_move; ++i )
*(dest++) = *(source++); *(dest++) = *(source++);
@ -3688,14 +3665,14 @@ static int yy_get_next_buffer (void)
static yy_state_type yy_get_previous_state (void) static yy_state_type yy_get_previous_state (void)
{ {
yy_state_type yy_current_state; register yy_state_type yy_current_state;
char *yy_cp; register char *yy_cp;
yy_current_state = (yy_start); yy_current_state = (yy_start);
for ( yy_cp = (yytext_ptr) + YY_MORE_ADJ; yy_cp < (yy_c_buf_p); ++yy_cp ) for ( yy_cp = (yytext_ptr) + YY_MORE_ADJ; yy_cp < (yy_c_buf_p); ++yy_cp )
{ {
YY_CHAR yy_c = (*yy_cp ? yy_ec[YY_SC_TO_UI(*yy_cp)] : 1); register YY_CHAR yy_c = (*yy_cp ? yy_ec[YY_SC_TO_UI(*yy_cp)] : 1);
if ( yy_accept[yy_current_state] ) if ( yy_accept[yy_current_state] )
{ {
(yy_last_accepting_state) = yy_current_state; (yy_last_accepting_state) = yy_current_state;
@ -3720,10 +3697,10 @@ static int yy_get_next_buffer (void)
*/ */
static yy_state_type yy_try_NUL_trans (yy_state_type yy_current_state ) static yy_state_type yy_try_NUL_trans (yy_state_type yy_current_state )
{ {
int yy_is_jam; register int yy_is_jam;
char *yy_cp = (yy_c_buf_p); register char *yy_cp = (yy_c_buf_p);
YY_CHAR yy_c = 1; register YY_CHAR yy_c = 1;
if ( yy_accept[yy_current_state] ) if ( yy_accept[yy_current_state] )
{ {
(yy_last_accepting_state) = yy_current_state; (yy_last_accepting_state) = yy_current_state;
@ -3741,10 +3718,6 @@ static int yy_get_next_buffer (void)
return yy_is_jam ? 0 : yy_current_state; return yy_is_jam ? 0 : yy_current_state;
} }
#ifndef YY_NO_UNPUT
#endif
#ifndef YY_NO_INPUT #ifndef YY_NO_INPUT
#ifdef __cplusplus #ifdef __cplusplus
static int yyinput (void) static int yyinput (void)
@ -3894,7 +3867,7 @@ static void yy_load_buffer_state (void)
if ( ! b ) if ( ! b )
YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" ); YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" );
b->yy_buf_size = (yy_size_t)size; b->yy_buf_size = size;
/* yy_ch_buf has to be 2 characters longer than the size given because /* yy_ch_buf has to be 2 characters longer than the size given because
* we need to put in 2 end-of-buffer characters. * we need to put in 2 end-of-buffer characters.
@ -4049,7 +4022,7 @@ static void yyensure_buffer_stack (void)
* scanner will even need a stack. We use 2 instead of 1 to avoid an * scanner will even need a stack. We use 2 instead of 1 to avoid an
* immediate realloc on the next call. * immediate realloc on the next call.
*/ */
num_to_alloc = 1; // After all that talk, this was set to 1 anyways... num_to_alloc = 1;
(yy_buffer_stack) = (struct yy_buffer_state**)yyalloc (yy_buffer_stack) = (struct yy_buffer_state**)yyalloc
(num_to_alloc * sizeof(struct yy_buffer_state*) (num_to_alloc * sizeof(struct yy_buffer_state*)
); );
@ -4066,7 +4039,7 @@ static void yyensure_buffer_stack (void)
if ((yy_buffer_stack_top) >= ((yy_buffer_stack_max)) - 1){ if ((yy_buffer_stack_top) >= ((yy_buffer_stack_max)) - 1){
/* Increase the buffer to prepare for a possible push. */ /* Increase the buffer to prepare for a possible push. */
yy_size_t grow_size = 8 /* arbitrary grow size */; int grow_size = 8 /* arbitrary grow size */;
num_to_alloc = (yy_buffer_stack_max) + grow_size; num_to_alloc = (yy_buffer_stack_max) + grow_size;
(yy_buffer_stack) = (struct yy_buffer_state**)yyrealloc (yy_buffer_stack) = (struct yy_buffer_state**)yyrealloc
@ -4174,7 +4147,7 @@ YY_BUFFER_STATE yy_scan_bytes (yyconst char * yybytes, yy_size_t _yybytes_len
static void yy_fatal_error (yyconst char* msg ) static void yy_fatal_error (yyconst char* msg )
{ {
(void) fprintf( stderr, "%s\n", msg ); (void) fprintf( stderr, "%s\n", msg );
exit( YY_EXIT_FAILURE ); exit( YY_EXIT_FAILURE );
} }
@ -4185,7 +4158,7 @@ static void yy_fatal_error (yyconst char* msg )
do \ do \
{ \ { \
/* Undo effects of setting up yytext. */ \ /* Undo effects of setting up yytext. */ \
yy_size_t yyless_macro_arg = (n); \ int yyless_macro_arg = (n); \
YY_LESS_LINENO(yyless_macro_arg);\ YY_LESS_LINENO(yyless_macro_arg);\
yytext[yyleng] = (yy_hold_char); \ yytext[yyleng] = (yy_hold_char); \
(yy_c_buf_p) = yytext + yyless_macro_arg; \ (yy_c_buf_p) = yytext + yyless_macro_arg; \
@ -4240,29 +4213,29 @@ char *yyget_text (void)
} }
/** Set the current line number. /** Set the current line number.
* @param _line_number line number * @param line_number
* *
*/ */
void yyset_lineno (int _line_number ) void yyset_lineno (int line_number )
{ {
yylineno = _line_number; yylineno = line_number;
} }
/** Set the input stream. This does not discard the current /** Set the input stream. This does not discard the current
* input buffer. * input buffer.
* @param _in_str A readable stream. * @param in_str A readable stream.
* *
* @see yy_switch_to_buffer * @see yy_switch_to_buffer
*/ */
void yyset_in (FILE * _in_str ) void yyset_in (FILE * in_str )
{ {
yyin = _in_str ; yyin = in_str ;
} }
void yyset_out (FILE * _out_str ) void yyset_out (FILE * out_str )
{ {
yyout = _out_str ; yyout = out_str ;
} }
int yyget_debug (void) int yyget_debug (void)
@ -4270,9 +4243,9 @@ int yyget_debug (void)
return yy_flex_debug; return yy_flex_debug;
} }
void yyset_debug (int _bdebug ) void yyset_debug (int bdebug )
{ {
yy_flex_debug = _bdebug ; yy_flex_debug = bdebug ;
} }
static int yy_init_globals (void) static int yy_init_globals (void)
@ -4332,8 +4305,7 @@ int yylex_destroy (void)
#ifndef yytext_ptr #ifndef yytext_ptr
static void yy_flex_strncpy (char* s1, yyconst char * s2, int n ) static void yy_flex_strncpy (char* s1, yyconst char * s2, int n )
{ {
register int i;
int i;
for ( i = 0; i < n; ++i ) for ( i = 0; i < n; ++i )
s1[i] = s2[i]; s1[i] = s2[i];
} }
@ -4342,7 +4314,7 @@ static void yy_flex_strncpy (char* s1, yyconst char * s2, int n )
#ifdef YY_NEED_STRLEN #ifdef YY_NEED_STRLEN
static int yy_flex_strlen (yyconst char * s ) static int yy_flex_strlen (yyconst char * s )
{ {
int n; register int n;
for ( n = 0; s[n]; ++n ) for ( n = 0; s[n]; ++n )
; ;
@ -4352,12 +4324,11 @@ static int yy_flex_strlen (yyconst char * s )
void *yyalloc (yy_size_t size ) void *yyalloc (yy_size_t size )
{ {
return (void *) malloc( size ); return (void *) malloc( size );
} }
void *yyrealloc (void * ptr, yy_size_t size ) void *yyrealloc (void * ptr, yy_size_t size )
{ {
/* The cast to (char *) in the following accommodates both /* The cast to (char *) in the following accommodates both
* implementations that use char* generic pointers, and those * implementations that use char* generic pointers, and those
* that use void* generic pointers. It works with the latter * that use void* generic pointers. It works with the latter
@ -4370,7 +4341,7 @@ void *yyrealloc (void * ptr, yy_size_t size )
void yyfree (void * ptr ) void yyfree (void * ptr )
{ {
free( (char *) ptr ); /* see yyrealloc() for (char *) cast */ free( (char *) ptr ); /* see yyrealloc() for (char *) cast */
} }
#define YYTABLES_NAME "yytables" #define YYTABLES_NAME "yytables"

File diff suppressed because it is too large Load diff

View file

@ -525,6 +525,12 @@ server_directory: VAR_DIRECTORY STRING_ARG
OUTYY(("P(server_directory:%s)\n", $2)); OUTYY(("P(server_directory:%s)\n", $2));
free(cfg_parser->cfg->directory); free(cfg_parser->cfg->directory);
cfg_parser->cfg->directory = $2; cfg_parser->cfg->directory = $2;
/* change there right away for includes relative to this */
if($2[0]) {
if(chdir($2))
log_err("cannot chdir to directory: %s (%s)",
$2, strerror(errno));
}
} }
; ;
server_logfile: VAR_LOGFILE STRING_ARG server_logfile: VAR_LOGFILE STRING_ARG