mirror of
https://github.com/postgres/postgres.git
synced 2026-02-18 18:25:17 -05:00
Give a proper error message if initdb password file is empty.
Used to say just "could not read password from file "...": Success", which isn't very informative. Mats Erik Andersson. Backpatch to all supported versions.
This commit is contained in:
parent
e6550626ca
commit
d67be559ed
1 changed files with 6 additions and 2 deletions
|
|
@ -1430,8 +1430,12 @@ get_set_pwd(void)
|
|||
}
|
||||
if (!fgets(pwdbuf, sizeof(pwdbuf), pwf))
|
||||
{
|
||||
fprintf(stderr, _("%s: could not read password from file \"%s\": %s\n"),
|
||||
progname, pwfilename, strerror(errno));
|
||||
if (ferror(pwf))
|
||||
fprintf(stderr, _("%s: could not read password from file \"%s\": %s\n"),
|
||||
progname, pwfilename, strerror(errno));
|
||||
else
|
||||
fprintf(stderr, _("%s: password file \"%s\" is empty\n"),
|
||||
progname, pwfilename);
|
||||
exit_nicely();
|
||||
}
|
||||
fclose(pwf);
|
||||
|
|
|
|||
Loading…
Reference in a new issue