pgsql: Clean up password authentication code a bit. - Mailing list pgsql-committers

From Heikki Linnakangas
Subject pgsql: Clean up password authentication code a bit.
Date
Msg-id E1cEx8U-0000Yw-6Y@gemulon.postgresql.org
Whole thread Raw
List 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(-)


pgsql-committers by date:

Previous
From: Heikki Linnakangas
Date:
Subject: pgsql: Fix accounting of memory needed for merge heap.
Next
From: Heikki Linnakangas
Date:
Subject: pgsql: Fix quoting and a compiler warning in dumping partitions.