mirror of
https://gitlab.nic.cz/knot/knot-dns.git
synced 2026-05-28 04:02:31 -04:00
parent
78bd95c699
commit
83ea5d5d68
67 changed files with 380 additions and 111 deletions
|
|
@ -2,8 +2,14 @@
|
|||
- the class IN is supported only (CLASS12345 notation is not supported too)
|
||||
- domain names can contain alphanumeric, '-', '_' and '/' characters
|
||||
- \x and \DDD notations are allowed in domain names and text strings only
|
||||
- @ can be used instead of domain names anywhere
|
||||
- @ can be used instead of domain names anywhere (excluding directives)
|
||||
- included file can contain include directive
|
||||
- relative file path is relative to parent zone file
|
||||
- blank zone file causes error (same rule is for included zone files)
|
||||
- included file can contain include directive (BEWARE of recursion)
|
||||
- the line numbers of multiline records are the numbers of the last lines with appropriate record parts
|
||||
- items parts lengths must be multiples of 2 for HEX, 4 for base64 and 8 for base32hex blocks (but DHCID example from RFC is more general!)
|
||||
- NSEC3 hash is with padding (but RFC 5155 section 3.3 says "unpadded")
|
||||
- date version of timestamp in RRSIG is limited to the end of the year 2105 (for better checking of 32bit integer)
|
||||
- date version of timestamp in RRSIG is limited to the end of the year 2105 (for better checking of 32bit integer)
|
||||
- directive $INCLUDE is allowed in included zone files
|
||||
- algorithm and certificate mnemonics aren't supported
|
||||
|
|
@ -38,7 +38,7 @@ static int load_settings(file_loader_t *fl)
|
|||
|
||||
// Creating name for zone defaults.
|
||||
settings_name = malloc(strlen(fl->file_name) + 100);
|
||||
sprintf(settings_name, "ZONE DEFAULTS (%s)", fl->file_name);
|
||||
sprintf(settings_name, "ZONE DEFAULTS <%s>", fl->file_name);
|
||||
|
||||
// Temporary scanner for zone settings.
|
||||
settings_scanner = scanner_create(settings_name);
|
||||
|
|
@ -120,7 +120,7 @@ file_loader_t* file_loader_create(const char *file_name,
|
|||
if (ret > 0) {
|
||||
fl->settings_length = ret;
|
||||
} else {
|
||||
printf("Error in zone setttings!\n");
|
||||
printf("FL:Error in zone setttings!\n");
|
||||
file_loader_free(fl);
|
||||
return NULL;
|
||||
}
|
||||
|
|
@ -158,19 +158,19 @@ int file_loader_process(file_loader_t *fl)
|
|||
|
||||
// Getting file information.
|
||||
if (fstat(fl->fd, &file_stat) == -1) {
|
||||
printf("Fstat error!\n");
|
||||
printf("FL:Fstat error!\n");
|
||||
return -1;
|
||||
}
|
||||
|
||||
// Check for directory.
|
||||
if (S_ISDIR(file_stat.st_mode)) {
|
||||
printf("Given zone file is a directory!\n");
|
||||
printf("FL:Given zone file is a directory!\n");
|
||||
return -1;
|
||||
}
|
||||
|
||||
// Check for empty file.
|
||||
if (file_stat.st_size == 0) {
|
||||
printf("Empty zone file!\n");
|
||||
printf("FL:Empty zone file!\n");
|
||||
return -1;
|
||||
}
|
||||
|
||||
|
|
@ -187,7 +187,7 @@ int file_loader_process(file_loader_t *fl)
|
|||
ret = load_settings(fl);
|
||||
|
||||
if (ret != 0) {
|
||||
printf("Zone defaults error!\n");
|
||||
printf("FL:Zone defaults error!\n");
|
||||
return -1;
|
||||
}
|
||||
|
||||
|
|
@ -223,13 +223,13 @@ int file_loader_process(file_loader_t *fl)
|
|||
block_start_position);
|
||||
|
||||
if (data == MAP_FAILED) {
|
||||
printf("Mmap error!\n");
|
||||
printf("FL:Mmap error!\n");
|
||||
return -1;
|
||||
}
|
||||
|
||||
// Check for sufficient block overlapping.
|
||||
if (fl->scanner->token_shift > overlapping_size) {
|
||||
printf("Insufficient block overlapping!\n");
|
||||
printf("FL:Insufficient block overlapping!\n");
|
||||
return -1;
|
||||
};
|
||||
|
||||
|
|
@ -250,14 +250,14 @@ int file_loader_process(file_loader_t *fl)
|
|||
// Zone file block unmapping.
|
||||
if (munmap(data,
|
||||
block_end_position - block_start_position) == -1) {
|
||||
printf("Error file munmapping!\n");
|
||||
printf("FL:Error file munmapping!\n");
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
|
||||
// Check for scanner return.
|
||||
if (ret != 0) {
|
||||
printf("Zone processing has stopped with %"PRIu64" errors!\n",
|
||||
printf("FL:Zone processing has stopped with %"PRIu64" errors!\n",
|
||||
fl->scanner->error_counter);
|
||||
return -1;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -121,7 +121,7 @@ struct scanner {
|
|||
/*!< Auxiliary buffer length. */
|
||||
uint32_t buffer_length;
|
||||
|
||||
char include_filename[MAX_RDATA_LENGTH];
|
||||
char include_filename[MAX_RDATA_LENGTH + 1];
|
||||
|
||||
/*!< Bitmap window blocks. */
|
||||
window_t windows[BITMAP_WINDOWS];
|
||||
|
|
|
|||
|
|
@ -249,6 +249,17 @@
|
|||
) $!_r_owner_error;
|
||||
# END
|
||||
|
||||
# BEGIN - domain name in record data processing
|
||||
action _r_dname_init {
|
||||
s->dname = rdata_tail;
|
||||
}
|
||||
action _r_dname_exit {
|
||||
rdata_tail += s->dname_tmp_length;
|
||||
}
|
||||
|
||||
r_dname = dname >_r_dname_init %_r_dname_exit;
|
||||
# END
|
||||
|
||||
# BEGIN - Number processing
|
||||
action _number_digit {
|
||||
// Overflow check: 10*(s->number64) + fc - ASCII_0 <= UINT64_MAX
|
||||
|
|
@ -586,7 +597,6 @@
|
|||
|
||||
zone_origin_ := (sep . absolute_dname >_zone_origin_init . rest)
|
||||
$!_zone_origin_error %_zone_origin_exit %_ret . newline;
|
||||
|
||||
zone_origin = all_wchar ${ fhold; fcall zone_origin_; };
|
||||
# END
|
||||
|
||||
|
|
@ -595,15 +605,17 @@
|
|||
rdata_tail = s->r_data;
|
||||
}
|
||||
action _incl_filename_exit {
|
||||
if (rdata_tail <= rdata_stop) {
|
||||
*rdata_tail = 0; // Ending filename string.
|
||||
strcpy((char*)(s->include_filename), (char*)(s->r_data));
|
||||
rdata_tail = s->r_data; // Initialization of origin if not present!
|
||||
*rdata_tail = 0;
|
||||
} else {
|
||||
SCANNER_WARNING(ZSCANNER_ETEXT_OVERFLOW);
|
||||
*rdata_tail = 0; // Ending filename string.
|
||||
strcpy((char*)(s->include_filename), (char*)(s->r_data));
|
||||
|
||||
// Check for correct string copy.
|
||||
if (strlen(s->include_filename) != rdata_tail - s->r_data) {
|
||||
SCANNER_ERROR(ZSCANNER_EBAD_INCLUDE_FILENAME);
|
||||
fhold; fgoto err_line;
|
||||
}
|
||||
|
||||
// For detection whether origin is not present.
|
||||
s->dname = NULL;
|
||||
}
|
||||
action _incl_filename_error {
|
||||
SCANNER_ERROR(ZSCANNER_EBAD_INCLUDE_FILENAME);
|
||||
|
|
@ -611,15 +623,10 @@
|
|||
}
|
||||
|
||||
action _incl_origin_init {
|
||||
rdata_tail = s->r_data;
|
||||
s->dname = s->r_data;
|
||||
}
|
||||
action _incl_origin_exit {
|
||||
if (rdata_tail <= rdata_stop) {
|
||||
*rdata_tail = 0; // Ending origin string.
|
||||
} else {
|
||||
SCANNER_WARNING(ZSCANNER_ETEXT_OVERFLOW);
|
||||
fhold; fgoto err_line;
|
||||
}
|
||||
s->r_data_length = s->dname_tmp_length;
|
||||
}
|
||||
action _incl_origin_error {
|
||||
SCANNER_ERROR(ZSCANNER_EBAD_INCLUDE_ORIGIN);
|
||||
|
|
@ -630,18 +637,21 @@
|
|||
char text_origin[MAX_DNAME_LENGTH];
|
||||
|
||||
// Origin conversion from wire to text form.
|
||||
if (s->r_data[0] == 0) { // Use current origin.
|
||||
wire_dname_to_text(s->zone_origin,
|
||||
s->zone_origin_length,
|
||||
text_origin);
|
||||
if (s->dname == NULL) { // Use current origin.
|
||||
wire_dname_to_str(s->zone_origin,
|
||||
s->zone_origin_length,
|
||||
text_origin);
|
||||
} else { // Use specified origin.
|
||||
strcpy(text_origin, (char *)(s->r_data));
|
||||
wire_dname_to_str(s->r_data,
|
||||
s->r_data_length,
|
||||
text_origin);
|
||||
}
|
||||
|
||||
if (s->include_filename[0] != '/') { // File name is in relative form.
|
||||
if (s->include_filename[0] != '/') { // Relative file path..
|
||||
// Get absolute path of the current zone file.
|
||||
if (realpath(s->file_name, (char*)(s->buffer)) != NULL) {
|
||||
char *full_current_zone_file_name = strdup((char*)(s->buffer));
|
||||
char *full_current_zone_file_name =
|
||||
strdup((char*)(s->buffer));
|
||||
|
||||
// Creating full include file name.
|
||||
sprintf((char*)(s->buffer), "%s/%s",
|
||||
|
|
@ -680,11 +690,13 @@
|
|||
}
|
||||
}
|
||||
|
||||
include_file_ := (sep . text >_incl_filename_init %_incl_filename_exit
|
||||
$!_incl_filename_error .
|
||||
(sep . text >_incl_origin_init %_incl_origin_exit
|
||||
$!_incl_origin_error)? . rest
|
||||
) %_include_exit %_ret newline;
|
||||
include_file_ :=
|
||||
(sep . text >_incl_filename_init %_incl_filename_exit
|
||||
$!_incl_filename_error .
|
||||
(sep . absolute_dname >_incl_origin_init %_incl_origin_exit
|
||||
$!_incl_origin_error
|
||||
)? . rest
|
||||
) %_include_exit %_ret newline;
|
||||
include_file = all_wchar ${ fhold; fcall include_file_; };
|
||||
# END
|
||||
|
||||
|
|
@ -736,17 +748,6 @@
|
|||
r_ttl = time %_r_ttl_exit;
|
||||
# END
|
||||
|
||||
# BEGIN - domain name in record data processing
|
||||
action _r_dname_init {
|
||||
s->dname = rdata_tail;
|
||||
}
|
||||
action _r_dname_exit {
|
||||
rdata_tail += s->dname_tmp_length;
|
||||
}
|
||||
|
||||
r_dname = dname >_r_dname_init %_r_dname_exit;
|
||||
# END
|
||||
|
||||
# BEGIN - IPv4 and IPv6 address processing
|
||||
action _addr_init {
|
||||
s->buffer_length = 0;
|
||||
|
|
|
|||
|
|
@ -17,6 +17,7 @@
|
|||
#include "zscanner/scanner_functions.h"
|
||||
|
||||
#include <stdint.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
#include "common/errcode.h"
|
||||
#include "common/descriptor_new.h"
|
||||
|
|
@ -755,24 +756,45 @@ int date_to_timestamp(uint8_t *buff, uint32_t *timestamp)
|
|||
return KNOT_EOK;
|
||||
}
|
||||
|
||||
void wire_dname_to_text(const uint8_t *dname,
|
||||
const uint32_t dname_length,
|
||||
char *text_dname)
|
||||
int wire_dname_to_str(const uint8_t *data,
|
||||
const uint32_t data_len,
|
||||
char *text)
|
||||
{
|
||||
uint32_t label_length = 0, i = 0, j = 0;
|
||||
uint32_t i = 0, text_len = 0;
|
||||
|
||||
for (i = 0; i < dname_length; i++) {
|
||||
if (label_length == 0) {
|
||||
label_length = dname[i];
|
||||
if (i > 0) { // Ignore first byte with length.
|
||||
text_dname[j++] = '.';
|
||||
}
|
||||
if (data == NULL || data_len == 0 || text == NULL) {
|
||||
return -1;
|
||||
}
|
||||
|
||||
uint8_t label_len = data[0];
|
||||
|
||||
// Loop over data characters.
|
||||
for (i = 1; i < data_len; i++) {
|
||||
// Replace label length with dot.
|
||||
if (label_len == 0) {
|
||||
label_len = data[i];
|
||||
text[text_len++] = '.';
|
||||
continue;
|
||||
}
|
||||
text_dname[j++] = (char)dname[i];
|
||||
label_length--;
|
||||
|
||||
// Just in case use \123 notation.
|
||||
text[text_len++] = '\\';
|
||||
text[text_len++] = (data[i] / 100) + ASCII_0;
|
||||
text[text_len++] = (data[i] / 10) % 10 + ASCII_0;
|
||||
text[text_len++] = (data[i] ) % 10 + ASCII_0;
|
||||
|
||||
label_len--;
|
||||
}
|
||||
text_dname[j] = 0;
|
||||
|
||||
// Add trailing dot for root domain.
|
||||
if (data_len == 1 && label_len == 0) {
|
||||
text[text_len++] = '.';
|
||||
}
|
||||
|
||||
// Ending text string.
|
||||
text[text_len] = 0;
|
||||
|
||||
return KNOT_EOK;
|
||||
}
|
||||
|
||||
uint8_t loc64to8(uint64_t number)
|
||||
|
|
@ -805,8 +827,8 @@ static uint32_t get_dname_length(const uint8_t *data,
|
|||
if (dname_len > data_len) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
label_len = data[dname_len] & 63;
|
||||
|
||||
label_len = data[dname_len];
|
||||
}
|
||||
|
||||
dname_len++; // Last label length byte.
|
||||
|
|
|
|||
|
|
@ -36,6 +36,7 @@ extern const uint8_t ascii_to_lower[];
|
|||
|
||||
extern const uint8_t digit_to_num[];
|
||||
|
||||
// Transformation arrays for Hex encoding.
|
||||
extern const uint8_t first_hex_to_num[];
|
||||
extern const uint8_t second_hex_to_num[];
|
||||
|
||||
|
|
@ -63,9 +64,9 @@ extern const uint8_t eighth_base32hex_to_num[];
|
|||
|
||||
int date_to_timestamp(uint8_t *buff, uint32_t *timestamp);
|
||||
|
||||
void wire_dname_to_text(const uint8_t *dname,
|
||||
const uint32_t dname_length,
|
||||
char *text_dname);
|
||||
int wire_dname_to_str(const uint8_t *data,
|
||||
const uint32_t data_len,
|
||||
char *text);
|
||||
|
||||
uint8_t loc64to8(uint64_t number);
|
||||
|
||||
|
|
|
|||
|
|
@ -1,16 +1,21 @@
|
|||
#!/bin/bash
|
||||
#!/bin/sh
|
||||
|
||||
mkdir /tmp/tests
|
||||
TESTS_DIR="./tests"
|
||||
OUTS_DIR="/tmp/zscanner_tests"
|
||||
TEST_BIN="../../unittests-zscanner -m 2"
|
||||
|
||||
mkdir -p ${OUTS_DIR}/${TESTS_DIR}
|
||||
cp -r ${TESTS_DIR}/includes ${OUTS_DIR}
|
||||
|
||||
separation="========================================================="
|
||||
|
||||
echo $separation
|
||||
|
||||
for file in `/usr/bin/find ./tests/ -name "*.in" | /usr/bin/sort`; do
|
||||
fileout=`echo "$file" | /bin/sed 's/.in/.out/'`
|
||||
../../unittests-zscanner -m 2 . $file > /tmp/$fileout
|
||||
/bin/sed --in-place 's/Zone processing has stopped.*//' /tmp/$fileout
|
||||
for file in `find $TESTS_DIR -name "*.in" | sort`; do
|
||||
fileout=`echo "$file" | sed 's/.in/.out/'`
|
||||
$TEST_BIN . $file > ${OUTS_DIR}/$fileout
|
||||
sed --in-place '/FL:/d' ${OUTS_DIR}/$fileout
|
||||
echo $fileout
|
||||
diff /tmp/$fileout $fileout
|
||||
diff ${OUTS_DIR}/$fileout $fileout
|
||||
echo $separation
|
||||
done
|
||||
|
|
|
|||
|
|
@ -66,4 +66,3 @@ RDATA=00
|
|||
------
|
||||
ERROR=ZSCANNER_ELEFT_PARENTHESIS
|
||||
------
|
||||
|
||||
|
|
|
|||
|
|
@ -122,4 +122,3 @@ WARNG=ZSCANNER_EDNAME_OVERFLOW
|
|||
------
|
||||
WARNG=ZSCANNER_EDNAME_OVERFLOW
|
||||
------
|
||||
|
||||
|
|
|
|||
|
|
@ -14,4 +14,3 @@ WARNG=ZSCANNER_EUNSUPPORTED_TYPE
|
|||
------
|
||||
WARNG=ZSCANNER_EUNSUPPORTED_TYPE
|
||||
------
|
||||
|
||||
|
|
|
|||
|
|
@ -98,4 +98,3 @@ WARNG=ZSCANNER_ENUMBER32_OVERFLOW
|
|||
------
|
||||
WARNG=ZSCANNER_EBAD_TIME_UNIT
|
||||
------
|
||||
|
||||
|
|
|
|||
|
|
@ -84,4 +84,3 @@ RDATA=00
|
|||
------
|
||||
ERROR=ZSCANNER_EBAD_ORIGIN
|
||||
------
|
||||
|
||||
|
|
|
|||
|
|
@ -1,3 +1,2 @@
|
|||
ERROR=ZSCANNER_EBAD_ORIGIN
|
||||
------
|
||||
|
||||
|
|
|
|||
|
|
@ -1,3 +1,2 @@
|
|||
ERROR=ZSCANNER_EBAD_ORIGIN
|
||||
------
|
||||
|
||||
|
|
|
|||
|
|
@ -1,3 +1,2 @@
|
|||
ERROR=ZSCANNER_EBAD_REST
|
||||
------
|
||||
|
||||
|
|
|
|||
|
|
@ -1,3 +1,2 @@
|
|||
ERROR=ZSCANNER_EBAD_NUMBER
|
||||
------
|
||||
|
||||
|
|
|
|||
|
|
@ -1,3 +1,2 @@
|
|||
ERROR=ZSCANNER_EBAD_NUMBER
|
||||
------
|
||||
|
||||
|
|
|
|||
|
|
@ -1,3 +1,2 @@
|
|||
ERROR=ZSCANNER_EBAD_REST
|
||||
------
|
||||
|
||||
|
|
|
|||
|
|
@ -1,3 +1,2 @@
|
|||
ERROR=ZSCANNER_EBAD_REST
|
||||
------
|
||||
|
||||
|
|
|
|||
|
|
@ -1,3 +1,2 @@
|
|||
ERROR=ZSCANNER_ELABEL_OVERFLOW
|
||||
------
|
||||
|
||||
|
|
|
|||
|
|
@ -1,3 +1,2 @@
|
|||
ERROR=ZSCANNER_EDNAME_OVERFLOW
|
||||
------
|
||||
|
||||
|
|
|
|||
|
|
@ -90,4 +90,3 @@ RDATA=00
|
|||
------
|
||||
ERROR=ZSCANNER_EBAD_NUMBER
|
||||
------
|
||||
|
||||
|
|
|
|||
|
|
@ -1,3 +1,2 @@
|
|||
ERROR=ZSCANNER_ENUMBER32_OVERFLOW
|
||||
------
|
||||
|
||||
|
|
|
|||
|
|
@ -1,3 +1,2 @@
|
|||
ERROR=ZSCANNER_ENUMBER32_OVERFLOW
|
||||
------
|
||||
|
||||
|
|
|
|||
|
|
@ -1,3 +1,2 @@
|
|||
ERROR=ZSCANNER_ENUMBER32_OVERFLOW
|
||||
------
|
||||
|
||||
|
|
|
|||
|
|
@ -1,3 +1,2 @@
|
|||
ERROR=ZSCANNER_EBAD_TIME_UNIT
|
||||
------
|
||||
|
||||
|
|
|
|||
30
src/zscanner/test/tests/06-0_INCLUDE.in
Normal file
30
src/zscanner/test/tests/06-0_INCLUDE.in
Normal file
|
|
@ -0,0 +1,30 @@
|
|||
$ORIGIN .
|
||||
$TTL 1
|
||||
|
||||
; OK
|
||||
0. NS @
|
||||
|
||||
$INCLUDE ./includes/include1 ; Relative path without origin
|
||||
1. NS @
|
||||
|
||||
$INCLUDE "./includes/include2" . ; Quoted filename and the simplest origin
|
||||
2. NS @
|
||||
|
||||
$INCLUDE ./includes/include\050 tld. ; Simple origin
|
||||
3. NS @
|
||||
|
||||
$INCLUDE \./includes/include2 _a_.-b-c-./d/. ; Slashed character in file name, allowed characters in origin
|
||||
4. NS @
|
||||
|
||||
$INCLUDE ./includes/include2 \0320\ \\\"\.\@\*.tld. ; Origin with special chars
|
||||
5. NS @
|
||||
|
||||
$INCLUDE /tmp/zscanner_tests/includes/include2 ; Absolute path without origin
|
||||
6. NS @
|
||||
|
||||
$INCLUDE /tmp/zscanner_tests/includes/include2 tld. ; Absolute path with origin
|
||||
7. NS @
|
||||
|
||||
; KO
|
||||
$INCLUDE ; Empty parameters
|
||||
|
||||
140
src/zscanner/test/tests/06-0_INCLUDE.out
Normal file
140
src/zscanner/test/tests/06-0_INCLUDE.out
Normal file
|
|
@ -0,0 +1,140 @@
|
|||
OWNER=013000
|
||||
CLASS=0001
|
||||
RRTTL=00000001
|
||||
RTYPE=0002
|
||||
RDATA=00
|
||||
------
|
||||
OWNER=016100
|
||||
CLASS=0001
|
||||
RRTTL=00000001
|
||||
RTYPE=0002
|
||||
RDATA=00
|
||||
------
|
||||
OWNER=016105746c64316100
|
||||
CLASS=0001
|
||||
RRTTL=00000001
|
||||
RTYPE=0002
|
||||
RDATA=05746C64316100
|
||||
------
|
||||
OWNER=016105746c64316200
|
||||
CLASS=0001
|
||||
RRTTL=00000001
|
||||
RTYPE=0002
|
||||
RDATA=05746C64316200
|
||||
------
|
||||
OWNER=013100
|
||||
CLASS=0001
|
||||
RRTTL=00000001
|
||||
RTYPE=0002
|
||||
RDATA=00
|
||||
------
|
||||
OWNER=016200
|
||||
CLASS=0001
|
||||
RRTTL=00000E10
|
||||
RTYPE=0002
|
||||
RDATA=00
|
||||
------
|
||||
OWNER=016205746c64316100
|
||||
CLASS=0001
|
||||
RRTTL=00000E10
|
||||
RTYPE=0002
|
||||
RDATA=05746C64316100
|
||||
------
|
||||
OWNER=013200
|
||||
CLASS=0001
|
||||
RRTTL=00000001
|
||||
RTYPE=0002
|
||||
RDATA=00
|
||||
------
|
||||
OWNER=016203746c6400
|
||||
CLASS=0001
|
||||
RRTTL=00000E10
|
||||
RTYPE=0002
|
||||
RDATA=03746C6400
|
||||
------
|
||||
OWNER=016205746c64316100
|
||||
CLASS=0001
|
||||
RRTTL=00000E10
|
||||
RTYPE=0002
|
||||
RDATA=05746C64316100
|
||||
------
|
||||
OWNER=013300
|
||||
CLASS=0001
|
||||
RRTTL=00000001
|
||||
RTYPE=0002
|
||||
RDATA=00
|
||||
------
|
||||
OWNER=0162035f615f052d622d632d032f642f00
|
||||
CLASS=0001
|
||||
RRTTL=00000E10
|
||||
RTYPE=0002
|
||||
RDATA=035F615F052D622D632D032F642F00
|
||||
------
|
||||
OWNER=016205746c64316100
|
||||
CLASS=0001
|
||||
RRTTL=00000E10
|
||||
RTYPE=0002
|
||||
RDATA=05746C64316100
|
||||
------
|
||||
OWNER=013400
|
||||
CLASS=0001
|
||||
RRTTL=00000001
|
||||
RTYPE=0002
|
||||
RDATA=00
|
||||
------
|
||||
OWNER=0162082030205c222e402a03746c6400
|
||||
CLASS=0001
|
||||
RRTTL=00000E10
|
||||
RTYPE=0002
|
||||
RDATA=082030205C222E402A03746C6400
|
||||
------
|
||||
OWNER=016205746c64316100
|
||||
CLASS=0001
|
||||
RRTTL=00000E10
|
||||
RTYPE=0002
|
||||
RDATA=05746C64316100
|
||||
------
|
||||
OWNER=013500
|
||||
CLASS=0001
|
||||
RRTTL=00000001
|
||||
RTYPE=0002
|
||||
RDATA=00
|
||||
------
|
||||
OWNER=016200
|
||||
CLASS=0001
|
||||
RRTTL=00000E10
|
||||
RTYPE=0002
|
||||
RDATA=00
|
||||
------
|
||||
OWNER=016205746c64316100
|
||||
CLASS=0001
|
||||
RRTTL=00000E10
|
||||
RTYPE=0002
|
||||
RDATA=05746C64316100
|
||||
------
|
||||
OWNER=013600
|
||||
CLASS=0001
|
||||
RRTTL=00000001
|
||||
RTYPE=0002
|
||||
RDATA=00
|
||||
------
|
||||
OWNER=016203746c6400
|
||||
CLASS=0001
|
||||
RRTTL=00000E10
|
||||
RTYPE=0002
|
||||
RDATA=03746C6400
|
||||
------
|
||||
OWNER=016205746c64316100
|
||||
CLASS=0001
|
||||
RRTTL=00000E10
|
||||
RTYPE=0002
|
||||
RDATA=05746C64316100
|
||||
------
|
||||
OWNER=013700
|
||||
CLASS=0001
|
||||
RRTTL=00000001
|
||||
RTYPE=0002
|
||||
RDATA=00
|
||||
------
|
||||
ERROR=ZSCANNER_EBAD_INCLUDE_FILENAME
|
||||
------
|
||||
6
src/zscanner/test/tests/06-1_INCLUDE.in
Normal file
6
src/zscanner/test/tests/06-1_INCLUDE.in
Normal file
|
|
@ -0,0 +1,6 @@
|
|||
$ORIGIN .
|
||||
$TTL 1
|
||||
|
||||
; KO
|
||||
$INCLUDE ./includes/include1 a ; Origin is not FQD
|
||||
|
||||
2
src/zscanner/test/tests/06-1_INCLUDE.out
Normal file
2
src/zscanner/test/tests/06-1_INCLUDE.out
Normal file
|
|
@ -0,0 +1,2 @@
|
|||
ERROR=ZSCANNER_EBAD_INCLUDE_ORIGIN
|
||||
------
|
||||
6
src/zscanner/test/tests/06-2_INCLUDE.in
Normal file
6
src/zscanner/test/tests/06-2_INCLUDE.in
Normal file
|
|
@ -0,0 +1,6 @@
|
|||
$ORIGIN .
|
||||
$TTL 1
|
||||
|
||||
; KO
|
||||
$INCLUDE ./includes/include1 % ; Bad origin
|
||||
|
||||
2
src/zscanner/test/tests/06-2_INCLUDE.out
Normal file
2
src/zscanner/test/tests/06-2_INCLUDE.out
Normal file
|
|
@ -0,0 +1,2 @@
|
|||
ERROR=ZSCANNER_EBAD_INCLUDE_ORIGIN
|
||||
------
|
||||
6
src/zscanner/test/tests/06-3_INCLUDE.in
Normal file
6
src/zscanner/test/tests/06-3_INCLUDE.in
Normal file
|
|
@ -0,0 +1,6 @@
|
|||
$ORIGIN .
|
||||
$TTL 1
|
||||
|
||||
; KO
|
||||
$INCLUDE /tmp/zscanner_tests/ ; Given file is a directory
|
||||
|
||||
2
src/zscanner/test/tests/06-3_INCLUDE.out
Normal file
2
src/zscanner/test/tests/06-3_INCLUDE.out
Normal file
|
|
@ -0,0 +1,2 @@
|
|||
ERROR=ZSCANNER_EUNPROCESSED_INCLUDE
|
||||
------
|
||||
6
src/zscanner/test/tests/06-4_INCLUDE.in
Normal file
6
src/zscanner/test/tests/06-4_INCLUDE.in
Normal file
|
|
@ -0,0 +1,6 @@
|
|||
$ORIGIN .
|
||||
$TTL 1
|
||||
|
||||
; KO
|
||||
$INCLUDE /tmp/zscanner_tests/_ ; File doesn't exist
|
||||
|
||||
2
src/zscanner/test/tests/06-4_INCLUDE.out
Normal file
2
src/zscanner/test/tests/06-4_INCLUDE.out
Normal file
|
|
@ -0,0 +1,2 @@
|
|||
ERROR=ZSCANNER_EUNOPENED_INCLUDE
|
||||
------
|
||||
5
src/zscanner/test/tests/06-5_INCLUDE.in
Normal file
5
src/zscanner/test/tests/06-5_INCLUDE.in
Normal file
|
|
@ -0,0 +1,5 @@
|
|||
$ORIGIN .
|
||||
$TTL 1
|
||||
|
||||
; KO
|
||||
$INCLUDE ./includes/include3 ; Blank include file
|
||||
2
src/zscanner/test/tests/06-5_INCLUDE.out
Normal file
2
src/zscanner/test/tests/06-5_INCLUDE.out
Normal file
|
|
@ -0,0 +1,2 @@
|
|||
ERROR=ZSCANNER_EUNPROCESSED_INCLUDE
|
||||
------
|
||||
5
src/zscanner/test/tests/06-6_INCLUDE.in
Normal file
5
src/zscanner/test/tests/06-6_INCLUDE.in
Normal file
|
|
@ -0,0 +1,5 @@
|
|||
$ORIGIN .
|
||||
$TTL 1
|
||||
|
||||
; KO
|
||||
$INCLUDE ./includes/include4 ; Include file contains warning
|
||||
4
src/zscanner/test/tests/06-6_INCLUDE.out
Normal file
4
src/zscanner/test/tests/06-6_INCLUDE.out
Normal file
|
|
@ -0,0 +1,4 @@
|
|||
WARNG=ZSCANNER_EBAD_RDATA
|
||||
------
|
||||
ERROR=ZSCANNER_EUNPROCESSED_INCLUDE
|
||||
------
|
||||
5
src/zscanner/test/tests/06-7_INCLUDE.in
Normal file
5
src/zscanner/test/tests/06-7_INCLUDE.in
Normal file
|
|
@ -0,0 +1,5 @@
|
|||
$ORIGIN .
|
||||
$TTL 1
|
||||
|
||||
; KO
|
||||
$INCLUDE ./includes/include5 ; Include file contains error
|
||||
4
src/zscanner/test/tests/06-7_INCLUDE.out
Normal file
4
src/zscanner/test/tests/06-7_INCLUDE.out
Normal file
|
|
@ -0,0 +1,4 @@
|
|||
ERROR=ZSCANNER_EBAD_NUMBER
|
||||
------
|
||||
ERROR=ZSCANNER_EUNPROCESSED_INCLUDE
|
||||
------
|
||||
5
src/zscanner/test/tests/06-8_INCLUDE.in
Normal file
5
src/zscanner/test/tests/06-8_INCLUDE.in
Normal file
|
|
@ -0,0 +1,5 @@
|
|||
$ORIGIN .
|
||||
$TTL 1
|
||||
|
||||
; KO
|
||||
$INCLUDE ./includes/include6 ; Include file contains include
|
||||
12
src/zscanner/test/tests/06-8_INCLUDE.out
Normal file
12
src/zscanner/test/tests/06-8_INCLUDE.out
Normal file
|
|
@ -0,0 +1,12 @@
|
|||
OWNER=016200
|
||||
CLASS=0001
|
||||
RRTTL=00000E10
|
||||
RTYPE=0002
|
||||
RDATA=00
|
||||
------
|
||||
OWNER=016205746c64316100
|
||||
CLASS=0001
|
||||
RRTTL=00000E10
|
||||
RTYPE=0002
|
||||
RDATA=05746C64316100
|
||||
------
|
||||
|
|
@ -54,4 +54,3 @@ WARNG=ZSCANNER_EBAD_HEX_RDATA
|
|||
------
|
||||
WARNG=ZSCANNER_EBAD_RDATA_LENGTH
|
||||
------
|
||||
|
||||
|
|
|
|||
|
|
@ -66,4 +66,3 @@ WARNG=ZSCANNER_EBAD_HEX_RDATA
|
|||
------
|
||||
WARNG=ZSCANNER_EBAD_RDATA_LENGTH
|
||||
------
|
||||
|
||||
|
|
|
|||
|
|
@ -11,6 +11,7 @@ $TTL 1
|
|||
@ TXT "" "test1" "\255" test2 ; Array of text strings
|
||||
@ TXT "" "" "" ; Array of blank strings
|
||||
@ TXT first \# "\#" ; Array with special string
|
||||
@ TXT \0320\ \\\"\.\@\*.tld. ; Special domain as a string
|
||||
@ TXT " !\"#$%&'()*+,-./0123456789:;<=>?@" ; First part of all printables
|
||||
@ TXT "ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`" ; Second part of all printables
|
||||
@ TXT "abcdefghijklmnopqrstuvwxyz{|}~" ; Third part of all printables
|
||||
|
|
|
|||
|
|
@ -56,6 +56,12 @@ OWNER=00
|
|||
CLASS=0001
|
||||
RRTTL=00000001
|
||||
RTYPE=0010
|
||||
RDATA=0D2030205C222E402A2E746C642E
|
||||
------
|
||||
OWNER=00
|
||||
CLASS=0001
|
||||
RRTTL=00000001
|
||||
RTYPE=0010
|
||||
RDATA=21202122232425262728292A2B2C2D2E2F303132333435363738393A3B3C3D3E3F40
|
||||
------
|
||||
OWNER=00
|
||||
|
|
@ -126,4 +132,3 @@ WARNG=ZSCANNER_EBAD_TEXT
|
|||
------
|
||||
WARNG=ZSCANNER_EITEM_OVERFLOW
|
||||
------
|
||||
|
||||
|
|
|
|||
|
|
@ -30,4 +30,3 @@ RDATA=00
|
|||
------
|
||||
WARNG=ZSCANNER_EBAD_RDATA
|
||||
------
|
||||
|
||||
|
|
|
|||
|
|
@ -144,4 +144,3 @@ WARNG=ZSCANNER_EBAD_HEX_RDATA
|
|||
------
|
||||
WARNG=ZSCANNER_EBAD_RDATA_LENGTH
|
||||
------
|
||||
|
||||
|
|
|
|||
|
|
@ -30,4 +30,3 @@ RDATA=00
|
|||
------
|
||||
WARNG=ZSCANNER_EBAD_RDATA
|
||||
------
|
||||
|
||||
|
|
|
|||
|
|
@ -30,4 +30,3 @@ RDATA=00
|
|||
------
|
||||
WARNG=ZSCANNER_EBAD_RDATA
|
||||
------
|
||||
|
||||
|
|
|
|||
|
|
@ -30,4 +30,3 @@ RDATA=00
|
|||
------
|
||||
WARNG=ZSCANNER_EBAD_RDATA
|
||||
------
|
||||
|
||||
|
|
|
|||
|
|
@ -66,4 +66,3 @@ WARNG=ZSCANNER_EBAD_HEX_RDATA
|
|||
------
|
||||
WARNG=ZSCANNER_EBAD_RDATA_LENGTH
|
||||
------
|
||||
|
||||
|
|
|
|||
|
|
@ -30,4 +30,3 @@ RDATA=0001 00
|
|||
------
|
||||
WARNG=ZSCANNER_EBAD_NUMBER
|
||||
------
|
||||
|
||||
|
|
|
|||
|
|
@ -30,4 +30,3 @@ RDATA=0001 00
|
|||
------
|
||||
WARNG=ZSCANNER_EBAD_NUMBER
|
||||
------
|
||||
|
||||
|
|
|
|||
|
|
@ -30,4 +30,3 @@ RDATA=0001 00
|
|||
------
|
||||
WARNG=ZSCANNER_EBAD_NUMBER
|
||||
------
|
||||
|
||||
|
|
|
|||
|
|
@ -92,4 +92,3 @@ WARNG=ZSCANNER_EBAD_REST
|
|||
------
|
||||
WARNG=ZSCANNER_EITEM_OVERFLOW
|
||||
------
|
||||
|
||||
|
|
|
|||
|
|
@ -52,4 +52,3 @@ WARNG=ZSCANNER_EBAD_HEX_RDATA
|
|||
------
|
||||
WARNG=ZSCANNER_EBAD_RDATA_LENGTH
|
||||
------
|
||||
|
||||
|
|
|
|||
|
|
@ -30,4 +30,3 @@ RDATA=00 00
|
|||
------
|
||||
WARNG=ZSCANNER_EBAD_RDATA
|
||||
------
|
||||
|
||||
|
|
|
|||
|
|
@ -82,4 +82,3 @@ WARNG=ZSCANNER_EBAD_HEX_RDATA
|
|||
------
|
||||
WARNG=ZSCANNER_EBAD_RDATA_LENGTH
|
||||
------
|
||||
|
||||
|
|
|
|||
9
src/zscanner/test/tests/includes/include1
Normal file
9
src/zscanner/test/tests/includes/include1
Normal file
|
|
@ -0,0 +1,9 @@
|
|||
$TTL 1
|
||||
|
||||
a NS @
|
||||
|
||||
$ORIGIN tld1a.
|
||||
a NS @
|
||||
|
||||
$ORIGIN tld1b.
|
||||
a NS @
|
||||
6
src/zscanner/test/tests/includes/include2
Normal file
6
src/zscanner/test/tests/includes/include2
Normal file
|
|
@ -0,0 +1,6 @@
|
|||
$TTL 1H
|
||||
|
||||
b NS @
|
||||
|
||||
$ORIGIN tld1a.
|
||||
b NS @
|
||||
1
src/zscanner/test/tests/includes/include4
Normal file
1
src/zscanner/test/tests/includes/include4
Normal file
|
|
@ -0,0 +1 @@
|
|||
a NS ; Missing data
|
||||
1
src/zscanner/test/tests/includes/include5
Normal file
1
src/zscanner/test/tests/includes/include5
Normal file
|
|
@ -0,0 +1 @@
|
|||
$TTL x ; Bad number
|
||||
1
src/zscanner/test/tests/includes/include6
Normal file
1
src/zscanner/test/tests/includes/include6
Normal file
|
|
@ -0,0 +1 @@
|
|||
$INCLUDE include2 ; Include in include
|
||||
Loading…
Reference in a new issue