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

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

Issue 1690983004: Extended restricted filesystem to support relative paths. (Closed) Base URL: https://chromium.googlesource.com/native_client/src/native_client.git@master
Patch Set: Created 4 years, 9 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
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/build_config.h" 10 #include "native_client/src/include/build_config.h"
(...skipping 726 matching lines...) Expand 10 before | Expand all | Expand 10 after
737 737
738 /* 738 /*
739 * Make sure all the file buffers are flushed before entering 739 * Make sure all the file buffers are flushed before entering
740 * the application code. 740 * the application code.
741 */ 741 */
742 fflush((FILE *) NULL); 742 fflush((FILE *) NULL);
743 743
744 NaClAppStartModule(nap, NULL, NULL); 744 NaClAppStartModule(nap, NULL, NULL);
745 745
746 /* 746 /*
747 * For restricted file access, change directory to the root 747 * For restricted file access, change directory to the root of the restricted
748 * of the restricted directory. 748 * directory. This is required for safety, because we allow relative
749 * pathnames.
749 */ 750 */
750 if (NaClRootDir != NULL && NaClHostDescChdir(NaClRootDir)) { 751 if (NaClRootDir != NULL && NaClHostDescChdir(NaClRootDir)) {
751 NaClLog(LOG_FATAL, "Could not change directory to root dir\n"); 752 NaClLog(LOG_FATAL, "Could not change directory to root dir\n");
752 } 753 }
753 754
754 /* 755 /*
755 * error reporting done; can quit now if there was an error earlier. 756 * error reporting done; can quit now if there was an error earlier.
756 */ 757 */
757 if (LOAD_OK != errcode) { 758 if (LOAD_OK != errcode) {
758 NaClLog(4, 759 NaClLog(4,
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after
816 #if NACL_LINUX 817 #if NACL_LINUX
817 NaClSignalHandlerFini(); 818 NaClSignalHandlerFini();
818 #endif 819 #endif
819 NaClAllModulesFini(); 820 NaClAllModulesFini();
820 821
821 NaClExit(ret_code); 822 NaClExit(ret_code);
822 823
823 /* Unreachable, but having the return prevents a compiler error. */ 824 /* Unreachable, but having the return prevents a compiler error. */
824 return ret_code; 825 return ret_code;
825 } 826 }
OLDNEW
« no previous file with comments | « src/trusted/service_runtime/sel_ldr_filename.c ('k') | tests/limited_file_access/limited_file_access.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698