Two round for Client Authentication

From: Yinjie Lin <exialin37(at)gmail(dot)com>
To: pgsql-hackers(at)postgresql(dot)org
Subject: Two round for Client Authentication
Date: 2018-06-14 04:12:16
Message-ID: CA+zFF0dy3Z8SA2f=ZghAiGT_DjK0eeG7H8xZegORxvbbxerH5Q@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hello everyone.

I am a newcomer to PostgreSQL, and I don't know if it is proper to post my
question here, but I really need some help.

Currently I am reading and testing code about Client Authentication, but I
find that there are two progresses forked if I login using psql, while only
one progress is forked if using pgAdmin.

My pg_hba.conf is as follows:
local all all md5
host all all 192.168.64.56/32 md5

If I login with psql, the following stack is called twice:
ServerLoop
BackendStartup
BackendRun
PostgresMain
InitPostgres
PerformAuthentication
ClientAuthentication

In the first round, the variable `status` in function
ClientAuthentication() is always STATUS_EOF (at least in my test). In the
second round, `status` seems to be what should be expected: STATUS_OK for
correct password, STATUS_ERROR for wrong password, and STATUS_EOF for empty
password.

Why are there two such progresses forked? I think one round should be
enough, like when using pgAdmin.

Besides, I find it hard to debug the ServerLoop() stack, compared with the
backend progress for query, because there are two many subprogresses and
signals. It would be of great help if anyone could give me some
instructions on how to learn to debug postmaster using gdb.

Thanks in advance!

Best Regards

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Amit Langote 2018-06-14 04:12:31 Re: Partitioning with temp tables is broken
Previous Message Amit Kapila 2018-06-14 03:45:53 Re: WAL prefetch