Fix typo in initdb's SCRAM password processing.
authorTom Lane <[email protected]>
Sun, 12 Mar 2017 19:57:03 +0000 (15:57 -0400)
committerTom Lane <[email protected]>
Sun, 12 Mar 2017 19:57:03 +0000 (15:57 -0400)
Noted by Coverity (a rather impressive catch).

Michael Paquier

src/bin/initdb/initdb.c

index 3f836efc20fcaa458fc13d25e38b8edfc4cebad3..da113bd2635d89fb71f509039208f7c6700da493 100644 (file)
@@ -2331,7 +2331,7 @@ check_need_password(const char *authmethodlocal, const char *authmethodhost)
         strcmp(authmethodlocal, "scram") == 0) &&
        (strcmp(authmethodhost, "md5") == 0 ||
         strcmp(authmethodhost, "password") == 0 ||
-        strcmp(authmethodlocal, "scram") == 0) &&
+        strcmp(authmethodhost, "scram") == 0) &&
        !(pwprompt || pwfilename))
    {
        fprintf(stderr, _("%s: must specify a password for the superuser to enable %s authentication\n"), progname,