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

Side by Side Diff: sandbox/linux/services/namespace_utils.h

Issue 849893004: Move a couple of utility functions to a new namespace_utils class. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 11 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 unified diff | Download patch
OLDNEW
(Empty)
1 // Copyright (c) 2014 The Chromium Authors. All rights reserved.
jln (very slow on Chromium) 2015/01/14 00:46:37 Not (c) after "Copyright" anymore
rickyz (no longer on Chrome) 2015/01/23 01:20:19 Done.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #ifndef SANDBOX_LINUX_SERVICES_NAMESPACE_UTILS_H_
6 #define SANDBOX_LINUX_SERVICES_NAMESPACE_UTILS_H_
7
8 #include <sys/types.h>
9
10 #include "base/macros.h"
11 #include "base/template_util.h"
12 #include "sandbox/sandbox_export.h"
13
jln (very slow on Chromium) 2015/01/14 00:46:37 Please, add a little bit of documentation about wh
rickyz (no longer on Chrome) 2015/01/23 01:20:19 Not the best comment, since the class is a little
14 namespace sandbox {
15
16 class SANDBOX_EXPORT NamespaceUtils {
17 public:
18 COMPILE_ASSERT((base::is_same<uid_t, gid_t>::value), UidAndGidAreSameType);
19 // generic_id_t can be used for either uid_t or gid_t.
20 typedef uid_t generic_id_t;
21
22 // Write a uid or gid mapping from |id| to |id| in |map_file|.
23 static bool WriteToIdMapFile(const char* map_file, generic_id_t id);
24
25 // Returns true if the namespace type |type| is supported. |type| must be one
26 // of CLONE_NEWIPC, CLONE_NEWNET, CLONE_NEWNS, CLONE_NEWPID, CLONE_NEWUSER, or
27 // CLONE_NEWUTS. This relies on access to /proc, so it will not work from
28 // within a chroot.
29 static bool SupportsLinuxNamespace(int type);
30 };
jln (very slow on Chromium) 2015/01/14 00:46:37 DISALLOW_IMPLICIT_CONSTRUCTORS
rickyz (no longer on Chrome) 2015/01/23 01:20:17 Done.
31
32 } // namespace sandbox
33
34 #endif // SANDBOX_LINUX_SERVICES_NAMESPACE_UTILS_H_
OLDNEW
« no previous file with comments | « sandbox/linux/services/credentials_unittest.cc ('k') | sandbox/linux/services/namespace_utils.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698