From bc6f8ff5fa2bc002805ccc637b33522c011d0d06 Mon Sep 17 00:00:00 2001 From: dpage Date: Wed, 1 Apr 2009 11:55:01 +0000 Subject: [PATCH] Add missing 'cert' authentication method, and allow an option to be set for any hostssl entry in the pg_hba.conf editor, per Magnus. git-svn-id: svn://svn.pgadmin.org/trunk/pgadmin3@7786 a7884b65-44f6-0310-8a51-81a127f17b15 --- CHANGELOG | 4 ++-- pgadmin/dlg/dlgHbaConfig.cpp | 26 ++++++++++++++++++++++++-- pgadmin/include/utils/pgconfig.h | 1 + 3 files changed, 27 insertions(+), 4 deletions(-) diff --git a/CHANGELOG b/CHANGELOG index 8be6cd989..df5c74f25 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -36,8 +36,8 @@ Changes Date Dev Ver Change details ---------- --- ------ -------------- -2009-03-31 DP 1.10.0 Support ldap, gss and sspi authentication methods in the - pg_hba.conf editor. +2009-03-31 DP 1.10.0 Support ldap, gss, sspi & cert authentication methods in + the pg_hba.conf editor. 2009-03-27 DP 1.10.0 Remove the 'use tab key for autocomplete' option as it breaks other editor features for little gain. 2009-03-19 DP 1.10.0 Ensure that dependencies between tables and sequences diff --git a/pgadmin/dlg/dlgHbaConfig.cpp b/pgadmin/dlg/dlgHbaConfig.cpp index 6b889fb85..09c4b7c2a 100644 --- a/pgadmin/dlg/dlgHbaConfig.cpp +++ b/pgadmin/dlg/dlgHbaConfig.cpp @@ -102,6 +102,12 @@ DialogWithHelp((frmMain*)parent) cbMethod->Append(wxT("gss")); cbMethod->Append(wxT("sspi")); } + + // CERT is supported from 8.4 + if (conn->BackendMinimumVersion(8, 4)) + { + cbMethod->Append(wxT("cert")); + } } else { @@ -109,6 +115,7 @@ DialogWithHelp((frmMain*)parent) cbMethod->Append(wxT("ldap")); cbMethod->Append(wxT("gss")); cbMethod->Append(wxT("sspi")); + cbMethod->Append(wxT("cert")); } if (conn) @@ -315,9 +322,12 @@ void dlgHbaConfig::OnChange(wxCommandEvent& ev) needOption = true; } else if (cbMethod->GetCurrentSelection() == pgHbaConfigLine::PGC_GSS || - cbMethod->GetCurrentSelection() == pgHbaConfigLine::PGC_SSPI) + cbMethod->GetCurrentSelection() == pgHbaConfigLine::PGC_SSPI || + cbMethod->GetCurrentSelection() == pgHbaConfigLine::PGC_KRB5 || + cbMethod->GetCurrentSelection() == pgHbaConfigLine::PGC_PAM || + cbMethod->GetCurrentSelection() == pgHbaConfigLine::PGC_CERT) { - // GSS/SSPI take options from 8.4 onwards. If we don't know the version + // GSS/SSPI/KRB5/PAM/CERT take options from 8.4 onwards. If we don't know the version // then allow the option to be specified. if (conn) { @@ -328,6 +338,18 @@ void dlgHbaConfig::OnChange(wxCommandEvent& ev) needOption = true; } + // On 8.4 and above, any hostssl lines can take an option + if (cbType->GetCurrentSelection() == pgHbaConfigLine::PGC_HOSTSSL) + { + if (conn) + { + if (conn->BackendMinimumVersion(8, 4)) + needOption = true; + } + else + needOption = true; + } + stOption->Enable(needOption); txtOption->Enable(needOption); diff --git a/pgadmin/include/utils/pgconfig.h b/pgadmin/include/utils/pgconfig.h index 9b075632b..a41445c37 100644 --- a/pgadmin/include/utils/pgconfig.h +++ b/pgadmin/include/utils/pgconfig.h @@ -79,6 +79,7 @@ public: PGC_LDAP, PGC_GSS, PGC_SSPI, + PGC_CERT, PGC_INVALIDMETHOD }; -- 2.39.5