Skip to content

Commit

Permalink
dblib: fix missing LDAP variable export
Browse files Browse the repository at this point in the history
  • Loading branch information
Tommi2Day committed Feb 26, 2023
1 parent e051334 commit 205c2f5
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
8 changes: 4 additions & 4 deletions dblib/tns_ldap.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,9 @@ type TWorkStatus map[string]int

// LdapServer covers properties from one server in ldap.ora
type LdapServer struct {
hostname string
port int
sslport int
Hostname string
Port int
SSLPort int
}

// ReadLdapTns read tns entries from ldap
Expand Down Expand Up @@ -93,7 +93,7 @@ func ReadLdapOra(path string) (ctx string, servers []LdapServer) {
if len(f) > 2 {
ssl, _ = strconv.Atoi(f[2])
}
server := LdapServer{hostname: host, port: port, sslport: ssl}
server := LdapServer{Hostname: host, Port: port, SSLPort: ssl}
servers = append(servers, server)
}
log.Debugf("CTX: %s, Servers %v", ctx, servers)
Expand Down
4 changes: 2 additions & 2 deletions dblib/tns_ldap_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -77,11 +77,11 @@ func TestOracleLdap(t *testing.T) {
if l == e {
s := ldapservers[0]
expected := "oid:1389:1636"
actual := fmt.Sprintf("%s:%d:%d", s.hostname, s.port, s.sslport)
actual := fmt.Sprintf("%s:%d:%d", s.Hostname, s.Port, s.SSLPort)
assert.Equal(t, expected, actual, "ldap entry 1 not match")
s = ldapservers[1]
expected = "ldap:389:0"
actual = fmt.Sprintf("%s:%d:%d", s.hostname, s.port, s.sslport)
actual = fmt.Sprintf("%s:%d:%d", s.Hostname, s.Port, s.SSLPort)
assert.Equal(t, expected, actual, "ldap entry 2 not match")
}
})
Expand Down

0 comments on commit 205c2f5

Please sign in to comment.