pgsql: Clean up password authentication code a bit.

From: Heikki Linnakangas <heikki(dot)linnakangas(at)iki(dot)fi>
To: pgsql-committers(at)postgresql(dot)org
Subject: pgsql: Clean up password authentication code a bit.
Date: 2016-12-08 11:45:14
Message-ID: E1cEx8U-0000Yw-6Y@gemulon.postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-committers

Clean up password authentication code a bit.

Commit fe0a0b59, which moved code to do MD5 authentication to a separate
CheckMD5Auth() function, left behind a comment that really belongs inside
the function, too. Also move the check for db_user_namespace inside the
function, seems clearer that way.

Now that the md5 salt is passed as argument to md5_crypt_verify, it's a bit
silly that it peeks into the Port struct to see if MD5 authentication was
used. Seems more straightforward to treat it as an MD5 authentication, if
the md5 salt argument is given. And after that, md5_crypt_verify only used
the Port argument to look at port->user_name, but that is redundant,
because it is also passed as a separate 'role' argument. So remove the Port
argument altogether.

Branch
------
master

Details
-------
http://git.postgresql.org/pg/commitdiff/fe7bdf0bf67d8ac360d67fa9740074a2c70e88a4

Modified Files
--------------
src/backend/libpq/auth.c | 19 ++++----
src/backend/libpq/crypt.c | 108 ++++++++++++++++++++++++----------------------
src/include/libpq/crypt.h | 6 +--
3 files changed, 70 insertions(+), 63 deletions(-)

Browse pgsql-committers by date

  From Date Subject
Next Message Heikki Linnakangas 2016-12-08 12:13:31 pgsql: Fix quoting and a compiler warning in dumping partitions.
Previous Message Heikki Linnakangas 2016-12-08 08:20:45 pgsql: Fix accounting of memory needed for merge heap.