Commit a5c38f55 authored by Lachlan Ford's avatar Lachlan Ford Committed by Commit Bot

Fixed AppContainer failure to create on Windows Core OS systems

On Windows Core OS systems, the character limit for the app container
name is 50 characters. Chromium currently supplies app container names
> 50 characters. This change shortens the sandbox process names.

Change-Id: Id64d511bd2eefeceeb89c52dbf6fde87ce7f82fe
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2234995Reviewed-by: default avatarJames Forshaw <forshaw@chromium.org>
Commit-Queue: Lachlan Ford <laford@microsoft.com>
Cr-Commit-Position: refs/heads/master@{#780170}
parent 099ef0d0
...@@ -621,14 +621,15 @@ base::string16 GetAppContainerProfileName( ...@@ -621,14 +621,15 @@ base::string16 GetAppContainerProfileName(
sandbox_type == SandboxType::kXrCompositing); sandbox_type == SandboxType::kXrCompositing);
auto sha1 = base::SHA1HashString(appcontainer_id); auto sha1 = base::SHA1HashString(appcontainer_id);
std::string sandbox_base_name = (sandbox_type == SandboxType::kXrCompositing) std::string sandbox_base_name = (sandbox_type == SandboxType::kXrCompositing)
? std::string("chrome.sandbox.xrdevice") ? std::string("cr.sb.xr")
: std::string("chrome.sandbox.gpu"); : std::string("cr.sb.gpu");
std::string profile_name = base::StrCat( std::string profile_name = base::StrCat(
{sandbox_base_name, base::HexEncode(sha1.data(), sha1.size())}); {sandbox_base_name, base::HexEncode(sha1.data(), sha1.size())});
// CreateAppContainerProfile requires that the profile name is at most 64 // CreateAppContainerProfile requires that the profile name is at most 64
// characters. The size of sha1 is a constant 40, so validate that the base // characters but 50 on WCOS systems. The size of sha1 is a constant 40,
// names are sufficiently short that the total length is valid. // so validate that the base names are sufficiently short that the total
DCHECK_LE(profile_name.length(), 64U); // length is valid on all systems.
DCHECK_LE(profile_name.length(), 50U);
return base::UTF8ToWide(profile_name); return base::UTF8ToWide(profile_name);
} }
......
...@@ -39,8 +39,8 @@ namespace { ...@@ -39,8 +39,8 @@ namespace {
constexpr wchar_t kBaseSecurityDescriptor[] = L"D:(A;;GA;;;WD)"; constexpr wchar_t kBaseSecurityDescriptor[] = L"D:(A;;GA;;;WD)";
constexpr char kAppContainerId[] = "SandboxWinTest"; constexpr char kAppContainerId[] = "SandboxWinTest";
constexpr wchar_t kPackageSid[] = constexpr wchar_t kPackageSid[] =
L"S-1-15-2-2739114418-4250112400-4176314265-1208402406-1880724913-" L"S-1-15-2-1505217662-1870513255-555216753-1864132992-3842232122-"
L"3756377648-2708578895"; L"1807018979-869957911";
constexpr wchar_t kChromeInstallFiles[] = L"chromeInstallFiles"; constexpr wchar_t kChromeInstallFiles[] = L"chromeInstallFiles";
constexpr wchar_t kLpacChromeInstallFiles[] = L"lpacChromeInstallFiles"; constexpr wchar_t kLpacChromeInstallFiles[] = L"lpacChromeInstallFiles";
constexpr wchar_t kRegistryRead[] = L"registryRead"; constexpr wchar_t kRegistryRead[] = L"registryRead";
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment