hotfix: use default krb5 config

This commit is contained in:
fengcaiwen
2025-02-12 22:20:51 +08:00
parent 1a32d7a58e
commit 24367b1b82

View File

@@ -35,13 +35,6 @@ func NewKrb5InitiatorClientWithPassword(username, password, krb5Conf string) (kc
return
}
// Set to lookup KDCs in DNS
c.LibDefaults.DNSLookupKDC = true
c.LibDefaults.DNSLookupRealm = true
// Blank out the KDCs to ensure they are not being used
c.Realms = []config.Realm{}
defaultRealm := c.LibDefaults.DefaultRealm
cl := client.NewWithPassword(username, defaultRealm, password, c)
@@ -65,12 +58,6 @@ func NewKrb5InitiatorClientWithKeytab(username string, krb5Conf, keytabConf stri
if err != nil {
return
}
// Set to lookup KDCs in DNS
c.LibDefaults.DNSLookupKDC = true
c.LibDefaults.DNSLookupRealm = true
// Blank out the KDCs to ensure they are not being used
c.Realms = []config.Realm{}
// Init keytab from conf
cache, err := keytab.Load(keytabConf)
@@ -81,9 +68,6 @@ func NewKrb5InitiatorClientWithKeytab(username string, krb5Conf, keytabConf stri
defaultRealm := c.LibDefaults.DefaultRealm
cl := client.NewWithKeytab(username, defaultRealm, cache, c)
if err != nil {
return
}
err = cl.Login()
if err != nil {
return
@@ -105,13 +89,6 @@ func NewKrb5InitiatorClientWithCache(krb5Conf, cacheFile string) (kcl Krb5Initia
return
}
// Set to lookup KDCs in DNS
c.LibDefaults.DNSLookupKDC = true
c.LibDefaults.DNSLookupRealm = true
// Blank out the KDCs to ensure they are not being used
c.Realms = []config.Realm{}
// Init krb5 client and login
cache, err := credentials.LoadCCache(cacheFile)
// https://stackoverflow.com/questions/58653482/what-is-the-default-kerberos-credential-cache-on-osx