From 383d06e0575ea168b59964a23310651abbcb3850 Mon Sep 17 00:00:00 2001 From: Bo Peng Date: Tue, 14 Aug 2018 22:43:49 +0900 Subject: [PATCH] Improve pg_md5 docs and error message. Patch provided by Jesper Pedersen and modified by me. --- doc.ja/src/sgml/ref/pg_md5.sgml | 41 ++++++++++++++++++++++++++++----- doc/src/sgml/ref/pg_md5.sgml | 32 +++++++++++++++++++++---- src/tools/pgmd5/pg_md5.c | 2 +- 3 files changed, 63 insertions(+), 12 deletions(-) diff --git a/doc.ja/src/sgml/ref/pg_md5.sgml b/doc.ja/src/sgml/ref/pg_md5.sgml index 2c9ae6b86..ceebe39b8 100644 --- a/doc.ja/src/sgml/ref/pg_md5.sgml +++ b/doc.ja/src/sgml/ref/pg_md5.sgml @@ -79,7 +79,7 @@ Pgpool-II documentation - md5 認証パスワードを生成します。 + pool_passwd 認証ファイルに md5 認証パスワードを生成します。 @@ -97,6 +97,19 @@ Pgpool-II documentation + + + + + + + 設定ファイル pgpool.confへのパスを指定します。 + + + + @@ -108,11 +121,11 @@ Pgpool-II documentation 例 - ここでは例を示します。 + 以下は pcp.conf に登録する md5 暗号化されたパスワードを生成する例です。 -pg_md5 -p +$ pg_md5 -p password: [your password] @@ -120,9 +133,25 @@ password: [your password] または -./pg_md5 foo +$ pg_md5 [your password] acbd18db4cc2f85cedef654fccc4a4d8 - + + + また、pg_md5 は、 に + ユーザー名とmd5 暗号化されたパスワードのエントリを生成するためにも使用できます。 + +$pg_md5 -m -f /path/to/pgpool.conf -u username -p +password: [your password] + +$ cat /path/to/pool_passwd +username:md55a231fcdb710d73268c4f44283487ba2 + + + diff --git a/doc/src/sgml/ref/pg_md5.sgml b/doc/src/sgml/ref/pg_md5.sgml index e3cf324c7..5b1050275 100644 --- a/doc/src/sgml/ref/pg_md5.sgml +++ b/doc/src/sgml/ref/pg_md5.sgml @@ -61,7 +61,7 @@ Pgpool-II documentation - Produce md5 authentication password. + Produce md5 authentication password to authentication file pool_passwd. @@ -76,6 +76,16 @@ Pgpool-II documentation + + + + + + Specify the path to the pgpool.conf configuration file. + + + + @@ -83,9 +93,9 @@ Pgpool-II documentation Example - Here is an example output: + The following are examples to encrypt your password into md5 hash format for pcp.conf. -pg_md5 -p +$ pg_md5 -p password: [your password] @@ -93,9 +103,21 @@ password: [your password] or -./pg_md5 foo +$ pg_md5 [your password] acbd18db4cc2f85cedef654fccc4a4d8 - + + pg_md5 can also be used for adding an entry of user name and + md5 encrypted password to + authentication file. + +$pg_md5 -m -f /path/to/pgpool.conf -u username -p +password: [your password] + +$ cat /path/to/pool_passwd +username:md55a231fcdb710d73268c4f44283487ba2 + + + diff --git a/src/tools/pgmd5/pg_md5.c b/src/tools/pgmd5/pg_md5.c index a2809ff8e..7c123ba4d 100644 --- a/src/tools/pgmd5/pg_md5.c +++ b/src/tools/pgmd5/pg_md5.c @@ -203,7 +203,7 @@ static void update_pool_passwd(char *conf_file, char *username, char *password) } if (pool_get_config(conf_file, CFGCXT_RELOAD) == false) { - fprintf(stderr, "Unable to get configuration. Exiting..."); + fprintf(stderr, "Unable to get configuration. Exiting...\n\n"); exit(EXIT_FAILURE); } -- 2.39.5