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

Unified Diff: base/file_util_posix.cc

Issue 200473002: Move all callers of GetHomeDir() to PathService::Get(base::DIR_HOME). (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: . Created 6 years, 9 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 | « no previous file | base/nix/mime_util_xdg.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/file_util_posix.cc
diff --git a/base/file_util_posix.cc b/base/file_util_posix.cc
index 7e7dc052300fde54dc71f36681d783dc14776b17..eef083363c99f697ff525d64afebaf92ac5723c7 100644
--- a/base/file_util_posix.cc
+++ b/base/file_util_posix.cc
@@ -484,8 +484,12 @@ bool GetShmemTempDir(bool executable, FilePath* path) {
#if !defined(OS_MACOSX) // Mac implementation is in file_util_mac.mm.
FilePath GetHomeDir() {
#if defined(OS_CHROMEOS)
- if (SysInfo::IsRunningOnChromeOS())
- return FilePath("/home/chronos/user");
+ if (SysInfo::IsRunningOnChromeOS()) {
+ // On Chrome OS chrome::DIR_USER_DATA is overriden with a primary user
+ // homedir once it becomes available.
+ NOTREACHED() << "Called GetHomeDir() without base::DIR_HOME override";
+ return FilePath("/tmp");
Dmitry Polukhin 2014/03/17 18:28:30 I think it is bad idea to use /tmp attacker could
Will Drewry 2014/04/08 15:55:04 '/' is definitely a better choice since it isn't w
+ }
#endif
const char* home_dir = getenv("HOME");
« no previous file with comments | « no previous file | base/nix/mime_util_xdg.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698