Skip to content

Commit

Permalink
Use the correct case for firewall attribute values
Browse files Browse the repository at this point in the history
  • Loading branch information
robmen committed Mar 25, 2024
1 parent fd60bba commit 8db3616
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@
</File>

<fw:FirewallException Description="A port-based firewall exception" Name="ExamplePort" Port="42" Outbound="yes" Scope="localSubnet" OnUpdate="enableOnly" />
<fw:FirewallException Description="DNS scope firewall exception" Name="ExampleDNSScope" Port="356" Protocol="udp" Scope="DNS" />
<fw:FirewallException Description="DHCP scope firewall exception" Name="ExampleDHCPScope" Program="test.exe" Protocol="211" Scope="DHCP" Profile="public" />
<fw:FirewallException Description="WINS scope firewall exception" Name="ExampleWINSScope" Port="6573" Scope="WINS" Profile="domain"/>
<fw:FirewallException Description="DNS scope firewall exception" Name="ExampleDNSScope" Port="356" Protocol="udp" Scope="dns" />
<fw:FirewallException Description="DHCP scope firewall exception" Name="ExampleDHCPScope" Program="test.exe" Protocol="211" Scope="dhcp" Profile="public" />
<fw:FirewallException Description="WINS scope firewall exception" Name="ExampleWINSScope" Port="6573" Scope="wins" Profile="domain"/>
<fw:FirewallException Description="defaultGateway scope firewall exception" Name="ExampleDefaultGatewayScope" Port="4432" Scope="defaultGateway" Profile="private" />

<fw:FirewallException Description="Defer to user edge traversal" Name="defertouser" Program="fw.exe" EdgeTraversal="deferToUser" />
Expand Down
10 changes: 8 additions & 2 deletions src/ext/Firewall/wixext/FirewallCompiler.cs
Original file line number Diff line number Diff line change
Expand Up @@ -227,12 +227,15 @@ private void ParseFirewallExceptionElement(Intermediate intermediate, Intermedia
remoteAddresses = "LocalSubnet";
break;
case "DNS":
case "dns":
remoteAddresses = "dns";
break;
case "DHCP":
case "dhcp":
remoteAddresses = "dhcp";
break;
case "WINS":
case "wins":
remoteAddresses = "wins";
break;
case "defaultGateway":
Expand All @@ -242,7 +245,7 @@ private void ParseFirewallExceptionElement(Intermediate intermediate, Intermedia
remoteAddresses = scope;
if (!this.ParseHelper.ContainsProperty(scope))
{
this.Messaging.Write(ErrorMessages.IllegalAttributeValue(sourceLineNumbers, element.Name.LocalName, "Scope", scope, "any", "localSubnet", "DNS", "DHCP", "WINS", "defaultGateway"));
this.Messaging.Write(ErrorMessages.IllegalAttributeValue(sourceLineNumbers, element.Name.LocalName, "Scope", scope, "any", "localSubnet", "dns", "dhcp", "wins", "defaultGateway"));
}
break;
}
Expand Down Expand Up @@ -384,12 +387,15 @@ private void ParseFirewallExceptionElement(Intermediate intermediate, Intermedia
localAddresses = "LocalSubnet";
break;
case "DNS":
case "dns":
localAddresses = "dns";
break;
case "DHCP":
case "dhcp":
localAddresses = "dhcp";
break;
case "WINS":
case "wins":
localAddresses = "wins";
break;
case "defaultGateway":
Expand All @@ -399,7 +405,7 @@ private void ParseFirewallExceptionElement(Intermediate intermediate, Intermedia
default:
if (!this.ParseHelper.ContainsProperty(localScope))
{
this.Messaging.Write(ErrorMessages.IllegalAttributeValue(sourceLineNumbers, element.Name.LocalName, "LocalScope", localScope, "any", "localSubnet", "DNS", "DHCP", "WINS", "defaultGateway"));
this.Messaging.Write(ErrorMessages.IllegalAttributeValue(sourceLineNumbers, element.Name.LocalName, "LocalScope", localScope, "any", "localSubnet", "dns", "dhcp", "wins", "defaultGateway"));
}
else
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,13 @@
Name="WiXToolset401 Test - 0013" Scope="localSubnet" Port="1300" />
<fw:FirewallException Id="FirewallException14"
Description="WiX Toolset firewall exception rule integration test - scope DNS"
Name="WiXToolset401 Test - 0014" Scope="DNS" Port="1400" />
Name="WiXToolset401 Test - 0014" Scope="dns" Port="1400" />
<fw:FirewallException Id="FirewallException15"
Description="WiX Toolset firewall exception rule integration test - scope DHCP"
Name="WiXToolset401 Test - 0015" Scope="DHCP" Port="1500" />
Name="WiXToolset401 Test - 0015" Scope="dhcp" Port="1500" />
<fw:FirewallException Id="FirewallException16"
Description="WiX Toolset firewall exception rule integration test - scope WINS"
Name="WiXToolset401 Test - 0016" Scope="WINS" Port="1600" />
Name="WiXToolset401 Test - 0016" Scope="wins" Port="1600" />
<fw:FirewallException Id="FirewallException17"
Description="WiX Toolset firewall exception rule integration test - scope default gateway"
Name="WiXToolset401 Test - 0017" Scope="defaultGateway" Port="1700" />
Expand Down

0 comments on commit 8db3616

Please sign in to comment.