mirror of
https://github.com/postgres/postgres.git
synced 2025-08-19 23:22:23 +03:00
Standardize GetTokenInformation() error reporting.
Commit c22650cd64
sparked a discussion
about diverse interpretations of "token user" in error messages. Expel
old and new specimens of that phrase by making all GetTokenInformation()
callers report errors the way GetTokenUser() has been reporting them.
These error conditions almost can't happen, so users are unlikely to
observe this change.
Reviewed by Tom Lane and Stephen Frost.
This commit is contained in:
@@ -248,14 +248,14 @@ pgwin32_get_dynamic_tokeninfo(HANDLE token, TOKEN_INFORMATION_CLASS class,
|
||||
if (GetTokenInformation(token, class, NULL, 0, &InfoBufferSize))
|
||||
{
|
||||
snprintf(errbuf, errsize,
|
||||
"could not get token information: got zero size\n");
|
||||
"could not get token information buffer size: got zero size\n");
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
if (GetLastError() != ERROR_INSUFFICIENT_BUFFER)
|
||||
{
|
||||
snprintf(errbuf, errsize,
|
||||
"could not get token information: error code %lu\n",
|
||||
"could not get token information buffer size: error code %lu\n",
|
||||
GetLastError());
|
||||
return FALSE;
|
||||
}
|
||||
|
Reference in New Issue
Block a user