summaryrefslogtreecommitdiffstats
path: root/base/rand_util_c.h
diff options
context:
space:
mode:
authoragl@chromium.org <agl@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-03-04 20:18:55 +0000
committeragl@chromium.org <agl@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-03-04 20:18:55 +0000
commit1d87fad40da7f3ab7b0419bcf38a75645d572e04 (patch)
tree024708e6ea006ec395660e0ea47e6935d33e69f5 /base/rand_util_c.h
parentd9f4d2b5eb0428821d802f86fb56f46608dddb3b (diff)
downloadchromium_src-1d87fad40da7f3ab7b0419bcf38a75645d572e04.zip
chromium_src-1d87fad40da7f3ab7b0419bcf38a75645d572e04.tar.gz
chromium_src-1d87fad40da7f3ab7b0419bcf38a75645d572e04.tar.bz2
Add support for running the NaCl plugin in the Linux SUID sandbox
* Add a function for getting the pre-opened FD for /dev/urandom. This needs to be a C function because it will be used by nacl_secure_random.c. * Add an IPC message for creating shared memory segments, since /dev/shm is not available inside the sandbox. The corresponding NaCl change is http://codereview.chromium.org/669056 BUG=36676 TEST=nacl_ui_tests in conjunction with NaCl changes http://codereview.chromium.org/669055 Patch by Mark Seaborn. Signed-off-by: Adam Langley git-svn-id: svn://svn.chromium.org/chrome/trunk/src@40647 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'base/rand_util_c.h')
-rw-r--r--base/rand_util_c.h20
1 files changed, 20 insertions, 0 deletions
diff --git a/base/rand_util_c.h b/base/rand_util_c.h
new file mode 100644
index 0000000..5a0bf73
--- /dev/null
+++ b/base/rand_util_c.h
@@ -0,0 +1,20 @@
+// Copyright (c) 2010 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef BASE_RAND_UTIL_C_H_
+#define BASE_RAND_UTIL_C_H_
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+// Returns an FD for /dev/urandom, possibly pre-opened before sandboxing
+// was switched on. This is a C function so that Native Client can use it.
+int GetUrandomFD(void);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* BASE_RAND_UTIL_C_H_ */