mirror of https://github.com/minio/minio.git
Loosen requirements to detach policies for LDAP (#18419)
This commit is contained in:
parent
2229509362
commit
117ad1b65b
25
cmd/iam.go
25
cmd/iam.go
|
@ -1663,18 +1663,25 @@ func (sys *IAMSys) PolicyDBUpdateLDAP(ctx context.Context, isAttach bool,
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
if dn == "" {
|
if dn == "" {
|
||||||
err = errNoSuchUser
|
// Still attempt to detach if provided user is a DN.
|
||||||
return
|
if !isAttach && sys.LDAPConfig.IsLDAPUserDN(r.User) {
|
||||||
|
dn = r.User
|
||||||
|
} else {
|
||||||
|
err = errNoSuchUser
|
||||||
|
return
|
||||||
|
}
|
||||||
}
|
}
|
||||||
isGroup = false
|
isGroup = false
|
||||||
} else {
|
} else {
|
||||||
var exists bool
|
if isAttach {
|
||||||
if exists, err = sys.LDAPConfig.DoesGroupDNExist(r.Group); err != nil {
|
var exists bool
|
||||||
logger.LogIf(ctx, err)
|
if exists, err = sys.LDAPConfig.DoesGroupDNExist(r.Group); err != nil {
|
||||||
return
|
logger.LogIf(ctx, err)
|
||||||
} else if !exists {
|
return
|
||||||
err = errNoSuchGroup
|
} else if !exists {
|
||||||
return
|
err = errNoSuchGroup
|
||||||
|
return
|
||||||
|
}
|
||||||
}
|
}
|
||||||
dn = r.Group
|
dn = r.Group
|
||||||
isGroup = true
|
isGroup = true
|
||||||
|
|
Loading…
Reference in New Issue