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

Unified Diff: chrome/common/extensions/extension_unpacker.cc

Issue 2802018: Loosen permission on extension temp dir when a flag is used. (Closed) Base URL: git://codf21.jail/chromium.git
Patch Set: Rebase for commit. Created 10 years, 6 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/common/chrome_switches.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/common/extensions/extension_unpacker.cc
diff --git a/chrome/common/extensions/extension_unpacker.cc b/chrome/common/extensions/extension_unpacker.cc
index 599aa1188aafa29491f39061eb1ac75363701a18..64ff8578f58a843e6ab543f392b6290ddd0f98e1 100644
--- a/chrome/common/extensions/extension_unpacker.cc
+++ b/chrome/common/extensions/extension_unpacker.cc
@@ -4,6 +4,7 @@
#include "chrome/common/extensions/extension_unpacker.h"
+#include "base/command_line.h"
#include "base/file_util.h"
#include "base/scoped_handle.h"
#include "base/scoped_temp_dir.h"
@@ -11,6 +12,7 @@
#include "base/thread.h"
#include "base/values.h"
#include "net/base/file_stream.h"
+#include "chrome/common/chrome_switches.h"
#include "chrome/common/common_param_traits.h"
#include "chrome/common/extensions/extension.h"
#include "chrome/common/extensions/extension_constants.h"
@@ -142,12 +144,23 @@ bool ExtensionUnpacker::Run() {
extension_path_.DirName().AppendASCII(filenames::kTempExtensionName);
#if defined(OS_WIN)
+ // To understand crbug/35198, allow users who can reproduce the issue
+ // to enable extra logging while unpacking.
+ bool extra_logging = CommandLine::ForCurrentProcess()->HasSwitch(
+ switches::kIssue35198ExtraLogging);
+ LOG(INFO) << "Extra logging for issue 35198: " << extra_logging;
+
std::ostringstream log_stream;
std::string dir_string = WideToUTF8(temp_install_dir_.value());
log_stream << kCouldNotCreateDirectoryError << dir_string << std::endl;
+
if (!file_util::CreateDirectoryExtraLogging(temp_install_dir_, log_stream)) {
- log_stream.flush();
- SetError(log_stream.str());
+ if (extra_logging) {
+ log_stream.flush();
+ SetError(log_stream.str());
+ } else {
+ SetError(kCouldNotCreateDirectoryError + dir_string);
+ }
return false;
}
#else
« no previous file with comments | « chrome/common/chrome_switches.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698