Skip to content

Commit

Permalink
Fix error when validating DN that is not under base DN (minio#19971)
Browse files Browse the repository at this point in the history
  • Loading branch information
taran-p committed Jun 22, 2024
1 parent 5f6a25c commit 168ae81
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion internal/config/identity/ldap/ldap.go
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,8 @@ func (l *Config) GetValidatedDNForUsername(username string) (*xldap.DNSearchResu
// under a configured base DN in the LDAP directory.
validDN, isUnderBaseDN, err := l.GetValidatedUserDN(conn, username)
if err == nil && !isUnderBaseDN {
return nil, fmt.Errorf("Unable to find user DN: %w", err)
// Not under any configured base DN, so treat as not found.
return nil, nil
}
return validDN, err
}
Expand Down

0 comments on commit 168ae81

Please sign in to comment.