| Index: src/trusted/nonnacl_util/sel_ldr_launcher_base.cc
|
| diff --git a/src/trusted/nonnacl_util/sel_ldr_launcher_base.cc b/src/trusted/nonnacl_util/sel_ldr_launcher_base.cc
|
| index 96cf4bee34828303ae216d5cc3157f59a4b7084f..ac3c94a39c2d0e033001214ec9218eb11910459a 100644
|
| --- a/src/trusted/nonnacl_util/sel_ldr_launcher_base.cc
|
| +++ b/src/trusted/nonnacl_util/sel_ldr_launcher_base.cc
|
| @@ -92,6 +92,45 @@ bool SelLdrLauncherBase::SetupCommand(NaClSrpcChannel* command) {
|
| return true;
|
| }
|
|
|
| +bool SelLdrLauncherBase::SetupUntrustedCommand(NaClSrpcChannel* command) {
|
| + NaClSrpcChannel secure_chan;
|
| + if (!SetupCommand(&secure_chan)) {
|
| + NaClLog(LOG_ERROR, "SelLdrLauncher::SetupCommand: "
|
| + "failed to setup trusted command channel\n");
|
| + return false;
|
| + }
|
| + NaClDesc* h;
|
| + NaClSrpcResultCodes rpc_result =
|
| + NaClSrpcInvokeBySignature(&secure_chan,
|
| + "command_setup::h",
|
| + &h);
|
| + if (NACL_SRPC_RESULT_OK != rpc_result) {
|
| + NaClLog(LOG_ERROR, "SelLdrLauncher::SetupCommand: "
|
| + "command setup failed\n");
|
| + return false;
|
| + }
|
| + // Make a nacl::DescWrapper* from the NaClDesc*
|
| + scoped_ptr<nacl::DescWrapper> conn_cap(WrapCleanup(h));
|
| + if (conn_cap == NULL) {
|
| + NaClLog(LOG_ERROR, "SelLdrLauncher::SetupCommand: "
|
| + "command conn desc wrap failed\n");
|
| + return false;
|
| + }
|
| + scoped_ptr<DescWrapper> command_desc(conn_cap->Connect());
|
| + if (command_desc == NULL) {
|
| + NaClLog(0, "SelLdrLauncher::SetupCommand: Connect failed\n");
|
| + return false;
|
| + }
|
| + // Start the SRPC client to communicate with the command channel.
|
| + // SRPC client takes an additional reference to command_desc.
|
| + if (!NaClSrpcClientCtor(command, command_desc->desc())) {
|
| + NaClLog(0, "SelLdrLauncher::SetupCommand: "
|
| + "NaClSrpcClientCtor failed\n");
|
| + return false;
|
| + }
|
| + return true;
|
| +}
|
| +
|
| bool SelLdrLauncherBase::LoadModule(NaClSrpcChannel* command,
|
| DescWrapper* nexe) {
|
| // TODO(sehr): This argument to load_module is unused. Remove it.
|
|
|