Revert "Add validations of wd_lifecheck_password and recovery_password format"
authorTatsuo Ishii <ishii@sraoss.co.jp>
Sat, 11 Dec 2021 00:41:42 +0000 (09:41 +0900)
committerTatsuo Ishii <ishii@sraoss.co.jp>
Sat, 11 Dec 2021 00:41:42 +0000 (09:41 +0900)
This reverts commit 1a3516908dbb6cf0b1eb07493fb2d95544a38a84.

This commit caused failure in regression test due to pcp_recovery_node_error:
recovery node 1...ERROR:  invalid password format for recovery_user: t-ishii
DETAIL:  md5 hashed password is not allowed here

src/auth/pool_passwd.c
src/include/auth/pool_passwd.h
src/pcp_con/recovery.c
src/watchdog/wd_lifecheck.c

index 0d2eb0699a2949f16133bbeac1b40b815ad227bf..791b66b8d6e2a6b62624afe5fd727564ede07f06 100644 (file)
@@ -678,44 +678,3 @@ read_pool_key(char *key_file_path)
 
 #undef LINELEN
 }
-
-/*
- * Check password type is md5 hashed or not. recovery_password and
- * wd_lifecheck_password are not allowed to be md5 hashed format.
- * The kind of returns of this function is follow;
- *  0: password is not md5 hashed
- * -1: password is md5 hashed
- * -2: password is not found
- */
-int
-chceck_password_type_is_not_md5(char *username, char *password_in_config)
-{
-       PasswordType passwordType = PASSWORD_TYPE_UNKNOWN;
-       PasswordMapping *password_mapping = NULL;
-
-       /*
-        * if the password specified in config is empty string or NULL look for the
-        * password in pool_passwd file
-        */
-       if (password_in_config == NULL || strlen(password_in_config) == 0)
-       {
-               password_mapping = pool_get_user_credentials(username);
-               if (password_mapping == NULL)
-               {
-                       return -2;
-               }
-               passwordType = password_mapping->pgpoolUser.passwordType;
-       }
-       else
-       {
-               passwordType = get_password_type(password_in_config);
-       }
-
-       /* if the password type is MD5 hash return -1*/
-       if (passwordType == PASSWORD_TYPE_MD5)
-       {
-               return -1;
-       }
-
-       return 0;
-}
\ No newline at end of file
index 9ec244b31afcada6e91b6f7770a27ed51f2fb512..bbcaaa8100fb8c407fae1b6d7176f13e3deff4cc 100644 (file)
@@ -85,5 +85,4 @@ extern char *get_decrypted_password(const char *shadow_pass);
 extern char *read_pool_key(char *key_file_path);
 extern char *get_pgpool_config_user_password(char *username, char *password_in_config);
 extern void delete_passwordMapping(PasswordMapping * pwdMapping);
-extern int chceck_password_type_is_not_md5(char *username, char *password_in_config);
 #endif                                                 /* POOL_PASSWD_H */
index 6a04706b4bd7c5f4f39676d59e0da0c95535b0c0..db9aef31f34b96a859e31691e5e9eebab28bd001 100644 (file)
@@ -81,14 +81,6 @@ start_recovery(int recovery_node)
                ereport(ERROR,
                                (errmsg("node recovery failed, node id: %d is alive", recovery_node)));
 
-       if (chceck_password_type_is_not_md5(pool_config->recovery_user, pool_config->recovery_password) == -1)
-       {
-               ereport(ERROR,
-                               (errmsg("invalid password format for recovery_user: %s",
-                                               pool_config->recovery_user),
-                               errdetail("md5 hashed password is not allowed here")));
-       }
-
        /* select master/primary node */
        node_id = MASTER_SLAVE ? PRIMARY_NODE_ID : REAL_MASTER_NODE_ID;
        backend = &pool_config->backend_desc->backend_info[node_id];
index 3057086428ec960c089d4699ac84ecccc546411b..e5e1676dc0ee5fad76753ef1e045dde6630fdcf1 100644 (file)
@@ -387,14 +387,6 @@ lifecheck_main(void)
        /* Identify myself via ps */
        init_ps_display("", "", "", "");
 
-       if (chceck_password_type_is_not_md5(pool_config->wd_lifecheck_user, pool_config->wd_lifecheck_password) == -1)
-       {
-               ereport(ERROR,
-                               (errmsg("invalid password format for wd_lifecheck_user: %s",
-                                               pool_config->recovery_user),
-                               errdetail("md5 hashed password is not allowed here")));
-       }
-
        pool_signal(SIGTERM, lifecheck_exit_handler);
        pool_signal(SIGINT, lifecheck_exit_handler);
        pool_signal(SIGQUIT, lifecheck_exit_handler);