Commit f35abe10 authored by Tien Mai's avatar Tien Mai Committed by Commit Bot

[GCPW] Fix invalid GCPW association information not being cleaned.

The function FindUserBySID was not returning a successful result
when it is passed no username or domain to fill even though the
user was found.

Bug: 933850
Change-Id: I97c9e208ea85695b94651029aac4c58b551beaa6
Reviewed-on: https://chromium-review.googlesource.com/c/1479091
Auto-Submit: Tien Mai <tienmai@chromium.org>
Commit-Queue: Roger Tawa <rogerta@chromium.org>
Reviewed-by: default avatarRoger Tawa <rogerta@chromium.org>
Cr-Commit-Position: refs/heads/master@{#633834}
parent 608a299e
...@@ -422,9 +422,9 @@ HRESULT OSUserManager::FindUserBySID(const wchar_t* sid, ...@@ -422,9 +422,9 @@ HRESULT OSUserManager::FindUserBySID(const wchar_t* sid,
local_domain_buffer, &domain_length, &use)) { local_domain_buffer, &domain_length, &use)) {
hr = HRESULT_FROM_WIN32(::GetLastError()); hr = HRESULT_FROM_WIN32(::GetLastError());
if (hr != HRESULT_FROM_WIN32(ERROR_NONE_MAPPED)) { if (hr != HRESULT_FROM_WIN32(ERROR_NONE_MAPPED)) {
if (hr == HRESULT_FROM_WIN32(ERROR_INSUFFICIENT_BUFFER)) { if (username_size == 0 &&
if ((username_size > 0 && name_length >= username_size)) hr == HRESULT_FROM_WIN32(ERROR_INSUFFICIENT_BUFFER)) {
hr = S_OK; hr = S_OK;
} }
} }
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment