pgsql: Remove the use of the pg_auth flat file for client

From: tgl(at)postgresql(dot)org (Tom Lane)
To: pgsql-committers(at)postgresql(dot)org
Subject: pgsql: Remove the use of the pg_auth flat file for client
Date: 2009-08-29 19:26:52
Message-ID: 20090829192652.3452475331E@cvs.postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-committers

Log Message:
-----------
Remove the use of the pg_auth flat file for client authentication.
(That flat file is now completely useless, but removal will come later.)

To do this, postpone client authentication into the startup transaction
that's run by InitPostgres. We still collect the startup packet and do
SSL initialization (if needed) at the same time we did before. The
AuthenticationTimeout is applied separately to startup packet collection
and the actual authentication cycle. (This is a bit annoying, since it
means a couple extra syscalls; but the signal handling requirements inside
and outside a transaction are sufficiently different that it seems best
to treat the timeouts as completely independent.)

A small security disadvantage is that if the given database name is invalid,
this will be reported to the client before any authentication happens.
We could work around that by connecting to database "postgres" instead,
but consensus seems to be that it's not worth introducing such surprising
behavior.

Processing of all command-line switches and GUC options received from the
client is now postponed until after authentication. This means that
PostAuthDelay is much less useful than it used to be --- if you need to
investigate problems during InitPostgres you'll have to set PreAuthDelay
instead. However, allowing an unauthenticated user to set any GUC options
whatever seems a bit too risky, so we'll live with that.

Modified Files:
--------------
pgsql/src/backend/libpq:
auth.c (r1.183 -> r1.184)
(http://anoncvs.postgresql.org/cvsweb.cgi/pgsql/src/backend/libpq/auth.c?r1=1.183&r2=1.184)
crypt.c (r1.77 -> r1.78)
(http://anoncvs.postgresql.org/cvsweb.cgi/pgsql/src/backend/libpq/crypt.c?r1=1.77&r2=1.78)
hba.c (r1.188 -> r1.189)
(http://anoncvs.postgresql.org/cvsweb.cgi/pgsql/src/backend/libpq/hba.c?r1=1.188&r2=1.189)
pqsignal.c (r1.45 -> r1.46)
(http://anoncvs.postgresql.org/cvsweb.cgi/pgsql/src/backend/libpq/pqsignal.c?r1=1.45&r2=1.46)
pgsql/src/backend/postmaster:
postmaster.c (r1.592 -> r1.593)
(http://anoncvs.postgresql.org/cvsweb.cgi/pgsql/src/backend/postmaster/postmaster.c?r1=1.592&r2=1.593)
pgsql/src/backend/tcop:
postgres.c (r1.570 -> r1.571)
(http://anoncvs.postgresql.org/cvsweb.cgi/pgsql/src/backend/tcop/postgres.c?r1=1.570&r2=1.571)
pgsql/src/backend/utils/init:
flatfiles.c (r1.37 -> r1.38)
(http://anoncvs.postgresql.org/cvsweb.cgi/pgsql/src/backend/utils/init/flatfiles.c?r1=1.37&r2=1.38)
postinit.c (r1.194 -> r1.195)
(http://anoncvs.postgresql.org/cvsweb.cgi/pgsql/src/backend/utils/init/postinit.c?r1=1.194&r2=1.195)
pgsql/src/backend/utils/misc:
guc.c (r1.511 -> r1.512)
(http://anoncvs.postgresql.org/cvsweb.cgi/pgsql/src/backend/utils/misc/guc.c?r1=1.511&r2=1.512)
pgsql/src/include/libpq:
hba.h (r1.56 -> r1.57)
(http://anoncvs.postgresql.org/cvsweb.cgi/pgsql/src/include/libpq/hba.h?r1=1.56&r2=1.57)
pqsignal.h (r1.33 -> r1.34)
(http://anoncvs.postgresql.org/cvsweb.cgi/pgsql/src/include/libpq/pqsignal.h?r1=1.33&r2=1.34)
pgsql/src/include:
miscadmin.h (r1.212 -> r1.213)
(http://anoncvs.postgresql.org/cvsweb.cgi/pgsql/src/include/miscadmin.h?r1=1.212&r2=1.213)
pgsql/src/include/storage:
pmsignal.h (r1.25 -> r1.26)
(http://anoncvs.postgresql.org/cvsweb.cgi/pgsql/src/include/storage/pmsignal.h?r1=1.25&r2=1.26)
pgsql/src/include/tcop:
tcopprot.h (r1.98 -> r1.99)
(http://anoncvs.postgresql.org/cvsweb.cgi/pgsql/src/include/tcop/tcopprot.h?r1=1.98&r2=1.99)
pgsql/src/include/utils:
guc.h (r1.102 -> r1.103)
(http://anoncvs.postgresql.org/cvsweb.cgi/pgsql/src/include/utils/guc.h?r1=1.102&r2=1.103)

Browse pgsql-committers by date

  From Date Subject
Next Message Tom Lane 2009-08-30 16:53:31 pgsql: Remove duplicate variable initializations identified by clang
Previous Message Bruce Momjian 2009-08-29 17:09:20 pgsql: Remove handling of CVS entries for TODO/FAQ, because they are