Lines Matching defs:creds
63 Credentials creds;
64 int fd_count = creds.CountOpenFds(proc_fd.get());
67 EXPECT_EQ(fd_count + 1, creds.CountOpenFds(proc_fd.get()));
69 EXPECT_EQ(fd_count, creds.CountOpenFds(proc_fd.get()));
73 Credentials creds;
75 EXPECT_FALSE(creds.HasOpenDirectory(-1));
80 EXPECT_TRUE(creds.HasOpenDirectory(-1));
82 EXPECT_FALSE(creds.HasOpenDirectory(-1));
86 Credentials creds;
94 EXPECT_TRUE(creds.HasOpenDirectory(-1));
96 EXPECT_FALSE(creds.HasOpenDirectory(proc_fd));
102 EXPECT_TRUE(creds.HasOpenDirectory(proc_fd));
107 EXPECT_FALSE(creds.HasOpenDirectory(proc_fd));
111 Credentials creds;
112 CHECK(creds.DropAllCapabilities());
113 CHECK(!creds.HasAnyCapability());
117 Credentials creds;
118 CHECK(creds.DropAllCapabilities());
120 CHECK(*creds.GetCurrentCapString() == kNoCapabilityText);
124 Credentials creds;
125 creds.DropAllCapabilities();
126 bool moved_to_new_ns = creds.MoveToNewUserNS();
137 CHECK(creds.HasAnyCapability());
138 creds.DropAllCapabilities();
139 CHECK(!creds.HasAnyCapability());
143 Credentials creds;
144 creds.DropAllCapabilities();
146 bool moved_to_new_ns = creds.MoveToNewUserNS();
151 Credentials creds;
152 creds.DropAllCapabilities();
158 if (!creds.MoveToNewUserNS()) return;
172 bool NewUserNSCycle(Credentials* creds) {
173 DCHECK(creds);
174 if (!creds->MoveToNewUserNS() ||
175 !creds->HasAnyCapability() ||
176 !creds->DropAllCapabilities() ||
177 creds->HasAnyCapability()) {
184 Credentials creds;
185 CHECK(creds.DropAllCapabilities());
187 if (!creds.MoveToNewUserNS()) return;
188 creds.DropAllCapabilities();
192 CHECK(NewUserNSCycle(&creds)) << "Creating new user NS failed at iteration "
206 Credentials creds;
207 CHECK(creds.DropAllCapabilities());
209 if (!creds.MoveToNewUserNS()) return;
210 CHECK(creds.DropFileSystemAccess());
221 Credentials creds;
222 CHECK(creds.DropAllCapabilities());
224 if (!creds.MoveToNewUserNS()) return;
225 CHECK(creds.DropFileSystemAccess());
226 CHECK(creds.DropAllCapabilities());
231 CHECK(!creds.MoveToNewUserNS());