# key "one" should fail
t=`expr $t + 1`
$DIG $DIGOPTS tsigzone. \
- @10.53.0.2 -b 10.53.0.1 axfr -y one:1234abcd8765 -p 5300 > dig.out
-grep "^;" dig.out > /dev/null 2>&1 || { echo "I:test $t failed" ; status=1; }
+ @10.53.0.2 -b 10.53.0.1 axfr -y one:1234abcd8765 -p 5300 > dig.out.${t}
+grep "^;" dig.out.${t} > /dev/null 2>&1 || { echo "I:test $t failed" ; status=1; }
+
# any other key should be fine
t=`expr $t + 1`
$DIG $DIGOPTS tsigzone. \
- @10.53.0.2 -b 10.53.0.1 axfr -y two:1234abcd8765 -p 5300 > dig.out
-grep "^;" dig.out > /dev/null 2>&1 && { echo "I:test $t failed" ; status=1; }
+ @10.53.0.2 -b 10.53.0.1 axfr -y two:1234abcd8765 -p 5300 > dig.out.${t}
+grep "^;" dig.out.${t} > /dev/null 2>&1 && { echo "I:test $t failed" ; status=1; }
cp -f ns2/named2.conf ns2/named.conf
$RNDC -c ../common/rndc.conf -s 10.53.0.2 -p 9953 reload 2>&1 | sed 's/^/I:ns2 /'
# prefix 10/8 should fail
t=`expr $t + 1`
$DIG $DIGOPTS tsigzone. \
- @10.53.0.2 -b 10.53.0.1 axfr -y one:1234abcd8765 -p 5300 > dig.out
-grep "^;" dig.out > /dev/null 2>&1 || { echo "I:test $t failed" ; status=1; }
+ @10.53.0.2 -b 10.53.0.1 axfr -y one:1234abcd8765 -p 5300 > dig.out.${t}
+grep "^;" dig.out.${t} > /dev/null 2>&1 || { echo "I:test $t failed" ; status=1; }
# any other address should work, as long as it sends key "one"
t=`expr $t + 1`
$DIG $DIGOPTS tsigzone. \
- @10.53.0.2 -b 127.0.0.1 axfr -y two:1234abcd8765 -p 5300 > dig.out
-grep "^;" dig.out > /dev/null 2>&1 || { echo "I:test $t failed" ; status=1; }
+ @10.53.0.2 -b 127.0.0.1 axfr -y two:1234abcd8765 -p 5300 > dig.out.${t}
+grep "^;" dig.out.${t} > /dev/null 2>&1 || { echo "I:test $t failed" ; status=1; }
t=`expr $t + 1`
$DIG $DIGOPTS tsigzone. \
- @10.53.0.2 -b 127.0.0.1 axfr -y one:1234abcd8765 -p 5300 > dig.out
-grep "^;" dig.out > /dev/null 2>&1 && { echo "I:test $t failed" ; status=1; }
+ @10.53.0.2 -b 127.0.0.1 axfr -y one:1234abcd8765 -p 5300 > dig.out.${t}
+grep "^;" dig.out.${t} > /dev/null 2>&1 && { echo "I:test $t failed" ; status=1; }
echo "I:testing nested ACL processing"
# all combinations of 10.53.0.{1|2} with key {one|two}, should succeed
# should succeed
t=`expr $t + 1`
$DIG $DIGOPTS tsigzone. \
- @10.53.0.2 -b 10.53.0.2 axfr -y two:1234abcd8765 -p 5300 > dig.out
-grep "^;" dig.out > /dev/null 2>&1 && { echo "I:test $t failed" ; status=1; }
+ @10.53.0.2 -b 10.53.0.2 axfr -y two:1234abcd8765 -p 5300 > dig.out.${t}
+grep "^;" dig.out.${t} > /dev/null 2>&1 && { echo "I:test $t failed" ; status=1; }
# should succeed
t=`expr $t + 1`
$DIG $DIGOPTS tsigzone. \
- @10.53.0.2 -b 10.53.0.2 axfr -y one:1234abcd8765 -p 5300 > dig.out
-grep "^;" dig.out > /dev/null 2>&1 && { echo "I:test $t failed" ; status=1; }
+ @10.53.0.2 -b 10.53.0.2 axfr -y one:1234abcd8765 -p 5300 > dig.out.${t}
+grep "^;" dig.out.${t} > /dev/null 2>&1 && { echo "I:test $t failed" ; status=1; }
# should succeed
t=`expr $t + 1`
$DIG $DIGOPTS tsigzone. \
- @10.53.0.2 -b 10.53.0.1 axfr -y two:1234abcd8765 -p 5300 > dig.out
-grep "^;" dig.out > /dev/null 2>&1 && { echo "I:test $t failed" ; status=1; }
+ @10.53.0.2 -b 10.53.0.1 axfr -y two:1234abcd8765 -p 5300 > dig.out.${t}
+grep "^;" dig.out.${t} > /dev/null 2>&1 && { echo "I:test $t failed" ; status=1; }
# should succeed
t=`expr $t + 1`
$DIG $DIGOPTS tsigzone. \
- @10.53.0.2 -b 10.53.0.1 axfr -y two:1234abcd8765 -p 5300 > dig.out
-grep "^;" dig.out > /dev/null 2>&1 && { echo "I:test $t failed" ; status=1; }
+ @10.53.0.2 -b 10.53.0.1 axfr -y two:1234abcd8765 -p 5300 > dig.out.${t}
+grep "^;" dig.out.${t} > /dev/null 2>&1 && { echo "I:test $t failed" ; status=1; }
# but only one or the other should fail
t=`expr $t + 1`
$DIG $DIGOPTS tsigzone. \
- @10.53.0.2 -b 127.0.0.1 axfr -y one:1234abcd8765 -p 5300 > dig.out
-grep "^;" dig.out > /dev/null 2>&1 || { echo "I:test $t failed" ; status=1; }
+ @10.53.0.2 -b 127.0.0.1 axfr -y one:1234abcd8765 -p 5300 > dig.out.${t}
+grep "^;" dig.out.${t} > /dev/null 2>&1 || { echo "I:test $t failed" ; status=1; }
t=`expr $t + 1`
$DIG $DIGOPTS tsigzone. \
- @10.53.0.2 -b 10.53.0.2 axfr -p 5300 > dig.out
-grep "^;" dig.out > /dev/null 2>&1 || { echo "I:test $tt failed" ; status=1; }
+ @10.53.0.2 -b 10.53.0.2 axfr -p 5300 > dig.out.${t}
+grep "^;" dig.out.${t} > /dev/null 2>&1 || { echo "I:test $tt failed" ; status=1; }
# and other values? right out
t=`expr $t + 1`
$DIG $DIGOPTS tsigzone. \
- @10.53.0.2 -b 127.0.0.1 axfr -y three:1234abcd8765 -p 5300 > dig.out
-grep "^;" dig.out > /dev/null 2>&1 || { echo "I:test $t failed" ; status=1; }
+ @10.53.0.2 -b 127.0.0.1 axfr -y three:1234abcd8765 -p 5300 > dig.out.${t}
+grep "^;" dig.out.${t} > /dev/null 2>&1 || { echo "I:test $t failed" ; status=1; }
# now we only allow 10.53.0.1 *and* key one, or 10.53.0.2 *and* key two
cp -f ns2/named4.conf ns2/named.conf
# should succeed
t=`expr $t + 1`
$DIG $DIGOPTS tsigzone. \
- @10.53.0.2 -b 10.53.0.2 axfr -y two:1234abcd8765 -p 5300 > dig.out
-grep "^;" dig.out > /dev/null 2>&1 && { echo "I:test $t failed" ; status=1; }
+ @10.53.0.2 -b 10.53.0.2 axfr -y two:1234abcd8765 -p 5300 > dig.out.${t}
+grep "^;" dig.out.${t} > /dev/null 2>&1 && { echo "I:test $t failed" ; status=1; }
# should succeed
t=`expr $t + 1`
$DIG $DIGOPTS tsigzone. \
- @10.53.0.2 -b 10.53.0.1 axfr -y one:1234abcd8765 -p 5300 > dig.out
-grep "^;" dig.out > /dev/null 2>&1 && { echo "I:test $t failed" ; status=1; }
+ @10.53.0.2 -b 10.53.0.1 axfr -y one:1234abcd8765 -p 5300 > dig.out.${t}
+grep "^;" dig.out.${t} > /dev/null 2>&1 && { echo "I:test $t failed" ; status=1; }
# should fail
t=`expr $t + 1`
$DIG $DIGOPTS tsigzone. \
- @10.53.0.2 -b 10.53.0.2 axfr -y one:1234abcd8765 -p 5300 > dig.out
-grep "^;" dig.out > /dev/null 2>&1 || { echo "I:test $t failed" ; status=1; }
+ @10.53.0.2 -b 10.53.0.2 axfr -y one:1234abcd8765 -p 5300 > dig.out.${t}
+grep "^;" dig.out.${t} > /dev/null 2>&1 || { echo "I:test $t failed" ; status=1; }
# should fail
t=`expr $t + 1`
$DIG $DIGOPTS tsigzone. \
- @10.53.0.2 -b 10.53.0.1 axfr -y two:1234abcd8765 -p 5300 > dig.out
-grep "^;" dig.out > /dev/null 2>&1 || { echo "I:test $t failed" ; status=1; }
+ @10.53.0.2 -b 10.53.0.1 axfr -y two:1234abcd8765 -p 5300 > dig.out.${t}
+grep "^;" dig.out.${t} > /dev/null 2>&1 || { echo "I:test $t failed" ; status=1; }
# should fail
t=`expr $t + 1`
$DIG $DIGOPTS tsigzone. \
- @10.53.0.2 -b 10.53.0.3 axfr -y one:1234abcd8765 -p 5300 > dig.out
-grep "^;" dig.out > /dev/null 2>&1 || { echo "I:test $t failed" ; status=1; }
+ @10.53.0.2 -b 10.53.0.3 axfr -y one:1234abcd8765 -p 5300 > dig.out.${t}
+grep "^;" dig.out.${t} > /dev/null 2>&1 || { echo "I:test $t failed" ; status=1; }
echo "I:testing allow-query-on ACL processing"
cp -f ns2/named5.conf ns2/named.conf
sleep 5
t=`expr $t + 1`
$DIG +tcp soa example. \
- @10.53.0.2 -b 10.53.0.3 -p 5300 > dig.out
-grep "status: NOERROR" dig.out > /dev/null 2>&1 || { echo "I:test $t failed" ; status=1; }
+ @10.53.0.2 -b 10.53.0.3 -p 5300 > dig.out.${t}
+grep "status: NOERROR" dig.out.${t} > /dev/null 2>&1 || { echo "I:test $t failed" ; status=1; }
echo "I:exit status: $status"
exit $status
static isc_result_t
multitxt_fromtext(isc_textregion_t *source, isc_buffer_t *target);
-static isc_result_t
-multitxt_fromwire(isc_buffer_t *source, isc_buffer_t *target);
-
static isc_boolean_t
name_prefix(dns_name_t *name, dns_name_t *origin, dns_name_t *target);
return (ISC_R_SUCCESS);
}
-static isc_result_t
-multitxt_fromwire(isc_buffer_t *source, isc_buffer_t *target) {
- unsigned int n;
- isc_region_t sregion;
- isc_region_t tregion;
-
- isc_buffer_activeregion(source, &sregion);
- if (sregion.length == 0)
- return(ISC_R_UNEXPECTEDEND);
- n = 256U;
- do {
- if (n != 256U)
- return (DNS_R_SYNTAX);
-
- n = sregion.length;
-
- isc_buffer_availableregion(target, &tregion);
- if (n > tregion.length)
- return (ISC_R_NOSPACE);
-
- memmove(tregion.base, sregion.base, n);
- isc_buffer_forward(source, n);
- isc_buffer_add(target, n);
- isc_buffer_activeregion(source, &sregion);
- } while (sregion.length != 0);
- return (ISC_R_SUCCESS);
-}
-
static isc_boolean_t
name_prefix(dns_name_t *name, dns_name_t *origin, dns_name_t *target) {
int l1, l2;
isc_buffer_activeregion(source, ®ion);
if (region.length < 4)
return (ISC_R_UNEXPECTEDEND);
- RETERR(mem_tobuffer(target, region.base, 4));
- isc_buffer_forward(source, 4);
/*
- * Target URI
+ * Priority, weight and target URI
*/
- RETERR(multitxt_fromwire(source, target));
-
- return (ISC_R_SUCCESS);
+ isc_buffer_forward(source, region.length);
+ return (mem_tobuffer(target, region.base, region.length));
}
static inline isc_result_t
static inline isc_result_t
fromstruct_uri(ARGS_FROMSTRUCT) {
dns_rdata_uri_t *uri = source;
- isc_region_t region;
- isc_uint8_t len;
REQUIRE(type == 256);
REQUIRE(source != NULL);
/*
* Target URI
*/
- len = 255U;
- region.base = uri->target;
- region.length = uri->tgt_len;
- while (region.length > 0) {
- REQUIRE(len == 255U);
- len = uint8_fromregion(®ion);
- isc_region_consume(®ion, 1);
- if (region.length < len)
- return (ISC_R_UNEXPECTEDEND);
- isc_region_consume(®ion, len);
- }
-
return (mem_tobuffer(target, uri->target, uri->tgt_len));
}