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

Unified Diff: src/trusted/sel_universal/sel_universal.cc

Issue 10914138: Split secure command channel and untrusted application channel (Closed) Base URL: svn://svn.chromium.org/native_client/trunk/src/native_client
Patch Set: Created 8 years, 3 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
Index: src/trusted/sel_universal/sel_universal.cc
diff --git a/src/trusted/sel_universal/sel_universal.cc b/src/trusted/sel_universal/sel_universal.cc
index f6da905a0ee5c49a3cdabe575c8b46a35b916864..530b9069af4c1d9709ffaf8d1d033f4f386ff662 100644
--- a/src/trusted/sel_universal/sel_universal.cc
+++ b/src/trusted/sel_universal/sel_universal.cc
@@ -61,6 +61,7 @@ static const char* kUsage =
" --url_alias <url> <filename>\n"
" --uses_reverse_service\n"
" --no_app_channel\n"
+ " --untrusted\n"
" --irt <file>\n"
"\n"
"The following sel_ldr arguments might be useful:\n"
@@ -82,6 +83,7 @@ static bool silence_nexe = false;
static vector<string> command_prefix;
static bool uses_reverse_service = false;
static bool app_channel = true;
+static bool trusted = true;
// When given argc and argv this function (a) extracts the nexe argument,
// (b) populates sel_ldr_argv with sel_ldr arguments, and (c) populates
@@ -147,6 +149,8 @@ static nacl::string ProcessArguments(int argc,
uses_reverse_service = true;
} else if (flag == "--no_app_channel") {
app_channel = false;
+ } else if (flag == "--untrusted") {
+ trusted = false;
} else if (flag == "--irt") {
if (argc <= i + 1) {
NaClLog(LOG_FATAL, "not enough args for --irt option\n");
@@ -211,9 +215,16 @@ int raii_main(int argc, char* argv[]) {
NaClLog(LOG_FATAL, "sel_universal: Failed to launch sel_ldr\n");
}
- if (!launcher.SetupCommand(&command_channel)) {
- NaClLog(LOG_ERROR, "sel_universal: set up command failed\n");
- exit(1);
+ if (trusted) {
+ if (!launcher.SetupCommand(&command_channel)) {
+ NaClLog(LOG_ERROR, "sel_universal: set up command failed\n");
+ exit(1);
+ }
+ } else {
+ if (!launcher.SetupUntrustedCommand(&command_channel)) {
+ NaClLog(LOG_ERROR, "sel_universal: set up untrusted command failed\n");
+ exit(1);
+ }
}
DescWrapper *host_file = factory.OpenHostFile(app_name.c_str(), O_RDONLY, 0);
@@ -254,7 +265,7 @@ int raii_main(int argc, char* argv[]) {
exit(1);
}
- if (app_channel) {
+ if (trusted && app_channel) {
if (!launcher.SetupAppChannel(&channel)) {
NaClLog(LOG_ERROR,
"sel_universal: set up app channel failed\n");

Powered by Google App Engine
This is Rietveld 408576698