+ "diff": "diff --cc chrome/browser/file_system_access/chrome_file_system_access_permission_context.cc\nindex 33f5c6052d25b,fb77589b7ba2e..0000000000000\n--- a/chrome/browser/file_system_access/chrome_file_system_access_permission_context.cc\n+++ b/chrome/browser/file_system_access/chrome_file_system_access_permission_context.cc\n@@@ -258,114 -257,17 +257,128 @@@ bool MaybeIsLocalUNCPath(const base::Fi\n }\n #endif\n \n++<<<<<<< HEAD\n +// Sentinel used to indicate that no PathService key is specified for a path in\n +// the struct below.\n +constexpr const int kNoBasePathKey = -1;\n +\n +using BlockType = ChromeFileSystemAccessPermissionContext::BlockType;\n +\n +std::vector<ChromeFileSystemAccessPermissionContext::BlockedPath>\n +GenerateBlockedPath() {\n + return {\n + // Don't allow users to share their entire home directory, entire desktop\n + // or entire documents folder, but do allow sharing anything inside those\n + // directories not otherwise blocked.\n + {base::DIR_HOME, nullptr, BlockType::kDontBlockChildren},\n + {base::DIR_USER_DESKTOP, nullptr, BlockType::kDontBlockChildren},\n + {chrome::DIR_USER_DOCUMENTS, nullptr, BlockType::kDontBlockChildren},\n + // Similar restrictions for the downloads directory.\n + {chrome::DIR_DEFAULT_DOWNLOADS, nullptr, BlockType::kDontBlockChildren},\n + {chrome::DIR_DEFAULT_DOWNLOADS_SAFE, nullptr,\n + BlockType::kDontBlockChildren},\n + // The Chrome installation itself should not be modified by the web.\n + {base::DIR_EXE, nullptr, BlockType::kBlockAllChildren},\n + {base::DIR_MODULE, nullptr, BlockType::kBlockAllChildren},\n + {base::DIR_ASSETS, nullptr, BlockType::kBlockAllChildren},\n + // And neither should the configuration of at least the currently running\n + // Chrome instance (note that this does not take --user-data-dir command\n + // line overrides into account).\n + {chrome::DIR_USER_DATA, nullptr, BlockType::kBlockAllChildren},\n + // ~/.ssh is pretty sensitive on all platforms, so block access to that.\n + {base::DIR_HOME, FILE_PATH_LITERAL(\".ssh\"), BlockType::kBlockAllChildren},\n + // And limit access to ~/.gnupg as well.\n + {base::DIR_HOME, FILE_PATH_LITERAL(\".gnupg\"),\n + BlockType::kBlockAllChildren},\n +#if BUILDFLAG(IS_WIN)\n + // Some Windows specific directories to block, basically all apps, the\n + // operating system itself, as well as configuration data for apps.\n + {base::DIR_PROGRAM_FILES, nullptr, BlockType::kBlockAllChildren},\n + {base::DIR_PROGRAM_FILESX86, nullptr, BlockType::kBlockAllChildren},\n + {base::DIR_PROGRAM_FILES6432, nullptr, BlockType::kBlockAllChildren},\n + {base::DIR_WINDOWS, nullptr, BlockType::kBlockAllChildren},\n + {base::DIR_ROAMING_APP_DATA, nullptr, BlockType::kBlockAllChildren},\n + {base::DIR_LOCAL_APP_DATA, nullptr, BlockType::kBlockAllChildren},\n + {base::DIR_COMMON_APP_DATA, nullptr, BlockType::kBlockAllChildren},\n + // Opening a file from an MTP device, such as a smartphone or a camera, is\n + // implemented by Windows as opening a file in the temporary internet\n + // files directory. To support that, allow opening files in that\n + // directory, but not whole directories.\n + {base::DIR_IE_INTERNET_CACHE, nullptr,\n + BlockType::kBlockNestedDirectories},\n +#endif\n +#if BUILDFLAG(IS_MAC)\n + // Similar Mac specific blocks.\n + {base::DIR_APP_DATA, nullptr, BlockType::kBlockAllChildren},\n + // Block access to the current bundle directory.\n + {chrome::DIR_OUTER_BUNDLE, nullptr, BlockType::kBlockAllChildren},\n + // Block access to the user's Applications directory.\n + {base::DIR_HOME, FILE_PATH_LITERAL(\"Applications\"),\n + BlockType::kBlockAllChildren},\n + // Block access to the root Applications directory.\n + {kNoBasePathKey, FILE_PATH_LITERAL(\"/Applications\"),\n + BlockType::kBlockAllChildren},\n",
0 commit comments