cryptohome: Detect initial enterprise enrollment

Initial enterprise enrollment will trigger InstallAttributesFinalize(), so
we take the chance to detect enterprise ownership, so that guest mounts
will work correctly.

BUG=b:171882773
TEST=Enterprise enroll then do ephemeral mount without reboot

Change-Id: If4ed82b7abb7d4109f138f4249db230bd5e6cf2e
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform2/+/2555358
Tested-by: John L Chen <zuan@chromium.org>
Reviewed-by: Leo Lai <cylai@google.com>
Commit-Queue: John L Chen <zuan@chromium.org>
diff --git a/cryptohome/userdataauth.cc b/cryptohome/userdataauth.cc
index 9499592..6b770ac 100644
--- a/cryptohome/userdataauth.cc
+++ b/cryptohome/userdataauth.cc
@@ -2746,7 +2746,9 @@
 
 bool UserDataAuth::InstallAttributesFinalize() {
   AssertOnMountThread();
-  return install_attrs_->Finalize();
+  bool result = install_attrs_->Finalize();
+  DetectEnterpriseOwnership();
+  return result;
 }
 
 int UserDataAuth::InstallAttributesCount() {