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

Side by Side Diff: chrome/browser/net/chrome_network_delegate.cc

Issue 2640073003: WIP: Skip symbolic links in file:// URLs. (Closed)
Patch Set: WIP: Skip symbolic linkx in file:// URLs. Created 3 years, 11 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 unified diff | Download patch
« no previous file with comments | « no previous file | net/base/directory_lister.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "chrome/browser/net/chrome_network_delegate.h" 5 #include "chrome/browser/net/chrome_network_delegate.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 #include <stdlib.h> 8 #include <stdlib.h>
9 9
10 #include <vector> 10 #include <vector>
(...skipping 460 matching lines...) Expand 10 before | Expand all | Expand 10 after
471 return true; 471 return true;
472 #else 472 #else
473 #if defined(OS_CHROMEOS) 473 #if defined(OS_CHROMEOS)
474 // If we're running Chrome for ChromeOS on Linux, we want to allow file 474 // If we're running Chrome for ChromeOS on Linux, we want to allow file
475 // access. 475 // access.
476 if (!base::SysInfo::IsRunningOnChromeOS() || 476 if (!base::SysInfo::IsRunningOnChromeOS() ||
477 base::CommandLine::ForCurrentProcess()->HasSwitch(switches::kTestType)) { 477 base::CommandLine::ForCurrentProcess()->HasSwitch(switches::kTestType)) {
478 return true; 478 return true;
479 } 479 }
480 480
481 if (base::IsLink(path.StripTrailingSeparators()))
482 return false;
483
481 // Use a whitelist to only allow access to files residing in the list of 484 // Use a whitelist to only allow access to files residing in the list of
482 // directories below. 485 // directories below.
483 static const char* const kLocalAccessWhiteList[] = { 486 static const char* const kLocalAccessWhiteList[] = {
484 "/home/chronos/user/Downloads", 487 "/home/chronos/user/Downloads",
485 "/home/chronos/user/log", 488 "/home/chronos/user/log",
486 "/home/chronos/user/WebRTC Logs", 489 "/home/chronos/user/WebRTC Logs",
487 "/media", 490 "/media",
488 "/opt/oem", 491 "/opt/oem",
489 "/usr/share/chromeos-assets", 492 "/usr/share/chromeos-assets",
490 "/tmp", 493 "/tmp",
(...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after
576 if (!data_use_aggregator_) 579 if (!data_use_aggregator_)
577 return; 580 return;
578 581
579 if (is_data_usage_off_the_record_) { 582 if (is_data_usage_off_the_record_) {
580 data_use_aggregator_->ReportOffTheRecordDataUse(tx_bytes, rx_bytes); 583 data_use_aggregator_->ReportOffTheRecordDataUse(tx_bytes, rx_bytes);
581 return; 584 return;
582 } 585 }
583 586
584 data_use_aggregator_->ReportDataUse(request, tx_bytes, rx_bytes); 587 data_use_aggregator_->ReportDataUse(request, tx_bytes, rx_bytes);
585 } 588 }
OLDNEW
« no previous file with comments | « no previous file | net/base/directory_lister.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698