Skip to content

Commit 9d46cf8

Browse files
committed
Make DNs fully case insensitive
1 parent ff58a6b commit 9d46cf8

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
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
}

policy/action.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -206,7 +206,7 @@ const (
206206
// PutObjectFanOutAction - PutObject like API action but allows PostUpload() fan-out.
207207
PutObjectFanOutAction = "s3:PutObjectFanOut"
208208

209-
// S3Express CreateSession action
209+
// CreateSessionAction - S3Express action
210210
CreateSessionAction = "s3express:CreateSession"
211211

212212
// AllActions - all API actions

0 commit comments

Comments
 (0)