Skip site navigation (1) Skip section navigation (2)

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: (view raw, whole thread or download thread mbox)
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

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:
        auth.c (r1.183 -> r1.184)
        crypt.c (r1.77 -> r1.78)
        hba.c (r1.188 -> r1.189)
        pqsignal.c (r1.45 -> r1.46)
        postmaster.c (r1.592 -> r1.593)
        postgres.c (r1.570 -> r1.571)
        flatfiles.c (r1.37 -> r1.38)
        postinit.c (r1.194 -> r1.195)
        guc.c (r1.511 -> r1.512)
        hba.h (r1.56 -> r1.57)
        pqsignal.h (r1.33 -> r1.34)
        miscadmin.h (r1.212 -> r1.213)
        pmsignal.h (r1.25 -> r1.26)
        tcopprot.h (r1.98 -> r1.99)
        guc.h (r1.102 -> r1.103)

pgsql-committers by date

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

Privacy Policy | About PostgreSQL
Copyright © 1996-2017 The PostgreSQL Global Development Group