@@ -2574,13 +2574,19 @@ check_authmethod_valid(const char *authmethod, const char **valid_methods, const
25742574}
25752575
25762576static void
2577- check_need_password (const char * authmethod )
2577+ check_need_password (const char * authmethodlocal , const char * authmethodhost )
25782578{
2579- if ((strcmp (authmethod ,"md5" )== 0 ||
2580- strcmp (authmethod ,"password" )== 0 )&&
2579+ if ((strcmp (authmethodlocal ,"md5" )== 0 ||
2580+ strcmp (authmethodlocal ,"password" )== 0 )&&
2581+ (strcmp (authmethodhost ,"md5" )== 0 ||
2582+ strcmp (authmethodhost ,"password" )== 0 )&&
25812583!(pwprompt || pwfilename ))
25822584{
2583- fprintf (stderr ,_ ("%s: must specify a password for the superuser to enable %s authentication\n" ),progname ,authmethod );
2585+ fprintf (stderr ,_ ("%s: must specify a password for the superuser to enable %s authentication\n" ),progname ,
2586+ (strcmp (authmethodlocal ,"md5" )== 0 ||
2587+ strcmp (authmethodlocal ,"password" )== 0 )
2588+ ?authmethodlocal
2589+ :authmethodhost );
25842590exit (1 );
25852591}
25862592}
@@ -2792,8 +2798,7 @@ main(int argc, char *argv[])
27922798check_authmethod_valid (authmethodlocal ,auth_methods_local ,"local" );
27932799check_authmethod_valid (authmethodhost ,auth_methods_host ,"host" );
27942800
2795- check_need_password (authmethodlocal );
2796- check_need_password (authmethodhost );
2801+ check_need_password (authmethodlocal ,authmethodhost );
27972802
27982803if (strlen (pg_data )== 0 )
27992804{