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

Unified Diff: chrome/browser/profiles/profile_manager.cc

Issue 2942043002: cros: Tighten profile loading (Closed)
Patch Set: update SystemClock header Created 3 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
Index: chrome/browser/profiles/profile_manager.cc
diff --git a/chrome/browser/profiles/profile_manager.cc b/chrome/browser/profiles/profile_manager.cc
index 64cf9463eef32b3713d233f70df0aad01690750e..fae8756ec5ab3e0fc76e0052a844c7ab0fea3599 100644
--- a/chrome/browser/profiles/profile_manager.cc
+++ b/chrome/browser/profiles/profile_manager.cc
@@ -642,13 +642,12 @@ Profile* ProfileManager::GetLastUsedProfile(
base::FilePath profile_path(user_data_dir);
Profile* profile = GetProfileByPath(profile_path.Append(profile_dir));
- // If we get here, it means the user has logged in but the profile has not
- // finished initializing, so treat the user as not having logged in.
- if (!profile) {
- LOG(WARNING) << "Calling GetLastUsedProfile() before profile "
- << "initialization is completed. Returning login profile.";
- return GetActiveUserOrOffTheRecordProfileFromPath(user_data_dir);
- }
+
+ // Accessing a user profile before it is loaded may lead to policy exploit.
+ // See http://crbug.com/689206.
+ LOG_IF(FATAL, !profile) << "Calling GetLastUsedProfile() before profile "
+ << "initialization is completed.";
+
return profile->IsGuestSession() ? profile->GetOffTheRecordProfile() :
profile;
}
« no previous file with comments | « chrome/browser/chromeos/system/tray_accessibility_browsertest.cc ('k') | chrome/browser/profiles/profile_manager_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698