Ensure comment is always a valid key (#8604)

Also fix LDAP leaky connection
This commit is contained in:
Harshavardhana
2019-12-05 04:47:42 -08:00
committed by Nitish Tiwari
parent c9940d8c3f
commit d8e3de0cae
3 changed files with 59 additions and 36 deletions

View File

@@ -484,6 +484,9 @@ func (sts *stsAPIHandlers) AssumeRoleWithLDAPIdentity(w http.ResponseWriter, r *
return
}
// Close ldap connection to avoid leaks.
defer ldapConn.Close()
usernameSubs, _ := xldap.NewSubstituter("username", ldapUsername)
// We ignore error below as we already validated the username
// format string at startup.