diff options
author | skerner@chromium.org <skerner@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-06-09 22:56:48 +0000 |
---|---|---|
committer | skerner@chromium.org <skerner@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-06-09 22:56:48 +0000 |
commit | 6f5f4322d6688abd29d0253a6a8201fb7b1c103d (patch) | |
tree | 1ceb35e4715990b18b9f7f6327c5072f7a699fe4 /chrome/browser/extensions | |
parent | a53bb6f7db58fa59fb2dd3b6508b6acc0d1d44ad (diff) | |
download | chromium_src-6f5f4322d6688abd29d0253a6a8201fb7b1c103d.zip chromium_src-6f5f4322d6688abd29d0253a6a8201fb7b1c103d.tar.gz chromium_src-6f5f4322d6688abd29d0253a6a8201fb7b1c103d.tar.bz2 |
Give the extension unpacker process a junction/symlink free path to the unpack directory.
BUG=35198,13044
TEST=FileUtilTest.NormalizeFilePathBasic,FileUtilTest. NormalizeFilePathReparsePoints,FileUtilTest.NormalizeFilePathSymlinks
Review URL: http://codereview.chromium.org/2088006
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@49337 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/extensions')
-rw-r--r-- | chrome/browser/extensions/sandboxed_extension_unpacker.cc | 24 |
1 files changed, 20 insertions, 4 deletions
diff --git a/chrome/browser/extensions/sandboxed_extension_unpacker.cc b/chrome/browser/extensions/sandboxed_extension_unpacker.cc index 69d37d8..600d832 100644 --- a/chrome/browser/extensions/sandboxed_extension_unpacker.cc +++ b/chrome/browser/extensions/sandboxed_extension_unpacker.cc @@ -64,8 +64,24 @@ void SandboxedExtensionUnpacker::Start() { return; } - // If we are supposed to use a subprocess, copy the crx to the temp directory - // and kick off the subprocess. + // The utility process will have access to the directory passed to + // SandboxedExtensionUnpacker. That directory should not contain a + // symlink or NTFS junction, because when the path is used, following + // the link will cause file system access outside the sandbox path. + FilePath normalized_crx_path; + if (!file_util::NormalizeFilePath(temp_crx_path, &normalized_crx_path)) { + // TODO(skerner): Remove this logging once crbug/13044 is fixed. + // This bug is starred by many users who have some kind of link. + // If NormalizeFilePath() fails we want to see it in the logs they send. + LOG(ERROR) << "Could not get the normalized path of " + << temp_crx_path.value(); + normalized_crx_path = temp_crx_path; + } else { + LOG(INFO) << "RealFilePath: from " << temp_crx_path.value() + << " to " << normalized_crx_path.value(); + } + + // If we are supposed to use a subprocess, kick off the subprocess. // // TODO(asargent) we shouldn't need to do this branch here - instead // UtilityProcessHost should handle it for us. (http://crbug.com/19192) @@ -77,10 +93,10 @@ void SandboxedExtensionUnpacker::Start() { NewRunnableMethod( this, &SandboxedExtensionUnpacker::StartProcessOnIOThread, - temp_crx_path)); + normalized_crx_path)); } else { // Otherwise, unpack the extension in this process. - ExtensionUnpacker unpacker(temp_crx_path); + ExtensionUnpacker unpacker(normalized_crx_path); if (unpacker.Run() && unpacker.DumpImagesToFile() && unpacker.DumpMessageCatalogsToFile()) { OnUnpackExtensionSucceeded(*unpacker.parsed_manifest()); |