mirror of
https://github.com/postgres/postgres.git
synced 2025-07-28 23:42:10 +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:
@ -904,7 +904,7 @@ current_windows_user(const char **acct, const char **dom)
|
||||
if (!GetTokenInformation(token, TokenUser, NULL, 0, &retlen) && GetLastError() != 122)
|
||||
{
|
||||
fprintf(stderr,
|
||||
_("%s: could not get token user size: error code %lu\n"),
|
||||
_("%s: could not get token information buffer size: error code %lu\n"),
|
||||
progname, GetLastError());
|
||||
exit(2);
|
||||
}
|
||||
@ -912,7 +912,7 @@ current_windows_user(const char **acct, const char **dom)
|
||||
if (!GetTokenInformation(token, TokenUser, tokenuser, retlen, &retlen))
|
||||
{
|
||||
fprintf(stderr,
|
||||
_("%s: could not get token user: error code %lu\n"),
|
||||
_("%s: could not get token information: error code %lu\n"),
|
||||
progname, GetLastError());
|
||||
exit(2);
|
||||
}
|
||||
|
Reference in New Issue
Block a user