diff options
author | blois@google.com <blois@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2014-01-11 22:38:48 +0000 |
---|---|---|
committer | blois@google.com <blois@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2014-01-11 22:38:48 +0000 |
commit | 3360fedff56456dcf2f20077be746ee3a473c56c (patch) | |
tree | 0d9bf6631c7b58a2a435f9993da95f2f9a329b31 /chrome/browser/extensions/extension_protocols.cc | |
parent | 7aba4d791db2ebdd3db30cd617551e904cfeff2e (diff) | |
download | chromium_src-3360fedff56456dcf2f20077be746ee3a473c56c.zip chromium_src-3360fedff56456dcf2f20077be746ee3a473c56c.tar.gz chromium_src-3360fedff56456dcf2f20077be746ee3a473c56c.tar.bz2 |
Allowing following of symlinks for script resources from extensions
Support for following symlinks was added with https://chromiumcodereview.appspot.com/10387035/ but it's been broken for script resources because the proper flags were not being propagated.
This only allows following symlinks if the extension was an unpacked extension.
BUG=27185
Review URL: https://codereview.chromium.org/106533003
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@244370 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/extensions/extension_protocols.cc')
-rw-r--r-- | chrome/browser/extensions/extension_protocols.cc | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/chrome/browser/extensions/extension_protocols.cc b/chrome/browser/extensions/extension_protocols.cc index 3baf2c0..f93b352 100644 --- a/chrome/browser/extensions/extension_protocols.cc +++ b/chrome/browser/extensions/extension_protocols.cc @@ -283,7 +283,8 @@ class URLRequestExtensionJob : public net::URLRequestFileJob { const base::FilePath& directory_path, const base::FilePath& relative_path, const std::string& content_security_policy, - bool send_cors_header) + bool send_cors_header, + bool follow_symlinks_anywhere) : net::URLRequestFileJob( request, network_delegate, base::FilePath(), BrowserThread::GetBlockingPool()->GetTaskRunnerWithShutdownBehavior( @@ -295,6 +296,9 @@ class URLRequestExtensionJob : public net::URLRequestFileJob { content_security_policy_(content_security_policy), send_cors_header_(send_cors_header), weak_factory_(this) { + if (follow_symlinks_anywhere) { + resource_.set_follow_symlinks_anywhere(); + } } virtual void GetResponseInfo(net::HttpResponseInfo* info) OVERRIDE { @@ -525,6 +529,7 @@ ExtensionProtocolHandler::MaybeCreateJob( std::string content_security_policy; bool send_cors_header = false; + bool follow_symlinks_anywhere = false; if (extension) { std::string resource_path = request->url().path(); content_security_policy = @@ -536,6 +541,10 @@ ExtensionProtocolHandler::MaybeCreateJob( extensions::WebAccessibleResourcesInfo::IsResourceWebAccessible( extension, resource_path)) send_cors_header = true; + + follow_symlinks_anywhere = + (extension->creation_flags() & Extension::FOLLOW_SYMLINKS_ANYWHERE) + != 0; } std::string path = request->url().path(); @@ -617,7 +626,8 @@ ExtensionProtocolHandler::MaybeCreateJob( directory_path, relative_path, content_security_policy, - send_cors_header); + send_cors_header, + follow_symlinks_anywhere); } } // namespace |