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

Issue 9405035: Implement ephemeral users (Closed)

Created:
8 years, 10 months ago by use bartfab instead
Modified:
6 years, 8 months ago
CC:
chromium-reviews, stevenjb+watch_chromium.org, nkostylev+watch_chromium.org, davemoore+watch_chromium.org, rkc, pastarmovj, merkulova, dzhioev (left Google)
Base URL:
http://git.chromium.org/chromium/src.git@master
Visibility:
Public.

Description

Implement ephemeral users This CL completes the implementation of http://crosbug.com/20004. When the ephemeral users policy is enabled, users are not added to UserManager's persistent list and are not asked to pick a user image. UserManager additionally checks for stale entries created before the policy was enabled and removes these, along with downloaded user images. See http://goo.gl/wTPEb for a design doc. The CL includes unit tests for the new feature. BUG=chromium-os:20004 TEST=unittest UserManagerTest* TEST=manual feature test in numerous scenarios on a Chromebook Committed: http://src.chromium.org/viewvc/chrome?view=rev&revision=126198

Patch Set 1 #

Patch Set 2 : This version is actually feature-complete but still untested. #

Patch Set 3 : Next iteration, including a small fix and a set of unit tests. #

Patch Set 4 : Complete, tested implementation - ready for review. #

Total comments: 4

Patch Set 5 : Comments addressed. #

Total comments: 57

Patch Set 6 : Comments addressed. #

Total comments: 19

Patch Set 7 : Comments addressed. #

Total comments: 14

Patch Set 8 : Rebased and refactored after recent changes in Chrome. #

Patch Set 9 : As discussed, removed initial image selection. #

Total comments: 2
Unified diffs Side-by-side diffs Delta from patch set Stats (+418 lines, -93 lines) Patch
M chrome/browser/chromeos/login/mock_user_manager.h View 1 2 3 4 5 6 7 8 1 chunk +1 line, -0 lines 0 comments Download
M chrome/browser/chromeos/login/user_manager.h View 1 2 3 4 5 6 7 8 3 chunks +11 lines, -6 lines 0 comments Download
M chrome/browser/chromeos/login/user_manager_impl.h View 1 2 3 4 5 6 7 8 5 chunks +41 lines, -3 lines 0 comments Download
M chrome/browser/chromeos/login/user_manager_impl.cc View 1 2 3 4 5 6 7 8 15 chunks +192 lines, -84 lines 2 comments Download
A chrome/browser/chromeos/login/user_manager_unittest.cc View 1 2 3 4 5 6 7 1 chunk +167 lines, -0 lines 0 comments Download
M chrome/browser/chromeos/login/wizard_controller.cc View 1 2 3 4 5 6 7 8 1 chunk +5 lines, -0 lines 0 comments Download
M chrome/chrome_tests.gypi View 1 2 3 4 5 6 7 8 1 chunk +1 line, -0 lines 0 comments Download

Messages

