The following revision refers to this bug:
https://chromium.googlesource.com/chromium/src.git/+/aca071875a78e7c4169662284d483e44a2eca9a4
commit aca071875a78e7c4169662284d483e44a2eca9a4
Author: Raphael Kubo da Costa <raphael.kubo.da.costa@intel.com>
Date: Thu Apr 05 09:01:46 2018
cloud_policy_util: IWYU: HOST_NAME_MAX needs limits.h.
Stop relying on the header being included implicitly. This fixes the build
with libstdc++ after b1303e036 ("Add support in CloudPolicyClient for
machine enrollment and reporting"):
../../components/policy/core/common/cloud/cloud_policy_util.cc: In function ‘std::__cxx11::string policy::GetMachineName()’:
../../components/policy/core/common/cloud/cloud_policy_util.cc:33:17: error: ‘HOST_NAME_MAX’ was not declared in this scope
char hostname[HOST_NAME_MAX];
^~~~~~~~~~~~~
../../components/policy/core/common/cloud/cloud_policy_util.cc:33:17: note: suggested alternative: ‘_SC_HOST_NAME_MAX’
char hostname[HOST_NAME_MAX];
^~~~~~~~~~~~~
_SC_HOST_NAME_MAX
../../components/policy/core/common/cloud/cloud_policy_util.cc:34:19: error: ‘hostname’ was not declared in this scope
if (gethostname(hostname, HOST_NAME_MAX) == 0) // Success.
^~~~~~~~
../../components/policy/core/common/cloud/cloud_policy_util.cc:34:19: note: suggested alternative: ‘basename’
if (gethostname(hostname, HOST_NAME_MAX) == 0) // Success.
^~~~~~~~
basename
While HOST_NAME_MAX is only used in the Linux code path, it should be
harmless to include the header unconditionally.
BUG=812641
Change-Id: I6769792efe188ff437753e4cb1ba134c341c20e9
Reviewed-on: https://chromium-review.googlesource.com/987895
Reviewed-by: Maksim Ivanov <emaxx@chromium.org>
Commit-Queue: Raphael Kubo da Costa <raphael.kubo.da.costa@intel.com>
Cr-Commit-Position: refs/heads/master@{#548370}
[modify] https://crrev.com/aca071875a78e7c4169662284d483e44a2eca9a4/components/policy/core/common/cloud/cloud_policy_util.cc
The following revision refers to this bug:
https://chromium.googlesource.com/chromium/src.git/+/eb49ccc013d304921d419249b955a0bf03905ca6
commit eb49ccc013d304921d419249b955a0bf03905ca6
Author: Greg Thompson <grt@chromium.org>
Date: Wed May 16 15:40:31 2018
Logging tweaks for enrollment token retrieval.
This change suppresses error logging when the Policies key does not
exist, as this is an acceptable (and expected) condition.
This CL also:
- Changes from requesting KEY_READ to KEY_QUERY_VALUE rights when
opening the Policies key (principle of least privilege).
- Removes some misleading wording in the emitted error messages (the
call to Open() does not result in the creation of a key, and the call
to ReadValue() does not write anything).
- Switches to a combination of SetLastError and PLOG so that the log
messages contain a human-readable error code.
- Shortens the error messages -- the reader can inspect the code given
the emitted file+line info if needed.
- Removes an early-exit path, as RegKey::ReadValue is documented as not
modifying its out param in case of error.
BUG=812641,840369
R=rogerta@chromium.org
Change-Id: I8990f85a4595b5356196e24167738222653846d2
Reviewed-on: https://chromium-review.googlesource.com/1060058
Reviewed-by: Roger Tawa <rogerta@chromium.org>
Commit-Queue: Greg Thompson <grt@chromium.org>
Cr-Commit-Position: refs/heads/master@{#559116}
[modify] https://crrev.com/eb49ccc013d304921d419249b955a0bf03905ca6/chrome/installer/util/install_util.cc
Comment 1 by bugdroid1@chromium.org
, Feb 22 2018