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

Side by Side Diff: src/trusted/service_runtime/sel_main.c

Issue 10134056: Refactor the process of choosing validators. (Closed) Base URL: svn://svn.chromium.org/native_client/trunk/src/native_client
Patch Set: The actual refactoring Created 8 years, 8 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
OLDNEW
1 /* 1 /*
2 * Copyright (c) 2012 The Native Client Authors. All rights reserved. 2 * Copyright (c) 2012 The Native Client Authors. All rights reserved.
3 * Use of this source code is governed by a BSD-style license that can be 3 * Use of this source code is governed by a BSD-style license that can be
4 * found in the LICENSE file. 4 * found in the LICENSE file.
5 */ 5 */
6 6
7 /* 7 /*
8 * NaCl Simple/secure ELF loader (NaCl SEL). 8 * NaCl Simple/secure ELF loader (NaCl SEL).
9 */ 9 */
10 #include "native_client/src/include/portability.h" 10 #include "native_client/src/include/portability.h"
(...skipping 526 matching lines...) Expand 10 before | Expand all | Expand 10 after
537 if (LOAD_OK != pq_error) { 537 if (LOAD_OK != pq_error) {
538 errcode = pq_error; 538 errcode = pq_error;
539 nap->module_load_status = pq_error; 539 nap->module_load_status = pq_error;
540 fprintf(stderr, "Error while loading \"%s\": %s\n", 540 fprintf(stderr, "Error while loading \"%s\": %s\n",
541 NULL != nacl_file ? nacl_file 541 NULL != nacl_file ? nacl_file
542 : "(no file, to-be-supplied-via-RPC)", 542 : "(no file, to-be-supplied-via-RPC)",
543 NaClErrorString(errcode)); 543 NaClErrorString(errcode));
544 } 544 }
545 } 545 }
546 546
547 nap->enable_dfa_validator = 0; 547 NaClSelectValidator(nap);
548 if (getenv("NACL_DANGEROUS_USE_DFA_VALIDATOR") != NULL) {
549 fprintf(stderr, "DANGER! USING THE UNSTABLE DFA VALIDATOR!\n");
550 nap->enable_dfa_validator = 1;
551 }
552 548
553 /* Sanity check. */ 549 /* Sanity check. */
554 NaClSignalAssertNoHandlers(); 550 NaClSignalAssertNoHandlers();
555 551
556 if (handle_signals) { 552 if (handle_signals) {
557 NaClSignalHandlerInit(); 553 NaClSignalHandlerInit();
558 } else { 554 } else {
559 /* 555 /*
560 * Patch the Windows exception dispatcher to be safe in the case 556 * Patch the Windows exception dispatcher to be safe in the case
561 * of faults inside x86-64 sandboxed code. The sandbox is not 557 * of faults inside x86-64 sandboxed code. The sandbox is not
(...skipping 350 matching lines...) Expand 10 before | Expand all | Expand 10 after
912 fflush(stdout); 908 fflush(stdout);
913 909
914 if (handle_signals) NaClSignalHandlerFini(); 910 if (handle_signals) NaClSignalHandlerFini();
915 NaClAllModulesFini(); 911 NaClAllModulesFini();
916 912
917 NaClExit(ret_code); 913 NaClExit(ret_code);
918 914
919 /* Unreachable, but having the return prevents a compiler error. */ 915 /* Unreachable, but having the return prevents a compiler error. */
920 return ret_code; 916 return ret_code;
921 } 917 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698