This file is indexed.

/usr/share/fwbuilder-5.1.0.3599/migration/FWObjectDatabase_20.xslt is in fwbuilder-common 5.1.0-4.

This file is owned by root:root, with mode 0o644.

The actual contents of the file can be viewed below.

  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
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
<!--
   FWObjectDatabase_20.xslt 2011-05-03
   Author:       Vadim Kurland
   Description:  translates fwbuilder object database from v20 to 21
                 convert actions Tag, Classify and Route to options
                 
-->

<xsl:stylesheet version="1.0"
    xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
    xmlns:fwb="http://www.fwbuilder.org/1.0/"
    exclude-result-prefixes="fwb">


<xsl:output method="xml" version="1.0" 
   doctype-system="fwbuilder.dtd" indent="yes" encoding="utf-8"/>

<xsl:template match="*" mode="copy">
  <xsl:copy>
    <xsl:copy-of select="@*"/>
    <xsl:apply-templates mode="copy"/>
  </xsl:copy>
</xsl:template>

<xsl:template match="//fwb:PolicyRule[attribute::action='Tag']" mode="copy">

  <xsl:variable name="ipt_make_terminating"
    select="../../fwb:FirewallOptions/fwb:Option[attribute::name='classify_mark_terminating']"/>

  <xsl:variable name="pf_make_terminating"
    select="fwb:PolicyRuleOptions/fwb:Option[attribute::name='pf_tag_terminating']"/>

  <xsl:element name="PolicyRule" namespace="http://www.fwbuilder.org/1.0/">
    <xsl:copy-of select="@id"/>
    <xsl:copy-of select="@disabled"/>
    <xsl:copy-of select="@position"/>
    <xsl:copy-of select="@direction"/>
    
    <xsl:choose>
      <xsl:when test="$ipt_make_terminating = 'True'">
        <xsl:attribute name="action">Accept</xsl:attribute>
      </xsl:when>
      <xsl:when test="$pf_make_terminating = 'True'">
        <xsl:attribute name="action">Accept</xsl:attribute>
      </xsl:when>
      <xsl:otherwise>
        <xsl:attribute name="action">Continue</xsl:attribute>
      </xsl:otherwise>
    </xsl:choose>

    <xsl:copy-of select="@log"/>
    <xsl:copy-of select="@comment"/>
    <xsl:copy-of select="@group"/>

    <xsl:text>
          </xsl:text>
    <xsl:apply-templates select="fwb:Src" mode="copy"/>
    <xsl:text>
          </xsl:text>
    <xsl:apply-templates select="fwb:Dst" mode="copy"/>
    <xsl:text>
          </xsl:text>
    <xsl:apply-templates select="fwb:Srv" mode="copy"/>
    <xsl:text>
          </xsl:text>
    <xsl:apply-templates select="fwb:Itf" mode="copy"/>
    <xsl:text>
          </xsl:text>
    <xsl:apply-templates select="fwb:When" mode="copy"/>
    <xsl:text>
          </xsl:text>

    <xsl:element name="PolicyRuleOptions" namespace="http://www.fwbuilder.org/1.0/">
      <xsl:text>
            </xsl:text>
      <xsl:for-each select="fwb:PolicyRuleOptions/fwb:Option">
        <xsl:copy-of select="."/>
        <xsl:text>
            </xsl:text>
      </xsl:for-each>

      <xsl:element name="Option" namespace="http://www.fwbuilder.org/1.0/">
        <xsl:attribute name="name">tagging</xsl:attribute>True</xsl:element>
      <xsl:text>
            </xsl:text>
      <xsl:element name="Option" namespace="http://www.fwbuilder.org/1.0/">
        <xsl:attribute name="name">classification</xsl:attribute>False</xsl:element>
      <xsl:text>
            </xsl:text>
      <xsl:element name="Option" namespace="http://www.fwbuilder.org/1.0/">
        <xsl:attribute name="name">routing</xsl:attribute>False</xsl:element>
      <xsl:text>
          </xsl:text>
    </xsl:element>
    <xsl:text>
        </xsl:text>
  </xsl:element>
</xsl:template>


