From 8fd8404e16a1511892a5e20c9c65143ec6687e3b Mon Sep 17 00:00:00 2001 From: Matthijs Mekking Date: Fri, 6 Dec 2019 12:28:40 +0100 Subject: [PATCH 1/3] Replace two leftover ttlval with duration Since the introduction of durations, all ttlval configuration types are replaced with durations. Duration is an ISO 8601 duration, a TTL-style value, or a number. These two references were missed and are now also replaced. --- bin/named/named.conf.docbook | 2 +- doc/arm/dnssec-policy.grammar.xml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/bin/named/named.conf.docbook b/bin/named/named.conf.docbook index e07c2b8049..b31a3af32a 100644 --- a/bin/named/named.conf.docbook +++ b/bin/named/named.conf.docbook @@ -1017,7 +1017,7 @@ zone string [ class ] { dnssec-policy string { - dnskey-ttl ttlval; + dnskey-ttl duration; keys { ( csk | ksk | zsk ) key-directory lifetime duration algorithm integer [ integer ] ; ... }; parent-ds-ttl duration; parent-propagation-delay duration; diff --git a/doc/arm/dnssec-policy.grammar.xml b/doc/arm/dnssec-policy.grammar.xml index c7df40c4d3..20bc930097 100644 --- a/doc/arm/dnssec-policy.grammar.xml +++ b/doc/arm/dnssec-policy.grammar.xml @@ -13,7 +13,7 @@ dnssec-policy string { - dnskey-ttl ttlval; + dnskey-ttl duration; keys { ( csk | ksk | zsk ) key-directory duration integer [ integer ] ; ... }; parent-ds-ttl duration; parent-propagation-delay duration; From 60fa5fc7604350b2e8e972e73376cb6c9410fe20 Mon Sep 17 00:00:00 2001 From: Matthijs Mekking Date: Fri, 6 Dec 2019 13:12:06 +0100 Subject: [PATCH 2/3] Fix duration printing on Solaris --- CHANGES | 3 +++ lib/isccfg/parser.c | 3 ++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/CHANGES b/CHANGES index 6a108ae3d1..a590558886 100644 --- a/CHANGES +++ b/CHANGES @@ -1,3 +1,6 @@ +5333. [bug] Fix duration printing on Solaris when value is not + an ISO 8601 duration. [GL #1460] + 5332. [func] Renamed "dnssec-keys" configuration statement to the more descriptive "trust-anchors". diff --git a/lib/isccfg/parser.c b/lib/isccfg/parser.c index 849478d624..97647ca58e 100644 --- a/lib/isccfg/parser.c +++ b/lib/isccfg/parser.c @@ -1022,7 +1022,8 @@ cfg_print_duration(cfg_printer_t *pctx, const cfg_obj_t *obj) { /* If this is not an ISO 8601 duration, just print it as a number. */ if (!duration.iso8601) { - return (cfg_print_rawuint(pctx, duration.parts[6])); + cfg_print_rawuint(pctx, duration.parts[6]); + return; } /* Calculate length of string. */ From 9dfa33050b00cf4d5103181ebddc517a2a99d9e8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ond=C5=99ej=20Sur=C3=BD?= Date: Fri, 6 Dec 2019 13:29:04 +0100 Subject: [PATCH 3/3] Add semantic patch to find void f() { ... return ((void)g())); ... } When a function returns void, it can be used as an argument to return in function returning also void, e.g.: void in(void) { return; } void out(void) { return (in()); } while this is legal, it should be rewritten as: void out(void) { in(); return; } The semantic patch just find the occurrences, and they need to be fixed by hand. --- cocci/return-void-from-void.spatch | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 cocci/return-void-from-void.spatch diff --git a/cocci/return-void-from-void.spatch b/cocci/return-void-from-void.spatch new file mode 100644 index 0000000000..fcc639f6ea --- /dev/null +++ b/cocci/return-void-from-void.spatch @@ -0,0 +1,19 @@ +@ rule1 @ +identifier f1; +@@ + +void f1(...) +{ +... +} + +@ rule2 @ +identifier rule1.f1; +identifier f2; +@@ + +void f2(...) { +... +* return(f1(...)); +... +}