mirror of
https://github.com/postgres/postgres.git
synced 2025-07-03 20:02:46 +03:00
Fix incorrect error message reported for non-existent users
Previously, lookups of non-existent user names could return "Success"; it will now return "User does not exist" by resetting errno. This also centralizes the user name lookup code in libpgport. Report and analysis by Nicolas Marchildon; patch by me
This commit is contained in:
@ -160,7 +160,7 @@ main(int argc, char *argv[])
|
||||
else if (getenv("PGUSER"))
|
||||
dbname = getenv("PGUSER");
|
||||
else
|
||||
dbname = get_user_name(progname);
|
||||
dbname = get_user_name_or_exit(progname);
|
||||
}
|
||||
|
||||
if (tables.head != NULL)
|
||||
|
Reference in New Issue
Block a user