File: 0001-Fix-deferred-functions-within-target-arguments.patch

package info (click to toggle)
ferm 2.7-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 2,140 kB
  • sloc: perl: 2,839; sh: 126; makefile: 120
file content (31 lines) | stat: -rw-r--r-- 1,085 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
From: Faidon Liambotis <paravoid@debian.org>
Date: Mon, 24 Feb 2020 21:59:33 +0200
Subject: Fix (deferred) functions within target arguments

Since deferred functions were introduced (commits fe99bc2, 31bb5d3
etc.), passing functions like @ipfilter to target arguments (such SNAT's
to-source) was broken, resulting into broken output.

Abstract the realization of deferred functions into a separate
subroutine, and call it also from parse_keyword().

Thanks to Endre Szabo for reporting this issue. Fixes #63.
---
 src/ferm | 2 --
 1 file changed, 2 deletions(-)

diff --git a/src/ferm b/src/ferm
index 47fed83..dc29ef0 100755
--- a/src/ferm
+++ b/src/ferm
@@ -1750,10 +1750,8 @@ sub realize_deferred {
         if (ref $inside_value and ref $inside_value eq 'deferred') {
             my @args = @$inside_value;
             my $function = shift @args;
-
             # realize nested deferred calls recursively
             @args = realize_deferred($domain, @args);
-
             push @values, &$function($domain, @args);
         } else {
             push @values, $inside_value;