Skip to content

Commit

Permalink
dblib: linter fix
Browse files Browse the repository at this point in the history
  • Loading branch information
Tommi2Day committed Nov 8, 2024
1 parent a3f9be0 commit 160ce59
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
3 changes: 2 additions & 1 deletion dblib/tns.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand All @@ -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)
}
Expand Down

0 comments on commit 160ce59

Please sign in to comment.