Total messages: 39 (0 generated)
use bartfab instead
Hi Chris, Денис, I have a CL that matured over the past few weeks and ...
8 years, 9 months ago (2012-02-29 20:23:30 UTC) #1
csilv
https://chromiumcodereview.appspot.com/9405035/diff/10001/chrome/browser/resources/options/personal_options.js File chrome/browser/resources/options/personal_options.js (right): https://chromiumcodereview.appspot.com/9405035/diff/10001/chrome/browser/resources/options/personal_options.js#newcode126 chrome/browser/resources/options/personal_options.js:126: } else if (localStrings.getString('current_user_is_ephemeral')) { should be: if (localStrings.getString('current_user_is_ephemeral') ...
8 years, 9 months ago (2012-03-01 02:10:42 UTC) #2
use bartfab instead
Comments addressed. https://chromiumcodereview.appspot.com/9405035/diff/10001/chrome/browser/resources/options/personal_options.js File chrome/browser/resources/options/personal_options.js (right): https://chromiumcodereview.appspot.com/9405035/diff/10001/chrome/browser/resources/options/personal_options.js#newcode126 chrome/browser/resources/options/personal_options.js:126: } else if (localStrings.getString('current_user_is_ephemeral')) { On 2012/03/01 ...
8 years, 9 months ago (2012-03-01 05:13:58 UTC) #3
Nikita (slow)
+Ivan, he previously did UserManager refactoring.
8 years, 9 months ago (2012-03-01 10:00:37 UTC) #4
Nikita (slow)
https://chromiumcodereview.appspot.com/9405035/diff/17001/chrome/browser/chromeos/login/user_manager.cc File chrome/browser/chromeos/login/user_manager.cc (right): https://chromiumcodereview.appspot.com/9405035/diff/17001/chrome/browser/chromeos/login/user_manager.cc#newcode1243 chrome/browser/chromeos/login/user_manager.cc:1243: delete users; scoped_ptr<>?
8 years, 9 months ago (2012-03-01 10:01:58 UTC) #5
Ivan Korotkov
http://codereview.chromium.org/9405035/diff/17001/chrome/browser/chromeos/login/user_manager.cc File chrome/browser/chromeos/login/user_manager.cc (right): http://codereview.chromium.org/9405035/diff/17001/chrome/browser/chromeos/login/user_manager.cc#newcode557 chrome/browser/chromeos/login/user_manager.cc:557: // Do not update local store if the user ...
8 years, 9 months ago (2012-03-01 13:37:50 UTC) #6
use bartfab instead
Comments addressed. https://chromiumcodereview.appspot.com/9405035/diff/17001/chrome/browser/chromeos/login/user_manager.cc File chrome/browser/chromeos/login/user_manager.cc (right): https://chromiumcodereview.appspot.com/9405035/diff/17001/chrome/browser/chromeos/login/user_manager.cc#newcode557 chrome/browser/chromeos/login/user_manager.cc:557: // Do not update local store if ...
8 years, 9 months ago (2012-03-01 18:33:42 UTC) #7
Ivan Korotkov
https://chromiumcodereview.appspot.com/9405035/diff/17001/chrome/browser/chromeos/login/user_manager.cc File chrome/browser/chromeos/login/user_manager.cc (right): https://chromiumcodereview.appspot.com/9405035/diff/17001/chrome/browser/chromeos/login/user_manager.cc#newcode739 chrome/browser/chromeos/login/user_manager.cc:739: owner_.reset(new std::string); On 2012/03/01 18:33:43, bartfab wrote: > The ...
8 years, 9 months ago (2012-03-01 20:16:30 UTC) #8
rkc
http://codereview.chromium.org/9405035/diff/17001/chrome/browser/chromeos/login/user_manager.cc File chrome/browser/chromeos/login/user_manager.cc (right): http://codereview.chromium.org/9405035/diff/17001/chrome/browser/chromeos/login/user_manager.cc#newcode1201 chrome/browser/chromeos/login/user_manager.cc:1201: const std::string owner_email = *owner_; On 2012/03/01 18:33:43, bartfab ...
8 years, 9 months ago (2012-03-01 22:17:37 UTC) #9
Ivan Korotkov
Another couple of thought. Also: what about the case when browser crashes in the middle ...
8 years, 9 months ago (2012-03-02 12:39:37 UTC) #10
Nikita (slow)
http://codereview.chromium.org/9405035/diff/25001/chrome/browser/chromeos/login/user_manager.cc File chrome/browser/chromeos/login/user_manager.cc (right): http://codereview.chromium.org/9405035/diff/25001/chrome/browser/chromeos/login/user_manager.cc#newcode1163 chrome/browser/chromeos/login/user_manager.cc:1163: // users were enabled, this user should not be ...
8 years, 9 months ago (2012-03-02 12:51:42 UTC) #11
use bartfab instead
All inline comments addressed. Regarding Ivan's question about OAuth: The OAuth handling is not changed ...
8 years, 9 months ago (2012-03-05 18:07:31 UTC) #12
Nikita (slow)
Note that I have 2 big refactoring CLs touching UserManager. Depending on the timing one ...
8 years, 9 months ago (2012-03-06 14:37:58 UTC) #13
use bartfab instead
Having had a quick glance at yours CLs, it looks like they do not change ...
8 years, 9 months ago (2012-03-06 14:43:50 UTC) #14
Nikita (slow)
First CL landed https://src.chromium.org/viewvc/chrome?view=rev&revision=125165
8 years, 9 months ago (2012-03-06 16:28:57 UTC) #15
Ivan Korotkov
LGTM, sorry for a slow review. http://codereview.chromium.org/9405035/diff/17001/chrome/browser/chromeos/login/user_manager.cc File chrome/browser/chromeos/login/user_manager.cc (right): http://codereview.chromium.org/9405035/diff/17001/chrome/browser/chromeos/login/user_manager.cc#newcode987 chrome/browser/chromeos/login/user_manager.cc:987: if (IsEphemeralUser(username)) On ...
8 years, 9 months ago (2012-03-06 20:37:17 UTC) #16
Nikita (slow)
Second CL landed. http://src.chromium.org/viewvc/chrome?view=rev&revision=125230
8 years, 9 months ago (2012-03-06 22:19:47 UTC) #17
Nikita (slow)
http://codereview.chromium.org/9405035/diff/30001/chrome/browser/chromeos/login/user_manager.cc File chrome/browser/chromeos/login/user_manager.cc (right): http://codereview.chromium.org/9405035/diff/30001/chrome/browser/chromeos/login/user_manager.cc#newcode789 chrome/browser/chromeos/login/user_manager.cc:789: owner_email_ = ""; You could always call cros_settings->GetString(kDeviceOwner, &owner_email_); ...
8 years, 9 months ago (2012-03-07 10:03:04 UTC) #18
use bartfab instead
Comments addressed. http://codereview.chromium.org/9405035/diff/30001/chrome/browser/chromeos/login/user_manager.cc File chrome/browser/chromeos/login/user_manager.cc (right): http://codereview.chromium.org/9405035/diff/30001/chrome/browser/chromeos/login/user_manager.cc#newcode789 chrome/browser/chromeos/login/user_manager.cc:789: owner_email_ = ""; On 2012/03/07 10:03:04, Nikita ...
8 years, 9 months ago (2012-03-07 11:10:07 UTC) #19
use bartfab instead
One more comment regarding image selection (or lack thereof) on login: This entire feature was ...
8 years, 9 months ago (2012-03-07 11:26:22 UTC) #20
Nikita (slow)
On 2012/03/07 11:26:22, bartfab wrote: > One more comment regarding image selection (or lack thereof) ...
8 years, 9 months ago (2012-03-10 14:32:51 UTC) #21
use bartfab instead
Hi Nikita, As discussed, I removed initial profile image selection. Users are still able to ...
8 years, 9 months ago (2012-03-12 15:24:44 UTC) #22
Nikita (slow)
lgtm thanks!
8 years, 9 months ago (2012-03-12 17:29:08 UTC) #23
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/bartfab@google.com/9405035/42001
8 years, 9 months ago (2012-03-12 17:34:23 UTC) #24
commit-bot: I haz the power
Change committed as 126198
8 years, 9 months ago (2012-03-12 20:12:35 UTC) #25
Ilya Sherman
This broke compile on Linux Chromium (clang), so was reverted. http://build.chromium.org/p/chromium.chromiumos/builders/Linux%20ChromiumOS%20%28Clang%20dbg%29/builds/9435
8 years, 9 months ago (2012-03-12 20:27:48 UTC) #26
Ilya Sherman
s/Chromium/ChromiumOS
8 years, 9 months ago (2012-03-12 20:28:01 UTC) #27
merkulova
Hi Bartosz! While investigating one bug got question related to this CL. FYI the bug ...
6 years, 8 months ago (2014-04-08 10:34:58 UTC) #28
bartfab (slow)
https://codereview.chromium.org/9405035/diff/42001/chrome/browser/chromeos/login/user_manager_impl.cc File chrome/browser/chromeos/login/user_manager_impl.cc (right): https://codereview.chromium.org/9405035/diff/42001/chrome/browser/chromeos/login/user_manager_impl.cc#newcode775 chrome/browser/chromeos/login/user_manager_impl.cc:775: owner_email_ = ""; On 2014/04/08 10:34:59, merkulova wrote: > ...
6 years, 8 months ago (2014-04-14 11:36:41 UTC) #29
Nikita (slow)
On 2014/04/14 11:36:41, bartfab wrote: > https://codereview.chromium.org/9405035/diff/42001/chrome/browser/chromeos/login/user_manager_impl.cc > File chrome/browser/chromeos/login/user_manager_impl.cc (right): > > https://codereview.chromium.org/9405035/diff/42001/chrome/browser/chromeos/login/user_manager_impl.cc#newcode775 > ...
6 years, 8 months ago (2014-04-14 11:56:05 UTC) #30
Nikita (slow)
On 2014/04/14 11:56:05, Nikita Kostylev wrote: > Otherwise we now have a situation when you ...
6 years, 8 months ago (2014-04-14 11:56:56 UTC) #31
bartfab (slow)
On 2014/04/14 11:56:56, Nikita Kostylev wrote: > On 2014/04/14 11:56:05, Nikita Kostylev wrote: > > ...
6 years, 8 months ago (2014-04-14 12:05:56 UTC) #32
bartfab (slow)
On 2014/04/14 11:56:05, Nikita Kostylev wrote: > On 2014/04/14 11:36:41, bartfab wrote: > > > ...
6 years, 8 months ago (2014-04-14 12:08:04 UTC) #33
Nikita (slow)
On 2014/04/14 12:05:56, bartfab wrote: > On 2014/04/14 11:56:56, Nikita Kostylev wrote: > > On ...
6 years, 8 months ago (2014-04-14 16:57:58 UTC) #34
Nikita (slow)
On 2014/04/14 12:08:04, bartfab wrote: > On 2014/04/14 11:56:05, Nikita Kostylev wrote: > > On ...
6 years, 8 months ago (2014-04-14 17:00:42 UTC) #35
bartfab (slow)
On 2014/04/14 17:00:42, Nikita Kostylev wrote: > On 2014/04/14 12:08:04, bartfab wrote: > > On ...
6 years, 8 months ago (2014-04-15 13:52:15 UTC) #36
Nikita (slow)
On 2014/04/15 13:52:15, bartfab wrote: > I talked to Julian who implemented the signature checking ...
6 years, 8 months ago (2014-04-15 14:46:53 UTC) #37
bartfab (slow)
On 2014/04/15 14:46:53, Nikita Kostylev wrote: > On 2014/04/15 13:52:15, bartfab wrote: > > I ...
6 years, 8 months ago (2014-04-15 14:59:46 UTC) #38
Nikita (slow)
6 years, 8 months ago (2014-04-16 15:17:41 UTC) #39
Message was sent while issue was closed.
On 2014/04/15 14:59:46, bartfab wrote:
> On 2014/04/15 14:46:53, Nikita Kostylev wrote:
> > On 2014/04/15 13:52:15, bartfab wrote:
> > > I talked to Julian who implemented the signature checking back in the day.
> > > Originally, the trusted status could never go from "permanently untrusted"
> to
> > > "trusted". Something regressed at some point and this is possible now.
That
> > > regression is part of what is making things complicated.
> > 
> > I don't think this was the case that we've seen here.
> 
> The status is always allowed to go from trusted to temporarily untrusted and
> back. This is probably what you are observing. That is all within spec. It
means
> that trusted value may be inaccessible for some amount of time though, which
> makes it necessary to either cache it or to wait for the callback that trusted
> values are available again.
> 
> > 
> > > 
> > > I agree that purely for display purposes,
> > > cros_settings_->GetString(kDeviceOwner, &owner_email) without any
signature
> > > checks should be fine. But the owner_email_ here is used for other things
as
> > > well, where having an untrusted value is a bad idea.
> > 
> > Even for an owner value? As we know once set it is not changed.
> 
> Actually, the consumer management team is planning to add some kind of
ownership
> transfer and unenrollment/re-enrollment. I think it is safer to only ever
access
> signed CrosSettings to stay on the safe side.

But what I'm trying to say here is that there was a bug:

0. UserManager was subscribed to monitor supervised users enabled pref updates.
1. In consumer mode when owner unchecked this checkbox
1.1 UserManager::ReloadDevicePolicies is called
1.2 owner_email_ is reset
1.3 Settings are in process of signing in 
1.4 chrome://settings handler got called and checks whether current user is
owner (he still is!) by
ProfileHelper::IsOwnerProfile() which callse UserManager::GetOwnerEmail()
So this returns empty string, current user is not considered as being an owner
(!)
1.5 Supervised users enabled preference checkbox goes into permanent "grayed
out" state

So the fix was that UserManager is no longer subscribed to supervised users
enabled pref (there's no real need).
https://codereview.chromium.org/228553002/

We've saw that originally ReloadDevicePolicies was called from UserManager ctor
so setting owner_email_ to empty string was fine.

Then later every observer of different device settings in UserManager started to
call ReloadDevicePolicies so this resulted in a side effects as I've described
above.

So while I understand that in the future owner_email_ could be reset to empty
string that's not the case now and it brings a real bugs.

Powered by Google App Engine
This is Rietveld 408576698