From 160ce59a2ccf1c2cca6091f99360155eeec15e19 Mon Sep 17 00:00:00 2001 From: Tommi2Day Date: Fri, 8 Nov 2024 18:42:19 +0100 Subject: [PATCH] dblib: linter fix --- CHANGELOG.md | 5 +++++ dblib/tns.go | 3 ++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index b5abaef..f32bd76 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,6 +3,11 @@ ## [v1.14.11 - 2024-11-08] ### New - common: add ReadStdinToString and ReadStdinByLine functions and tests +- dblib: add ssl tns +### Changed +- dblib: modify tns ldap tests +- update dependencies + ## [v1.14.10 - 2024-09-04] ### Changed - update dns tests diff --git a/dblib/tns.go b/dblib/tns.go index d23471d..53e8435 100644 --- a/dblib/tns.go +++ b/dblib/tns.go @@ -98,6 +98,7 @@ func ReadSQLNetOra(filePath string) (domain string, namesPath []string, sslInfo // Regular expression to match key-value pairs re := regexp.MustCompile(`(?m)^\s*(\w+(?:\.\w+)*)\s*=\s*(.+?)\s*$`) + re2 := regexp.MustCompile(`(?i)YES|ON|TRUE|1`) matches := re.FindAllStringSubmatch(content, -1) names := "" for _, match := range matches { @@ -114,7 +115,7 @@ func ReadSQLNetOra(filePath string) (domain string, namesPath []string, sslInfo case "ssl_version": sslCfg.Version = value case "ssl_server_dn_match": - sslCfg.ServerDNMatch, _ = regexp.MatchString(`(?i)YES|ON|TRUE|1`, value) + sslCfg.ServerDNMatch = re2.MatchString(value) case "ssl_client_authentication": sslCfg.ClientAthentication, _ = strconv.ParseBool(value) }