mirror of https://github.com/minio/minio.git
Check both given and normalized group DN on LDAP policy detach requests (#19876)
This commit is contained in:
parent
2107722829
commit
4148754ce0
18
cmd/iam.go
18
cmd/iam.go
|
@ -1986,20 +1986,22 @@ func (sys *IAMSys) PolicyDBUpdateLDAP(ctx context.Context, isAttach bool,
|
|||
}
|
||||
isGroup = false
|
||||
} else {
|
||||
if isAttach {
|
||||
var underBaseDN bool
|
||||
if dnResult, underBaseDN, err = sys.LDAPConfig.GetValidatedGroupDN(nil, r.Group); err != nil {
|
||||
iamLogIf(ctx, err)
|
||||
return
|
||||
} else if dnResult == nil || !underBaseDN {
|
||||
var underBaseDN bool
|
||||
if dnResult, underBaseDN, err = sys.LDAPConfig.GetValidatedGroupDN(nil, r.Group); err != nil {
|
||||
iamLogIf(ctx, err)
|
||||
return
|
||||
}
|
||||
if dnResult == nil || !underBaseDN {
|
||||
if !isAttach {
|
||||
dn = r.Group
|
||||
} else {
|
||||
err = errNoSuchGroup
|
||||
return
|
||||
}
|
||||
} else {
|
||||
// We use the group DN returned by the LDAP server (this may not
|
||||
// equal the input group name, but we assume it is canonical).
|
||||
dn = dnResult.NormDN
|
||||
} else {
|
||||
dn = r.Group
|
||||
}
|
||||
isGroup = true
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue