mirror of
https://github.com/minio/minio.git
synced 2025-04-22 03:24:38 -04:00
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
|
isGroup = false
|
||||||
} else {
|
} else {
|
||||||
if isAttach {
|
var underBaseDN bool
|
||||||
var underBaseDN bool
|
if dnResult, underBaseDN, err = sys.LDAPConfig.GetValidatedGroupDN(nil, r.Group); err != nil {
|
||||||
if dnResult, underBaseDN, err = sys.LDAPConfig.GetValidatedGroupDN(nil, r.Group); err != nil {
|
iamLogIf(ctx, err)
|
||||||
iamLogIf(ctx, err)
|
return
|
||||||
return
|
}
|
||||||
} else if dnResult == nil || !underBaseDN {
|
if dnResult == nil || !underBaseDN {
|
||||||
|
if !isAttach {
|
||||||
|
dn = r.Group
|
||||||
|
} else {
|
||||||
err = errNoSuchGroup
|
err = errNoSuchGroup
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
} else {
|
||||||
// We use the group DN returned by the LDAP server (this may not
|
// We use the group DN returned by the LDAP server (this may not
|
||||||
// equal the input group name, but we assume it is canonical).
|
// equal the input group name, but we assume it is canonical).
|
||||||
dn = dnResult.NormDN
|
dn = dnResult.NormDN
|
||||||
} else {
|
|
||||||
dn = r.Group
|
|
||||||
}
|
}
|
||||||
isGroup = true
|
isGroup = true
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user