Skip to content

Commit 43e05f5

Browse files
committed
Make DNs fully case insensitive
1 parent 63a2eac commit 43e05f5

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

ldap/ldap.go

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -395,11 +395,12 @@ func LookupDN(conn *ldap.Conn, dn string, attrs []string) (*DNSearchResult, erro
395395
}
396396

397397
// NormalizeDN normalizes the DN. The ldap library here mainly lowercases the
398-
// attribute type names in the DN.
398+
// attribute type names in the DN. However, since MinIO is going to be
399+
// case-insenstive, we lowercase the whole string.
399400
func NormalizeDN(dn string) (string, error) {
400401
parsedDN, err := ldap.ParseDN(dn)
401402
if err != nil {
402403
return "", fmt.Errorf("DN (%s) parse failure: %w", dn, err)
403404
}
404-
return parsedDN.String(), nil
405+
return strings.ToLower(parsedDN.String()), nil
405406
}

0 commit comments

Comments
 (0)