Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(882)

Unified Diff: sandbox/linux/services/namespace_utils_unittest.cc

Issue 935333002: Update from https://crrev.com/316786 (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 5 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « sandbox/linux/services/namespace_utils.cc ('k') | sandbox/linux/services/proc_util.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sandbox/linux/services/namespace_utils_unittest.cc
diff --git a/sandbox/linux/services/namespace_utils_unittest.cc b/sandbox/linux/services/namespace_utils_unittest.cc
index 42b469d8bbbb748a6ad62b594db48b2c01da59c8..41ed7e89a6e5bdae500b4f8cd32da10933937700 100644
--- a/sandbox/linux/services/namespace_utils_unittest.cc
+++ b/sandbox/linux/services/namespace_utils_unittest.cc
@@ -40,10 +40,17 @@ SANDBOX_TEST(NamespaceUtils, WriteToIdMapFile) {
const uid_t uid = getuid();
const gid_t gid = getgid();
+ const bool supports_deny_setgroups =
+ NamespaceUtils::KernelSupportsDenySetgroups();
+
const pid_t pid =
base::ForkWithFlags(CLONE_NEWUSER | SIGCHLD, nullptr, nullptr);
ASSERT_NE(-1, pid);
if (pid == 0) {
+ if (supports_deny_setgroups) {
+ RAW_CHECK(NamespaceUtils::DenySetgroups());
+ }
+
RAW_CHECK(getuid() != uid);
RAW_CHECK(NamespaceUtils::WriteToIdMapFile("/proc/self/uid_map", uid));
RAW_CHECK(getuid() == uid);
« no previous file with comments | « sandbox/linux/services/namespace_utils.cc ('k') | sandbox/linux/services/proc_util.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698