]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
Check that bad EUI48 and EUI64 are caught 12490/head
authorMark Andrews <marka@isc.org>
Mon, 3 Aug 2026 04:58:22 +0000 (14:58 +1000)
committerMark Andrews <marka@isc.org>
Thu, 6 Aug 2026 13:23:27 +0000 (23:23 +1000)
Checks that missing leading zeros and trailing garbage is detected.

bin/tests/system/checkzone/tests.sh
bin/tests/system/checkzone/zones/bad-eui48-no-leading-zero.db [new file with mode: 0644]
bin/tests/system/checkzone/zones/bad-eui48-three-digits.db [new file with mode: 0644]
bin/tests/system/checkzone/zones/bad-eui48-too-short.db [new file with mode: 0644]
bin/tests/system/checkzone/zones/bad-eui48-trailing-garbage.db [new file with mode: 0644]
bin/tests/system/checkzone/zones/bad-eui64-no-leading-zero.db [new file with mode: 0644]
bin/tests/system/checkzone/zones/bad-eui64-three-digits.db [new file with mode: 0644]
bin/tests/system/checkzone/zones/bad-eui64-too-short.db [new file with mode: 0644]
bin/tests/system/checkzone/zones/bad-eui64-trailing-garbage.db [new file with mode: 0644]

index bd2be2223d57151db028be9b5b94dee1d10d59f1..87185d7ddbab42757341afe8b65596b7247022fe 100644 (file)
@@ -83,6 +83,10 @@ for db in zones/bad*.db; do
       grep "zones/bad-eid.db:1: near eol: unexpected end of input" test.out.$n >/dev/null || ret=1
       grep "zones/bad-eid.db:2: near eol: unexpected end of input" test.out.$n >/dev/null || ret=1
       ;;
+    zones/bad-eui48-*.db | zones/bad-eui64-*.db)
+      $CHECKZONE -i local example $db >test.out.$n 2>&1 || v=$?
+      grep "bad EUI" test.out.$n >/dev/null || ret=1
+      ;;
     zones/bad-generate-garbage.db | zones/bad-generate-missing-brace.db)
       $CHECKZONE -i local example $db >test.out.$n 2>&1 || v=$?
       grep "\$GENERATE: ${db}:6: syntax error" test.out.$n >/dev/null || ret=1
diff --git a/bin/tests/system/checkzone/zones/bad-eui48-no-leading-zero.db b/bin/tests/system/checkzone/zones/bad-eui48-no-leading-zero.db
new file mode 100644 (file)
index 0000000..475bbd3
--- /dev/null
@@ -0,0 +1,5 @@
+$TTL 600
+@              SOA     ns hostmaster 2011012708 3600 1200 604800 1200
+               NS      ns
+ns             A       192.0.2.1
+bad            EUI48   1-23-45-67-89-ab
diff --git a/bin/tests/system/checkzone/zones/bad-eui48-three-digits.db b/bin/tests/system/checkzone/zones/bad-eui48-three-digits.db
new file mode 100644 (file)
index 0000000..65992eb
--- /dev/null
@@ -0,0 +1,5 @@
+$TTL 600
+@              SOA     ns hostmaster 2011012708 3600 1200 604800 1200
+               NS      ns
+ns             A       192.0.2.1
+bad            EUI48   01-23-45-567-89-ab
diff --git a/bin/tests/system/checkzone/zones/bad-eui48-too-short.db b/bin/tests/system/checkzone/zones/bad-eui48-too-short.db
new file mode 100644 (file)
index 0000000..83eb931
--- /dev/null
@@ -0,0 +1,5 @@
+$TTL 600
+@              SOA     ns hostmaster 2011012708 3600 1200 604800 1200
+               NS      ns
+ns             A       192.0.2.1
+bad            EUI48   01-23-45-67-89
diff --git a/bin/tests/system/checkzone/zones/bad-eui48-trailing-garbage.db b/bin/tests/system/checkzone/zones/bad-eui48-trailing-garbage.db
new file mode 100644 (file)
index 0000000..25cf46d
--- /dev/null
@@ -0,0 +1,5 @@
+$TTL 600
+@              SOA     ns hostmaster 2011012708 3600 1200 604800 1200
+               NS      ns
+ns             A       192.0.2.1
+bad            EUI48   01-23-45-67-89-abgarbage
diff --git a/bin/tests/system/checkzone/zones/bad-eui64-no-leading-zero.db b/bin/tests/system/checkzone/zones/bad-eui64-no-leading-zero.db
new file mode 100644 (file)
index 0000000..f420ae7
--- /dev/null
@@ -0,0 +1,5 @@
+$TTL 600
+@              SOA     ns hostmaster 2011012708 3600 1200 604800 1200
+               NS      ns
+ns             A       192.0.2.1
+bad            EUI64   1-23-45-67-89-ab-cd-ef
diff --git a/bin/tests/system/checkzone/zones/bad-eui64-three-digits.db b/bin/tests/system/checkzone/zones/bad-eui64-three-digits.db
new file mode 100644 (file)
index 0000000..e4b0618
--- /dev/null
@@ -0,0 +1,5 @@
+$TTL 600
+@              SOA     ns hostmaster 2011012708 3600 1200 604800 1200
+               NS      ns
+ns             A       192.0.2.1
+bad            EUI64   01-23-45-567-89-ab-cd-ef
diff --git a/bin/tests/system/checkzone/zones/bad-eui64-too-short.db b/bin/tests/system/checkzone/zones/bad-eui64-too-short.db
new file mode 100644 (file)
index 0000000..c518ef7
--- /dev/null
@@ -0,0 +1,5 @@
+$TTL 600
+@              SOA     ns hostmaster 2011012708 3600 1200 604800 1200
+               NS      ns
+ns             A       192.0.2.1
+bad            EUI64   01-23-45-67-89-ab-cd
diff --git a/bin/tests/system/checkzone/zones/bad-eui64-trailing-garbage.db b/bin/tests/system/checkzone/zones/bad-eui64-trailing-garbage.db
new file mode 100644 (file)
index 0000000..6dedf2b
--- /dev/null
@@ -0,0 +1,5 @@
+$TTL 600
+@              SOA     ns hostmaster 2011012708 3600 1200 604800 1200
+               NS      ns
+ns             A       192.0.2.1
+bad            EUI64   01-23-45-67-89-ab-cd-efgarbage