diff options
author | Bob Arnson <bob@firegiant.com> | 2022-12-18 20:14:50 -0500 |
---|---|---|
committer | Bob Arnson <github@bobs.org> | 2022-12-18 21:18:49 -0500 |
commit | 5e8f6c5cfc28c8c70ef0339d7e1bb73069642915 (patch) | |
tree | 9184ff3677e15623dc8d3646c9eba61816994246 /src/ext/Firewall/ca | |
parent | 72a95fbbec5022220ee165f3acb4889b65155bc0 (diff) | |
download | wix-5e8f6c5cfc28c8c70ef0339d7e1bb73069642915.tar.gz wix-5e8f6c5cfc28c8c70ef0339d7e1bb73069642915.tar.bz2 wix-5e8f6c5cfc28c8c70ef0339d7e1bb73069642915.zip |
Fix broken firewall direction.
Fixes https://github.com/wixtoolset/issues/issues/7102.
Diffstat (limited to 'src/ext/Firewall/ca')
-rw-r--r-- | src/ext/Firewall/ca/firewall.cpp | 29 |
1 files changed, 16 insertions, 13 deletions
diff --git a/src/ext/Firewall/ca/firewall.cpp b/src/ext/Firewall/ca/firewall.cpp index caae21a1..b45cbcdd 100644 --- a/src/ext/Firewall/ca/firewall.cpp +++ b/src/ext/Firewall/ca/firewall.cpp | |||
@@ -4,7 +4,7 @@ | |||
4 | 4 | ||
5 | LPCWSTR vcsFirewallExceptionQuery = | 5 | LPCWSTR vcsFirewallExceptionQuery = |
6 | L"SELECT `Name`, `RemoteAddresses`, `Port`, `Protocol`, `Program`, `Attributes`, `Profile`, `Component_`, `Description`, `Direction` FROM `Wix4FirewallException`"; | 6 | L"SELECT `Name`, `RemoteAddresses`, `Port`, `Protocol`, `Program`, `Attributes`, `Profile`, `Component_`, `Description`, `Direction` FROM `Wix4FirewallException`"; |
7 | enum eFirewallExceptionQuery { feqName = 1, feqRemoteAddresses, feqPort, feqProtocol, feqProgram, feqAttributes, feqProfile, feqComponent, feqDescription }; | 7 | enum eFirewallExceptionQuery { feqName = 1, feqRemoteAddresses, feqPort, feqProtocol, feqProgram, feqAttributes, feqProfile, feqComponent, feqDescription, feqDirection }; |
8 | enum eFirewallExceptionTarget { fetPort = 1, fetApplication, fetUnknown }; | 8 | enum eFirewallExceptionTarget { fetPort = 1, fetApplication, fetUnknown }; |
9 | enum eFirewallExceptionAttributes { feaIgnoreFailures = 1 }; | 9 | enum eFirewallExceptionAttributes { feaIgnoreFailures = 1 }; |
10 | 10 | ||
@@ -36,11 +36,11 @@ static UINT SchedFirewallExceptions( | |||
36 | LPWSTR pwzComponent = NULL; | 36 | LPWSTR pwzComponent = NULL; |
37 | LPWSTR pwzFormattedFile = NULL; | 37 | LPWSTR pwzFormattedFile = NULL; |
38 | LPWSTR pwzDescription = NULL; | 38 | LPWSTR pwzDescription = NULL; |
39 | int iDirection = 0; | 39 | int iDirection = MSI_NULL_INTEGER; |
40 | 40 | ||
41 | // initialize | 41 | // initialize |
42 | hr = WcaInitialize(hInstall, "SchedFirewallExceptions"); | 42 | hr = WcaInitialize(hInstall, "SchedFirewallExceptions"); |
43 | ExitOnFailure(hr, "failed to initialize"); | 43 | ExitOnFailure(hr, "Failed to initialize"); |
44 | 44 | ||
45 | // anything to do? | 45 | // anything to do? |
46 | if (S_OK != WcaTableExists(L"Wix4FirewallException")) | 46 | if (S_OK != WcaTableExists(L"Wix4FirewallException")) |
@@ -51,36 +51,39 @@ static UINT SchedFirewallExceptions( | |||
51 | 51 | ||
52 | // query and loop through all the firewall exceptions | 52 | // query and loop through all the firewall exceptions |
53 | hr = WcaOpenExecuteView(vcsFirewallExceptionQuery, &hView); | 53 | hr = WcaOpenExecuteView(vcsFirewallExceptionQuery, &hView); |
54 | ExitOnFailure(hr, "failed to open view on Wix4FirewallException table"); | 54 | ExitOnFailure(hr, "Failed to open view on Wix4FirewallException table"); |
55 | 55 | ||
56 | while (S_OK == (hr = WcaFetchRecord(hView, &hRec))) | 56 | while (S_OK == (hr = WcaFetchRecord(hView, &hRec))) |
57 | { | 57 | { |
58 | hr = WcaGetRecordFormattedString(hRec, feqName, &pwzName); | 58 | hr = WcaGetRecordFormattedString(hRec, feqName, &pwzName); |
59 | ExitOnFailure(hr, "failed to get firewall exception name"); | 59 | ExitOnFailure(hr, "Failed to get firewall exception name."); |
60 | 60 | ||
61 | hr = WcaGetRecordFormattedString(hRec, feqRemoteAddresses, &pwzRemoteAddresses); | 61 | hr = WcaGetRecordFormattedString(hRec, feqRemoteAddresses, &pwzRemoteAddresses); |
62 | ExitOnFailure(hr, "failed to get firewall exception remote addresses"); | 62 | ExitOnFailure(hr, "Failed to get firewall exception remote addresses."); |
63 | 63 | ||
64 | hr = WcaGetRecordFormattedString(hRec, feqPort, &pwzPort); | 64 | hr = WcaGetRecordFormattedString(hRec, feqPort, &pwzPort); |
65 | ExitOnFailure(hr, "failed to get firewall exception port"); | 65 | ExitOnFailure(hr, "Failed to get firewall exception port."); |
66 | 66 | ||
67 | hr = WcaGetRecordInteger(hRec, feqProtocol, &iProtocol); | 67 | hr = WcaGetRecordInteger(hRec, feqProtocol, &iProtocol); |
68 | ExitOnFailure(hr, "failed to get firewall exception protocol"); | 68 | ExitOnFailure(hr, "Failed to get firewall exception protocol."); |
69 | 69 | ||
70 | hr = WcaGetRecordFormattedString(hRec, feqProgram, &pwzProgram); | 70 | hr = WcaGetRecordFormattedString(hRec, feqProgram, &pwzProgram); |
71 | ExitOnFailure(hr, "failed to get firewall exception program"); | 71 | ExitOnFailure(hr, "Failed to get firewall exception program."); |
72 | 72 | ||
73 | hr = WcaGetRecordInteger(hRec, feqAttributes, &iAttributes); | 73 | hr = WcaGetRecordInteger(hRec, feqAttributes, &iAttributes); |
74 | ExitOnFailure(hr, "failed to get firewall exception attributes"); | 74 | ExitOnFailure(hr, "Failed to get firewall exception attributes."); |
75 | 75 | ||
76 | hr = WcaGetRecordInteger(hRec, feqProfile, &iProfile); | 76 | hr = WcaGetRecordInteger(hRec, feqProfile, &iProfile); |
77 | ExitOnFailure(hr, "failed to get firewall exception profile"); | 77 | ExitOnFailure(hr, "Failed to get firewall exception profile."); |
78 | 78 | ||
79 | hr = WcaGetRecordString(hRec, feqComponent, &pwzComponent); | 79 | hr = WcaGetRecordString(hRec, feqComponent, &pwzComponent); |
80 | ExitOnFailure(hr, "failed to get firewall exception component"); | 80 | ExitOnFailure(hr, "Failed to get firewall exception component."); |
81 | 81 | ||
82 | hr = WcaGetRecordString(hRec, feqDescription, &pwzDescription); | 82 | hr = WcaGetRecordString(hRec, feqDescription, &pwzDescription); |
83 | ExitOnFailure(hr, "failed to get firewall description"); | 83 | ExitOnFailure(hr, "Failed to get firewall exception description."); |
84 | |||
85 | hr = WcaGetRecordInteger(hRec, feqDirection, &iDirection); | ||
86 | ExitOnFailure(hr, "Failed to get firewall exception direction."); | ||
84 | 87 | ||
85 | // figure out what we're doing for this exception, treating reinstall the same as install | 88 | // figure out what we're doing for this exception, treating reinstall the same as install |
86 | WCA_TODO todoComponent = WcaGetComponentToDo(pwzComponent); | 89 | WCA_TODO todoComponent = WcaGetComponentToDo(pwzComponent); |