blob: 240c85d78459021d8acaa585943a27d7c0bee453 [file] [log] [blame]
Lorenzo Colitti89faa342016-02-26 11:38:47 +09001/*
2 * Copyright 2016 The Android Open Source Project
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 *
16 * FirewallControllerTest.cpp - unit tests for FirewallController.cpp
17 */
18
19#include <string>
20#include <vector>
21#include <stdio.h>
22
23#include <gtest/gtest.h>
24
Hugo Benichi528d3d02018-06-20 13:35:58 +090025#include <android-base/file.h>
Lorenzo Colitti6324b182017-07-17 21:48:14 +090026#include <android-base/stringprintf.h>
Hugo Benichi528d3d02018-06-20 13:35:58 +090027#include <android-base/strings.h>
Lorenzo Colittia55388e2016-05-13 17:03:42 +090028
Lorenzo Colitti89faa342016-02-26 11:38:47 +090029#include "FirewallController.h"
Lorenzo Colitti932c44c2016-04-24 16:58:02 +090030#include "IptablesBaseTest.h"
Lorenzo Colitti89faa342016-02-26 11:38:47 +090031
Lorenzo Colittid351bea2017-07-16 22:52:30 +090032using android::base::Join;
Lorenzo Colitti6324b182017-07-17 21:48:14 +090033using android::base::StringPrintf;
Hugo Benichi528d3d02018-06-20 13:35:58 +090034using android::base::WriteStringToFile;
Lorenzo Colitti89faa342016-02-26 11:38:47 +090035
Lorenzo Colitti932c44c2016-04-24 16:58:02 +090036class FirewallControllerTest : public IptablesBaseTest {
Lorenzo Colitti89faa342016-02-26 11:38:47 +090037protected:
Lorenzo Colitti932c44c2016-04-24 16:58:02 +090038 FirewallControllerTest() {
Lorenzo Colitti932c44c2016-04-24 16:58:02 +090039 FirewallController::execIptablesRestore = fakeExecIptablesRestore;
Chenbo Feng89c12f12018-03-21 10:29:18 -070040 mFw.mUseBpfOwnerMatch = false;
Lorenzo Colitti932c44c2016-04-24 16:58:02 +090041 }
Lorenzo Colitti89faa342016-02-26 11:38:47 +090042 FirewallController mFw;
Lorenzo Colitti932c44c2016-04-24 16:58:02 +090043
Lorenzo Colittif157caf2016-05-13 11:25:54 +090044 std::string makeUidRules(IptablesTarget a, const char* b, bool c,
45 const std::vector<int32_t>& d) {
46 return mFw.makeUidRules(a, b, c, d);
Lorenzo Colitti89faa342016-02-26 11:38:47 +090047 }
Lorenzo Colitti932c44c2016-04-24 16:58:02 +090048
Lorenzo Colitti03b23fe2017-02-03 18:46:53 +090049 int createChain(const char* a, FirewallType b) {
50 return mFw.createChain(a, b);
Lorenzo Colitti932c44c2016-04-24 16:58:02 +090051 }
Lorenzo Colitti89faa342016-02-26 11:38:47 +090052};
53
54
Lorenzo Colitti932c44c2016-04-24 16:58:02 +090055TEST_F(FirewallControllerTest, TestCreateWhitelistChain) {
Lorenzo Colittia55388e2016-05-13 17:03:42 +090056 std::vector<std::string> expectedRestore4 = {
57 "*filter",
58 ":fw_whitelist -",
Lorenzo Colitti8bcb1f42017-04-25 00:17:48 +090059 "-A fw_whitelist -m owner --uid-owner 0-9999 -j RETURN",
Benedict Wongb2daefb2017-12-06 22:05:46 -080060 "-A fw_whitelist -m owner ! --uid-owner 0-4294967294 -j RETURN",
61 "-A fw_whitelist -p esp -j RETURN",
Lorenzo Colitti50b198a2017-03-30 02:50:09 +090062 "-A fw_whitelist -i lo -j RETURN",
63 "-A fw_whitelist -o lo -j RETURN",
Lorenzo Colittia55388e2016-05-13 17:03:42 +090064 "-A fw_whitelist -p tcp --tcp-flags RST RST -j RETURN",
Lorenzo Colittia55388e2016-05-13 17:03:42 +090065 "-A fw_whitelist -j DROP",
Lorenzo Colitti03b23fe2017-02-03 18:46:53 +090066 "COMMIT\n"
Lorenzo Colittia55388e2016-05-13 17:03:42 +090067 };
68 std::vector<std::string> expectedRestore6 = {
69 "*filter",
70 ":fw_whitelist -",
Lorenzo Colitti8bcb1f42017-04-25 00:17:48 +090071 "-A fw_whitelist -m owner --uid-owner 0-9999 -j RETURN",
Benedict Wongb2daefb2017-12-06 22:05:46 -080072 "-A fw_whitelist -m owner ! --uid-owner 0-4294967294 -j RETURN",
73 "-A fw_whitelist -p esp -j RETURN",
Lorenzo Colitti50b198a2017-03-30 02:50:09 +090074 "-A fw_whitelist -i lo -j RETURN",
75 "-A fw_whitelist -o lo -j RETURN",
Lorenzo Colittia55388e2016-05-13 17:03:42 +090076 "-A fw_whitelist -p tcp --tcp-flags RST RST -j RETURN",
77 "-A fw_whitelist -p icmpv6 --icmpv6-type packet-too-big -j RETURN",
78 "-A fw_whitelist -p icmpv6 --icmpv6-type router-solicitation -j RETURN",
79 "-A fw_whitelist -p icmpv6 --icmpv6-type router-advertisement -j RETURN",
80 "-A fw_whitelist -p icmpv6 --icmpv6-type neighbour-solicitation -j RETURN",
81 "-A fw_whitelist -p icmpv6 --icmpv6-type neighbour-advertisement -j RETURN",
82 "-A fw_whitelist -p icmpv6 --icmpv6-type redirect -j RETURN",
Lorenzo Colittia55388e2016-05-13 17:03:42 +090083 "-A fw_whitelist -j DROP",
Lorenzo Colitti03b23fe2017-02-03 18:46:53 +090084 "COMMIT\n"
Lorenzo Colittia55388e2016-05-13 17:03:42 +090085 };
86 std::vector<std::pair<IptablesTarget, std::string>> expectedRestoreCommands = {
87 { V4, android::base::Join(expectedRestore4, '\n') },
88 { V6, android::base::Join(expectedRestore6, '\n') },
89 };
90
Lorenzo Colitti03b23fe2017-02-03 18:46:53 +090091 createChain("fw_whitelist", WHITELIST);
Lorenzo Colittia55388e2016-05-13 17:03:42 +090092 expectIptablesRestoreCommands(expectedRestoreCommands);
Lorenzo Colitti932c44c2016-04-24 16:58:02 +090093}
94
95TEST_F(FirewallControllerTest, TestCreateBlacklistChain) {
Lorenzo Colittia55388e2016-05-13 17:03:42 +090096 std::vector<std::string> expectedRestore = {
97 "*filter",
98 ":fw_blacklist -",
Lorenzo Colitti50b198a2017-03-30 02:50:09 +090099 "-A fw_blacklist -i lo -j RETURN",
100 "-A fw_blacklist -o lo -j RETURN",
Lorenzo Colittia55388e2016-05-13 17:03:42 +0900101 "-A fw_blacklist -p tcp --tcp-flags RST RST -j RETURN",
Lorenzo Colitti03b23fe2017-02-03 18:46:53 +0900102 "COMMIT\n"
Lorenzo Colittia55388e2016-05-13 17:03:42 +0900103 };
104 std::vector<std::pair<IptablesTarget, std::string>> expectedRestoreCommands = {
105 { V4, android::base::Join(expectedRestore, '\n') },
106 { V6, android::base::Join(expectedRestore, '\n') },
107 };
108
Lorenzo Colitti03b23fe2017-02-03 18:46:53 +0900109 createChain("fw_blacklist", BLACKLIST);
Lorenzo Colittia55388e2016-05-13 17:03:42 +0900110 expectIptablesRestoreCommands(expectedRestoreCommands);
Lorenzo Colitti932c44c2016-04-24 16:58:02 +0900111}
112
113TEST_F(FirewallControllerTest, TestSetStandbyRule) {
114 ExpectedIptablesCommands expected = {
Lorenzo Colittia7357652017-04-25 00:16:36 +0900115 { V4V6, "*filter\n-D fw_standby -m owner --uid-owner 12345 -j DROP\nCOMMIT\n" }
Lorenzo Colitti932c44c2016-04-24 16:58:02 +0900116 };
117 mFw.setUidRule(STANDBY, 12345, ALLOW);
Lorenzo Colittia7357652017-04-25 00:16:36 +0900118 expectIptablesRestoreCommands(expected);
Lorenzo Colitti932c44c2016-04-24 16:58:02 +0900119
120 expected = {
Lorenzo Colittia7357652017-04-25 00:16:36 +0900121 { V4V6, "*filter\n-A fw_standby -m owner --uid-owner 12345 -j DROP\nCOMMIT\n" }
Lorenzo Colitti932c44c2016-04-24 16:58:02 +0900122 };
123 mFw.setUidRule(STANDBY, 12345, DENY);
Lorenzo Colittia7357652017-04-25 00:16:36 +0900124 expectIptablesRestoreCommands(expected);
Lorenzo Colitti932c44c2016-04-24 16:58:02 +0900125}
126
127TEST_F(FirewallControllerTest, TestSetDozeRule) {
128 ExpectedIptablesCommands expected = {
Lorenzo Colittia7357652017-04-25 00:16:36 +0900129 { V4V6, "*filter\n-I fw_dozable -m owner --uid-owner 54321 -j RETURN\nCOMMIT\n" }
Lorenzo Colitti932c44c2016-04-24 16:58:02 +0900130 };
131 mFw.setUidRule(DOZABLE, 54321, ALLOW);
Lorenzo Colittia7357652017-04-25 00:16:36 +0900132 expectIptablesRestoreCommands(expected);
Lorenzo Colitti932c44c2016-04-24 16:58:02 +0900133
134 expected = {
Lorenzo Colittia7357652017-04-25 00:16:36 +0900135 { V4V6, "*filter\n-D fw_dozable -m owner --uid-owner 54321 -j RETURN\nCOMMIT\n" }
Lorenzo Colitti932c44c2016-04-24 16:58:02 +0900136 };
137 mFw.setUidRule(DOZABLE, 54321, DENY);
Lorenzo Colittia7357652017-04-25 00:16:36 +0900138 expectIptablesRestoreCommands(expected);
139}
140
141TEST_F(FirewallControllerTest, TestSetFirewallRule) {
142 ExpectedIptablesCommands expected = {
143 { V4V6, "*filter\n"
144 "-A fw_INPUT -m owner --uid-owner 54321 -j DROP\n"
145 "-A fw_OUTPUT -m owner --uid-owner 54321 -j DROP\n"
146 "COMMIT\n" }
147 };
148 mFw.setUidRule(NONE, 54321, DENY);
149 expectIptablesRestoreCommands(expected);
150
151 expected = {
152 { V4V6, "*filter\n"
153 "-D fw_INPUT -m owner --uid-owner 54321 -j DROP\n"
154 "-D fw_OUTPUT -m owner --uid-owner 54321 -j DROP\n"
155 "COMMIT\n" }
156 };
157 mFw.setUidRule(NONE, 54321, ALLOW);
158 expectIptablesRestoreCommands(expected);
Lorenzo Colitti932c44c2016-04-24 16:58:02 +0900159}
160
161TEST_F(FirewallControllerTest, TestReplaceWhitelistUidRule) {
Lorenzo Colitti89faa342016-02-26 11:38:47 +0900162 std::string expected =
163 "*filter\n"
164 ":FW_whitechain -\n"
Lorenzo Colitti8bcb1f42017-04-25 00:17:48 +0900165 "-A FW_whitechain -m owner --uid-owner 10023 -j RETURN\n"
166 "-A FW_whitechain -m owner --uid-owner 10059 -j RETURN\n"
167 "-A FW_whitechain -m owner --uid-owner 10124 -j RETURN\n"
168 "-A FW_whitechain -m owner --uid-owner 10111 -j RETURN\n"
169 "-A FW_whitechain -m owner --uid-owner 110122 -j RETURN\n"
170 "-A FW_whitechain -m owner --uid-owner 210153 -j RETURN\n"
171 "-A FW_whitechain -m owner --uid-owner 210024 -j RETURN\n"
172 "-A FW_whitechain -m owner --uid-owner 0-9999 -j RETURN\n"
Benedict Wongb2daefb2017-12-06 22:05:46 -0800173 "-A FW_whitechain -m owner ! --uid-owner 0-4294967294 -j RETURN\n"
174 "-A FW_whitechain -p esp -j RETURN\n"
Lorenzo Colitti50b198a2017-03-30 02:50:09 +0900175 "-A FW_whitechain -i lo -j RETURN\n"
176 "-A FW_whitechain -o lo -j RETURN\n"
Lorenzo Colittif157caf2016-05-13 11:25:54 +0900177 "-A FW_whitechain -p tcp --tcp-flags RST RST -j RETURN\n"
178 "-A FW_whitechain -p icmpv6 --icmpv6-type packet-too-big -j RETURN\n"
179 "-A FW_whitechain -p icmpv6 --icmpv6-type router-solicitation -j RETURN\n"
180 "-A FW_whitechain -p icmpv6 --icmpv6-type router-advertisement -j RETURN\n"
181 "-A FW_whitechain -p icmpv6 --icmpv6-type neighbour-solicitation -j RETURN\n"
182 "-A FW_whitechain -p icmpv6 --icmpv6-type neighbour-advertisement -j RETURN\n"
183 "-A FW_whitechain -p icmpv6 --icmpv6-type redirect -j RETURN\n"
Lorenzo Colitti89faa342016-02-26 11:38:47 +0900184 "-A FW_whitechain -j DROP\n"
Lorenzo Colitti03b23fe2017-02-03 18:46:53 +0900185 "COMMIT\n";
Lorenzo Colitti89faa342016-02-26 11:38:47 +0900186
187 std::vector<int32_t> uids = { 10023, 10059, 10124, 10111, 110122, 210153, 210024 };
Lorenzo Colittif157caf2016-05-13 11:25:54 +0900188 EXPECT_EQ(expected, makeUidRules(V6, "FW_whitechain", true, uids));
Lorenzo Colitti89faa342016-02-26 11:38:47 +0900189}
190
Lorenzo Colitti932c44c2016-04-24 16:58:02 +0900191TEST_F(FirewallControllerTest, TestReplaceBlacklistUidRule) {
Lorenzo Colitti89faa342016-02-26 11:38:47 +0900192 std::string expected =
193 "*filter\n"
194 ":FW_blackchain -\n"
Lorenzo Colitti50b198a2017-03-30 02:50:09 +0900195 "-A FW_blackchain -i lo -j RETURN\n"
196 "-A FW_blackchain -o lo -j RETURN\n"
Lorenzo Colittif157caf2016-05-13 11:25:54 +0900197 "-A FW_blackchain -p tcp --tcp-flags RST RST -j RETURN\n"
Lorenzo Colitti89faa342016-02-26 11:38:47 +0900198 "-A FW_blackchain -m owner --uid-owner 10023 -j DROP\n"
199 "-A FW_blackchain -m owner --uid-owner 10059 -j DROP\n"
200 "-A FW_blackchain -m owner --uid-owner 10124 -j DROP\n"
Lorenzo Colitti03b23fe2017-02-03 18:46:53 +0900201 "COMMIT\n";
Lorenzo Colitti89faa342016-02-26 11:38:47 +0900202
203 std::vector<int32_t> uids = { 10023, 10059, 10124 };
Lorenzo Colittif157caf2016-05-13 11:25:54 +0900204 EXPECT_EQ(expected, makeUidRules(V4 ,"FW_blackchain", false, uids));
Lorenzo Colitti89faa342016-02-26 11:38:47 +0900205}
Lorenzo Colittidd9a54b2017-04-26 16:13:22 +0900206
207TEST_F(FirewallControllerTest, TestEnableChildChains) {
208 std::vector<std::string> expected = {
Lorenzo Colittia1611962017-04-26 16:30:39 +0900209 "*filter\n"
210 "-A fw_INPUT -j fw_dozable\n"
211 "-A fw_OUTPUT -j fw_dozable\n"
212 "COMMIT\n"
Lorenzo Colittidd9a54b2017-04-26 16:13:22 +0900213 };
214 EXPECT_EQ(0, mFw.enableChildChains(DOZABLE, true));
Lorenzo Colittia1611962017-04-26 16:30:39 +0900215 expectIptablesRestoreCommands(expected);
Lorenzo Colittidd9a54b2017-04-26 16:13:22 +0900216
217 expected = {
Lorenzo Colittia1611962017-04-26 16:30:39 +0900218 "*filter\n"
219 "-D fw_INPUT -j fw_powersave\n"
220 "-D fw_OUTPUT -j fw_powersave\n"
221 "COMMIT\n"
Lorenzo Colittidd9a54b2017-04-26 16:13:22 +0900222 };
223 EXPECT_EQ(0, mFw.enableChildChains(POWERSAVE, false));
Lorenzo Colittia1611962017-04-26 16:30:39 +0900224 expectIptablesRestoreCommands(expected);
Lorenzo Colittidd9a54b2017-04-26 16:13:22 +0900225}
Lorenzo Colitticc1bb822017-07-16 21:08:54 +0900226
Lorenzo Colitti6324b182017-07-17 21:48:14 +0900227TEST_F(FirewallControllerTest, TestFirewall) {
Lorenzo Colitticc1bb822017-07-16 21:08:54 +0900228 std::vector<std::string> enableCommands = {
Lorenzo Colittid351bea2017-07-16 22:52:30 +0900229 "*filter\n"
230 "-A fw_INPUT -j DROP\n"
231 "-A fw_OUTPUT -j REJECT\n"
232 "-A fw_FORWARD -j REJECT\n"
233 "COMMIT\n"
Lorenzo Colitticc1bb822017-07-16 21:08:54 +0900234 };
235 std::vector<std::string> disableCommands = {
Lorenzo Colittid351bea2017-07-16 22:52:30 +0900236 "*filter\n"
237 ":fw_INPUT -\n"
238 ":fw_OUTPUT -\n"
239 ":fw_FORWARD -\n"
240 "COMMIT\n"
Lorenzo Colitticc1bb822017-07-16 21:08:54 +0900241 };
242 std::vector<std::string> noCommands = {};
243
244 EXPECT_EQ(0, mFw.disableFirewall());
Lorenzo Colittid351bea2017-07-16 22:52:30 +0900245 expectIptablesRestoreCommands(disableCommands);
Lorenzo Colitticc1bb822017-07-16 21:08:54 +0900246
247 EXPECT_EQ(0, mFw.disableFirewall());
Lorenzo Colittid351bea2017-07-16 22:52:30 +0900248 expectIptablesRestoreCommands(disableCommands);
Lorenzo Colitticc1bb822017-07-16 21:08:54 +0900249
250 EXPECT_EQ(0, mFw.enableFirewall(BLACKLIST));
Lorenzo Colittid351bea2017-07-16 22:52:30 +0900251 expectIptablesRestoreCommands(disableCommands);
Lorenzo Colitticc1bb822017-07-16 21:08:54 +0900252
253 EXPECT_EQ(0, mFw.enableFirewall(BLACKLIST));
Lorenzo Colittid351bea2017-07-16 22:52:30 +0900254 expectIptablesRestoreCommands(noCommands);
Lorenzo Colitticc1bb822017-07-16 21:08:54 +0900255
256 std::vector<std::string> disableEnableCommands;
257 disableEnableCommands.insert(
258 disableEnableCommands.end(), disableCommands.begin(), disableCommands.end());
259 disableEnableCommands.insert(
260 disableEnableCommands.end(), enableCommands.begin(), enableCommands.end());
261
262 EXPECT_EQ(0, mFw.enableFirewall(WHITELIST));
Lorenzo Colittid351bea2017-07-16 22:52:30 +0900263 expectIptablesRestoreCommands(disableEnableCommands);
Lorenzo Colitticc1bb822017-07-16 21:08:54 +0900264
Lorenzo Colitti6324b182017-07-17 21:48:14 +0900265 std::vector<std::string> ifaceCommands = {
Lorenzo Colitti1411d452017-07-17 22:12:15 +0900266 "*filter\n"
267 "-I fw_INPUT -i rmnet_data0 -j RETURN\n"
268 "-I fw_OUTPUT -o rmnet_data0 -j RETURN\n"
269 "COMMIT\n"
Lorenzo Colitti6324b182017-07-17 21:48:14 +0900270 };
271 EXPECT_EQ(0, mFw.setInterfaceRule("rmnet_data0", ALLOW));
Lorenzo Colitti1411d452017-07-17 22:12:15 +0900272 expectIptablesRestoreCommands(ifaceCommands);
273
274 EXPECT_EQ(0, mFw.setInterfaceRule("rmnet_data0", ALLOW));
275 expectIptablesRestoreCommands(noCommands);
Lorenzo Colitti6324b182017-07-17 21:48:14 +0900276
277 ifaceCommands = {
Lorenzo Colitti1411d452017-07-17 22:12:15 +0900278 "*filter\n"
279 "-D fw_INPUT -i rmnet_data0 -j RETURN\n"
280 "-D fw_OUTPUT -o rmnet_data0 -j RETURN\n"
281 "COMMIT\n"
Lorenzo Colitti6324b182017-07-17 21:48:14 +0900282 };
283 EXPECT_EQ(0, mFw.setInterfaceRule("rmnet_data0", DENY));
Lorenzo Colitti1411d452017-07-17 22:12:15 +0900284 expectIptablesRestoreCommands(ifaceCommands);
285
286 EXPECT_EQ(0, mFw.setInterfaceRule("rmnet_data0", DENY));
287 expectIptablesRestoreCommands(noCommands);
Lorenzo Colitti6324b182017-07-17 21:48:14 +0900288
Lorenzo Colitticc1bb822017-07-16 21:08:54 +0900289 EXPECT_EQ(0, mFw.enableFirewall(WHITELIST));
Lorenzo Colittid351bea2017-07-16 22:52:30 +0900290 expectIptablesRestoreCommands(noCommands);
Lorenzo Colitticc1bb822017-07-16 21:08:54 +0900291
292 EXPECT_EQ(0, mFw.disableFirewall());
Lorenzo Colittid351bea2017-07-16 22:52:30 +0900293 expectIptablesRestoreCommands(disableCommands);
Lorenzo Colitticc1bb822017-07-16 21:08:54 +0900294
295 // TODO: calling disableFirewall and then enableFirewall(WHITELIST) does
296 // nothing. This seems like a clear bug.
297 EXPECT_EQ(0, mFw.enableFirewall(WHITELIST));
Lorenzo Colittid351bea2017-07-16 22:52:30 +0900298 expectIptablesRestoreCommands(noCommands);
Lorenzo Colitticc1bb822017-07-16 21:08:54 +0900299}
Hugo Benichi528d3d02018-06-20 13:35:58 +0900300
301TEST_F(FirewallControllerTest, TestDiscoverMaximumValidUid) {
302 struct {
303 const std::string description;
304 const std::string content;
305 const uint32_t expected;
306 } testCases[] = {
307 {
308 .description = "root namespace case",
309 .content = " 0 0 4294967295",
310 .expected = 4294967294,
311 },
312 {
313 .description = "container namespace case",
314 .content = " 0 655360 5000\n"
315 " 5000 600 50\n"
316 " 5050 660410 1994950\n",
317 .expected = 1999999,
318 },
319 {
320 .description = "garbage content case",
321 .content = "garbage",
322 .expected = 4294967294,
323 },
324 {
325 .description = "no content case",
326 .content = "",
327 .expected = 4294967294,
328 },
329 };
330
331 const std::string tempFile = "/data/local/tmp/fake_uid_mapping";
332
333 for (const auto& test : testCases) {
334 EXPECT_TRUE(WriteStringToFile(test.content, tempFile, false));
335 uint32_t got = FirewallController::discoverMaximumValidUid(tempFile);
336 EXPECT_EQ(0, remove(tempFile.c_str()));
337 if (got != test.expected) {
338 FAIL() << test.description << ":\n"
339 << test.content << "\ngot " << got << ", but expected " << test.expected;
340 }
341 }
342
343 // Also check when the file is not defined
344 EXPECT_NE(0, access(tempFile.c_str(), F_OK));
345 EXPECT_EQ(4294967294, FirewallController::discoverMaximumValidUid(tempFile));
346}