<xsl:template match="//fwb:PolicyRule[attribute::action='Classify']" mode="copy">

  <xsl:variable name="platform" select="../../@platform"/>

  <xsl:variable name="ipt_make_terminating"
    select="../../fwb:FirewallOptions/fwb:Option[attribute::name='classify_mark_terminating']"/>

  <!--
    Option "pf_class_terminating" can be blank, "True" or
    "False". Blank (the option is missing entirely) or "True" means
    the rule must be terminating. "False" means the opposite.
  -->

  <xsl:variable name="pf_make_terminating">
    <xsl:choose>
      <xsl:when test="fwb:PolicyRuleOptions/fwb:Option[attribute::name='pf_classify_terminating']">
        <xsl:value-of 
            select="fwb:PolicyRuleOptions/fwb:Option[attribute::name='pf_classify_terminating']"/>
      </xsl:when>
      <xsl:otherwise>True</xsl:otherwise>
    </xsl:choose>
  </xsl:variable>


  <xsl:element name="PolicyRule" namespace="http://www.fwbuilder.org/1.0/">

    <xsl:copy-of select="@id"/>
    <xsl:copy-of select="@disabled"/>
    <xsl:copy-of select="@position"/>
    <xsl:copy-of select="@direction"/>
    
    <xsl:choose>
      <xsl:when test="($ipt_make_terminating = 'True') and ($platform = 'iptables')">
        <xsl:attribute name="action">Accept</xsl:attribute>
      </xsl:when>
      <xsl:when test="($pf_make_terminating = 'True') and ($platform = 'pf')">
        <xsl:attribute name="action">Accept</xsl:attribute>
      </xsl:when>
      <xsl:when test="$platform = 'ipfw'">
        <xsl:attribute name="action">Accept</xsl:attribute>
      </xsl:when>
      <xsl:otherwise>
        <xsl:attribute name="action">Continue</xsl:attribute>
      </xsl:otherwise>
    </xsl:choose>

    <xsl:copy-of select="@log"/>
    <xsl:copy-of select="@comment"/>
    <xsl:copy-of select="@group"/>

    <xsl:text>
          </xsl:text>
    <xsl:apply-templates select="fwb:Src" mode="copy"/>
    <xsl:text>
          </xsl:text>
    <xsl:apply-templates select="fwb:Dst" mode="copy"/>
    <xsl:text>
          </xsl:text>
    <xsl:apply-templates select="fwb:Srv" mode="copy"/>
    <xsl:text>
          </xsl:text>
    <xsl:apply-templates select="fwb:Itf" mode="copy"/>
    <xsl:text>
          </xsl:text>
    <xsl:apply-templates select="fwb:When" mode="copy"/>
    <xsl:text>
          </xsl:text>

    <xsl:element name="PolicyRuleOptions" namespace="http://www.fwbuilder.org/1.0/">
      <xsl:text>
            </xsl:text>
      <xsl:for-each select="fwb:PolicyRuleOptions/fwb:Option">
        <xsl:copy-of select="."/>
        <xsl:text>
            </xsl:text>
      </xsl:for-each>

      <xsl:element name="Option" namespace="http://www.fwbuilder.org/1.0/">
        <xsl:attribute name="name">tagging</xsl:attribute>False</xsl:element>
      <xsl:text>
            </xsl:text>
      <xsl:element name="Option" namespace="http://www.fwbuilder.org/1.0/">
        <xsl:attribute name="name">classification</xsl:attribute>True</xsl:element>
      <xsl:text>
            </xsl:text>
      <xsl:element name="Option" namespace="http://www.fwbuilder.org/1.0/">
        <xsl:attribute name="name">routing</xsl:attribute>False</xsl:element>
      <xsl:text>
          </xsl:text>

    </xsl:element>
    <xsl:text>
        </xsl:text>
  </xsl:element>
</xsl:template>





<xsl:template match="//fwb:PolicyRule[attribute::action='Route']" mode="copy">

  <xsl:variable name="platform" select="../../@platform"/>

  <!-- Fwbuilder action Route for iptables was terminating by default
       but non-terminating if option "ipt_continue" was present and
       had value True
  -->

  <xsl:variable name="ipt_non_terminating"
    select="fwb:PolicyRuleOptions/fwb:Option[attribute::name='ipt_continue']"/>

  <!-- Fwbuilder action Route was always terminating for PF -->

  <xsl:element name="PolicyRule" namespace="http://www.fwbuilder.org/1.0/">
    <xsl:copy-of select="@id"/>
    <xsl:copy-of select="@disabled"/>
    <xsl:copy-of select="@position"/>
    <xsl:copy-of select="@direction"/>

    <xsl:choose>
      <xsl:when test="($platform = 'iptables') and ($ipt_non_terminating = 'True')">
        <xsl:attribute name="action">Continue</xsl:attribute>
      </xsl:when>
      <xsl:otherwise>
        <xsl:attribute name="action">Accept</xsl:attribute>
      </xsl:otherwise>
    </xsl:choose>

    <xsl:copy-of select="@log"/>
    <xsl:copy-of select="@comment"/>
    <xsl:copy-of select="@group"/>

    <xsl:text>
          </xsl:text>
    <xsl:apply-templates select="fwb:Src" mode="copy"/>
    <xsl:text>
          </xsl:text>
    <xsl:apply-templates select="fwb:Dst" mode="copy"/>
    <xsl:text>
          </xsl:text>
    <xsl:apply-templates select="fwb:Srv" mode="copy"/>
    <xsl:text>
          </xsl:text>
    <xsl:apply-templates select="fwb:Itf" mode="copy"/>
    <xsl:text>
          </xsl:text>
    <xsl:apply-templates select="fwb:When" mode="copy"/>
    <xsl:text>
          </xsl:text>

    <xsl:element name="PolicyRuleOptions" namespace="http://www.fwbuilder.org/1.0/">
      <xsl:text>
            </xsl:text>
      <xsl:for-each select="fwb:PolicyRuleOptions/fwb:Option">
        <xsl:copy-of select="."/>
        <xsl:text>
            </xsl:text>
      </xsl:for-each>

      <xsl:element name="Option" namespace="http://www.fwbuilder.org/1.0/">
        <xsl:attribute name="name">tagging</xsl:attribute>False</xsl:element>
      <xsl:text>
            </xsl:text>
      <xsl:element name="Option" namespace="http://www.fwbuilder.org/1.0/">
        <xsl:attribute name="name">classification</xsl:attribute>False</xsl:element>
      <xsl:text>
            </xsl:text>
      <xsl:element name="Option" namespace="http://www.fwbuilder.org/1.0/">
        <xsl:attribute name="name">routing</xsl:attribute>True</xsl:element>
      <xsl:text>
          </xsl:text>
    </xsl:element>
    <xsl:text>
        </xsl:text>
  </xsl:element>
</xsl:template>



<xsl:template match="*[attribute::id='root']">
  <FWObjectDatabase xmlns="http://www.fwbuilder.org/1.0/">
    <xsl:attribute name="version">21</xsl:attribute>
    <xsl:attribute name="lastModified"><xsl:value-of select="@lastModified"/></xsl:attribute>
    <xsl:attribute name="id">root</xsl:attribute>
    <xsl:apply-templates select="*" mode="copy"/>
  </FWObjectDatabase>
</xsl:template>

</xsl:stylesheet>