diff options
author | Jan Kotas <jkotas@microsoft.com> | 2018-11-22 14:22:40 -0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-11-22 14:22:40 -0800 |
commit | e54dffef08c22a94962aacd93d4793b377cac632 (patch) | |
tree | add9888e42a3c93be7ce63e6f2cbab48e80c4a2e /src/binder | |
parent | f80f9d5435155cc7a36fbaefa3c8d7da7cc309aa (diff) | |
download | coreclr-e54dffef08c22a94962aacd93d4793b377cac632.tar.gz coreclr-e54dffef08c22a94962aacd93d4793b377cac632.tar.bz2 coreclr-e54dffef08c22a94962aacd93d4793b377cac632.zip |
Delete System.AppDomainSetup (#21157)
* Delete System.AppDomainSetup
Contributes to #21028
* Add test hook for null entry assembly
* Validate that the binder paths are absolute
Diffstat (limited to 'src/binder')
-rw-r--r-- | src/binder/applicationcontext.cpp | 39 |
1 files changed, 34 insertions, 5 deletions
diff --git a/src/binder/applicationcontext.cpp b/src/binder/applicationcontext.cpp index d395f4ddc1..dc7b9ad6e3 100644 --- a/src/binder/applicationcontext.cpp +++ b/src/binder/applicationcontext.cpp @@ -28,6 +28,8 @@ #include "utils.hpp" #include "variables.hpp" #include "ex.h" +#include "clr/fs/path.h" +using namespace clr::fs; namespace BINDER_SPACE { @@ -258,17 +260,20 @@ namespace BINDER_SPACE break; } +#ifndef CROSSGEN_COMPILE + if (Path::IsRelative(fileName)) + { + BINDER_LOG_STRING(W("ApplicationContext::SetupBindingPaths: Relative path not allowed"), fileName); + GO_WITH_HRESULT(E_INVALIDARG); + } +#endif + // Find the beginning of the simple name SString::Iterator iSimpleNameStart = fileName.End(); if (!fileName.FindBack(iSimpleNameStart, DIRECTORY_SEPARATOR_CHAR_W)) { -#ifdef CROSSGEN_COMPILE iSimpleNameStart = fileName.Begin(); -#else - // Couldn't find a directory separator. File must have been specified as a relative path. Not allowed. - GO_WITH_HRESULT(E_INVALIDARG); -#endif } else { @@ -395,6 +400,14 @@ namespace BINDER_SPACE break; } +#ifndef CROSSGEN_COMPILE + if (Path::IsRelative(pathName)) + { + BINDER_LOG_STRING(W("ApplicationContext::SetupBindingPaths: Relative path not allowed"), pathName); + GO_WITH_HRESULT(E_INVALIDARG); + } +#endif + m_platformResourceRoots.Append(pathName); BINDER_LOG_STRING(W("ApplicationContext::SetupBindingPaths: Added resource root"), pathName); } @@ -414,6 +427,14 @@ namespace BINDER_SPACE break; } +#ifndef CROSSGEN_COMPILE + if (Path::IsRelative(pathName)) + { + BINDER_LOG_STRING(W("ApplicationContext::SetupBindingPaths: Relative path not allowed"), pathName); + GO_WITH_HRESULT(E_INVALIDARG); + } +#endif + m_appPaths.Append(pathName); BINDER_LOG_STRING(W("ApplicationContext::SetupBindingPaths: Added App Path"), pathName); } @@ -433,6 +454,14 @@ namespace BINDER_SPACE break; } +#ifndef CROSSGEN_COMPILE + if (Path::IsRelative(pathName)) + { + BINDER_LOG_STRING(W("ApplicationContext::SetupBindingPaths: Relative path not allowed"), pathName); + GO_WITH_HRESULT(E_INVALIDARG); + } +#endif + m_appNiPaths.Append(pathName); BINDER_LOG_STRING(W("ApplicationContext::SetupBindingPaths: Added App NI Path"), pathName); } |