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

Side by Side Diff: src/trusted/service_runtime/env_cleanser.h

Issue 7031023: Run NaClEnvCleanser in standalone sel_ldr (in addition to sel_main_chrome). Add a couple of ld.so... (Closed) Base URL: svn://svn.chromium.org/native_client/trunk/src/native_client/
Patch Set: '' Created 9 years, 7 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 | Annotate | Revision Log
« no previous file with comments | « src/trusted/service_runtime/build.scons ('k') | src/trusted/service_runtime/env_cleanser.c » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright 2009 The Native Client Authors. All rights reserved. 2 * Copyright (c) 2011 The Native Client Authors. All rights reserved.
3 * Use of this source code is governed by a BSD-style license that can 3 * Use of this source code is governed by a BSD-style license that can be
4 * be found in the LICENSE file. 4 * found in the LICENSE file.
5 */ 5 */
6 6
7 /* 7 /*
8 * Simple environment cleanser to remove all but a whitelisted set of 8 * Simple environment cleanser to remove all but a whitelisted set of
9 * environment variables deemed safe/appropriate to export to NaCl 9 * environment variables deemed safe/appropriate to export to NaCl
10 * modules. 10 * modules.
11 */ 11 */
12 12
13 #ifndef NATIVE_CLIENT_SRC_TRUSTED_SERVICE_RUNTIME_ENV_CLEANSER_H_ 13 #ifndef NATIVE_CLIENT_SRC_TRUSTED_SERVICE_RUNTIME_ENV_CLEANSER_H_
14 #define NATIVE_CLIENT_SRC_TRUSTED_SERVICE_RUNTIME_ENV_CLEANSER_H_ 14 #define NATIVE_CLIENT_SRC_TRUSTED_SERVICE_RUNTIME_ENV_CLEANSER_H_
15 15
16 #include "native_client/src/include/nacl_base.h" 16 #include "native_client/src/include/nacl_base.h"
17 17
18 EXTERN_C_BEGIN 18 EXTERN_C_BEGIN
19 19
20 struct NaClEnvCleanser { 20 struct NaClEnvCleanser {
21 /* private */ 21 /* private */
22 int with_whitelist;
22 char const **cleansed_environ; 23 char const **cleansed_environ;
23 }; 24 };
24 25
25 void NaClEnvCleanserCtor(struct NaClEnvCleanser *self); 26 void NaClEnvCleanserCtor(struct NaClEnvCleanser *self, int with_whitelist);
26 27
27 /* 28 /*
28 * Initializes the NaClEnvCleanser. Filters the environment at envp 29 * Initializes the NaClEnvCleanser. Filters the environment at envp
29 * and saves the result in the object. The lifetime of the string 30 * and saves the result in the object. The lifetime of the string
30 * table and associated strings at envp must be at least that of the 31 * table and associated strings at envp must be at least that of the
31 * NaClEnvCleanser object, and should not change between the call to 32 * NaClEnvCleanser object, and should not change between the call to
32 * NaClEnvCleanserInit and to NaClEnvCleanserDtor. 33 * NaClEnvCleanserInit and to NaClEnvCleanserDtor.
33 */ 34 */
34 int NaClEnvCleanserInit(struct NaClEnvCleanser *self, char const *const *envp); 35 int NaClEnvCleanserInit(struct NaClEnvCleanser *self, char const *const *envp,
36 char const *const *extra_env);
35 37
36 /* 38 /*
37 * Returns the filtered environment. 39 * Returns the filtered environment.
38 */ 40 */
39 char const *const *NaClEnvCleanserEnvironment(struct NaClEnvCleanser *self); 41 char const *const *NaClEnvCleanserEnvironment(struct NaClEnvCleanser *self);
40 42
41 /* 43 /*
42 * Frees memory associated with the NaClEnvCleanser object. 44 * Frees memory associated with the NaClEnvCleanser object.
43 */ 45 */
44 void NaClEnvCleanserDtor(struct NaClEnvCleanser *self); 46 void NaClEnvCleanserDtor(struct NaClEnvCleanser *self);
45 47
46 EXTERN_C_END 48 EXTERN_C_END
47 49
48 #endif // NATIVE_CLIENT_SRC_TRUSTED_SERVICE_RUNTIME_ENV_CLEANSER_H_ 50 #endif // NATIVE_CLIENT_SRC_TRUSTED_SERVICE_RUNTIME_ENV_CLEANSER_H_
OLDNEW
« no previous file with comments | « src/trusted/service_runtime/build.scons ('k') | src/trusted/service_runtime/env_cleanser.c » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698