X-Git-Url: https://git.distorted.org.uk/~mdw/dnserr/blobdiff_plain/5f465544aaf468449503a0a7c079e6107c99a1c8..00194367a6715659248ebc98f6efd72f61f1d34f:/Makefile?ds=inline diff --git a/Makefile b/Makefile index acdd754..7a397d1 100644 --- a/Makefile +++ b/Makefile @@ -57,16 +57,29 @@ dnserr.zone.sigold: dnserr.zone key/$(ZONE).stamp TARGETS += dnserr.zone.sig OLDSIGMATCH = $$1 == "expired-rrsig.$(ZONE)." && \ - $$4 == "RRSIG" && $$5 == "A" + $$4 == "RRSIG" && ($$5 == "A" || $$5 == "AAAA") BADSIGMATCH = $$1 == "invalid-rrsig.$(ZONE)." && \ - $$4 == "RRSIG" && $$5 == "A" + $$4 == "RRSIG" && ($$5 == "A" || $$5 == "AAAA") CLEAN += t.oldsig dnserr.zone.sig: dnserr.zone.sigold dnserr.zone.signew awk '$(OLDSIGMATCH) { print; }' \ dnserr.zone.sigold >t.oldsig - awk '$(OLDSIGMATCH) { system("cat t.oldsig"); next; } \ - { gsub(/invalid-rrsigx/, "invalid-rrsig"); print; }' \ - dnserr.zone.signew >$@.new + awk '$(OLDSIGMATCH) { \ + if (!doneoldsig) { system("cat t.oldsig"); doneoldsig = 1; } \ + next; \ + } \ + $(BADSIGMATCH) { \ + s = $$13; \ + for (i = length(s)/2; i >= 0; i--) { \ + c = substr(s, i, 1); \ + if (c != tolower(c)) { c = tolower(c); break; } \ + else if (c != toupper(c)) { c = toupper(c); break; } \ + } \ + $$13 = substr(s, 0, i) c substr(s, i + 1); \ + } \ + { print; }' \ + dnserr.zone.signew >$@.new + rm t.oldsig mv $@.new $@ CLEAN += $(TARGETS)