OLD | NEW |
1 // Copyright (c) 2014 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2014 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 "components/policy/core/common/policy_loader_win.h" | 5 #include "components/policy/core/common/policy_loader_win.h" |
6 | 6 |
7 #include <windows.h> | 7 #include <windows.h> |
8 #include <lm.h> // For limits. | 8 #include <lm.h> // For limits. |
9 #include <ntdsapi.h> // For Ds[Un]Bind | 9 #include <ntdsapi.h> // For Ds[Un]Bind |
10 #include <rpc.h> // For struct GUID | 10 #include <rpc.h> // For struct GUID |
(...skipping 443 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
454 // the FILE thread on which this code runs in steady state. Given that | 454 // the FILE thread on which this code runs in steady state. Given that |
455 // there have never been any reports of issues due to partially-applied / | 455 // there have never been any reports of issues due to partially-applied / |
456 // corrupt group policy, this code intentionally omits the | 456 // corrupt group policy, this code intentionally omits the |
457 // EnterCriticalPolicySection() call. | 457 // EnterCriticalPolicySection() call. |
458 // | 458 // |
459 // If there's ever reason to revisit this decision, one option could be to | 459 // If there's ever reason to revisit this decision, one option could be to |
460 // make the EnterCriticalPolicySection() call on a dedicated thread and | 460 // make the EnterCriticalPolicySection() call on a dedicated thread and |
461 // timeout on it more aggressively. For now, there's no justification for | 461 // timeout on it more aggressively. For now, there's no justification for |
462 // the additional effort this would introduce. | 462 // the additional effort this would introduce. |
463 | 463 |
464 if (is_enterprise || !ReadPolicyFromGPO(scope, &gpo_dict, &status)) { | 464 bool is_registry_forced = is_enterprise || gpo_provider_ == nullptr; |
465 VLOG_IF(1, !is_enterprise) << "Failed to read GPO files for " << scope | 465 if (is_registry_forced || !ReadPolicyFromGPO(scope, &gpo_dict, &status)) { |
466 << " falling back to registry."; | 466 VLOG_IF(1, !is_registry_forced) << "Failed to read GPO files for " |
| 467 << scope << " falling back to registry."; |
467 gpo_dict.ReadRegistry(kScopes[i].hive, chrome_policy_key_); | 468 gpo_dict.ReadRegistry(kScopes[i].hive, chrome_policy_key_); |
468 } | 469 } |
469 | 470 |
470 // Remove special-cased entries from the GPO dictionary. | 471 // Remove special-cased entries from the GPO dictionary. |
471 scoped_ptr<RegistryDict> recommended_dict( | 472 scoped_ptr<RegistryDict> recommended_dict( |
472 gpo_dict.RemoveKey(kKeyRecommended)); | 473 gpo_dict.RemoveKey(kKeyRecommended)); |
473 scoped_ptr<RegistryDict> third_party_dict( | 474 scoped_ptr<RegistryDict> third_party_dict( |
474 gpo_dict.RemoveKey(kKeyThirdParty)); | 475 gpo_dict.RemoveKey(kKeyThirdParty)); |
475 | 476 |
476 // Load Chrome policy. | 477 // Load Chrome policy. |
(...skipping 210 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
687 "418183 PolicyLoaderWin::OnObjectSignaled")); | 688 "418183 PolicyLoaderWin::OnObjectSignaled")); |
688 | 689 |
689 DCHECK(object == user_policy_changed_event_.handle() || | 690 DCHECK(object == user_policy_changed_event_.handle() || |
690 object == machine_policy_changed_event_.handle()) | 691 object == machine_policy_changed_event_.handle()) |
691 << "unexpected object signaled policy reload, obj = " | 692 << "unexpected object signaled policy reload, obj = " |
692 << std::showbase << std::hex << object; | 693 << std::showbase << std::hex << object; |
693 Reload(false); | 694 Reload(false); |
694 } | 695 } |
695 | 696 |
696 } // namespace policy | 697 } // namespace policy |
OLD | NEW |