Compare commits

...

5 Commits

Author SHA1 Message Date
Tis 6f66b6134a
Merge 857e380e97 into de234b888c 2025-07-12 00:02:17 +08:00
Burkov Egor de234b888c
fix: admin api - SetPolicyForUserOrGroup avoid nil deref (#21400)
VulnCheck / Analysis (push) Has been cancelled Details
Lock Threads / action (push) Has been cancelled Details
2025-07-01 09:00:17 -07:00
Klaus Post 857e380e97
Merge branch 'master' into fix-loadconfig 2025-02-20 01:47:23 -08:00
Tis 637e9126e4
Merge branch 'master' into fix-loadconfig 2025-02-07 10:59:56 +08:00
qun.huang f0482fbe7f Fix the issue of being unable to read legacy scanner configurations 2024-11-14 09:34:41 +08:00
2 changed files with 5 additions and 3 deletions

View File

@ -1827,16 +1827,18 @@ func (a adminAPIHandlers) SetPolicyForUserOrGroup(w http.ResponseWriter, r *http
iamLogIf(ctx, err)
} else if foundGroupDN == nil || !underBaseDN {
err = errNoSuchGroup
} else {
entityName = foundGroupDN.NormDN
}
entityName = foundGroupDN.NormDN
} else {
var foundUserDN *xldap.DNSearchResult
if foundUserDN, err = globalIAMSys.LDAPConfig.GetValidatedDNForUsername(entityName); err != nil {
iamLogIf(ctx, err)
} else if foundUserDN == nil {
err = errNoSuchUser
} else {
entityName = foundUserDN.NormDN
}
entityName = foundUserDN.NormDN
}
if err != nil {
writeErrorResponseJSON(ctx, w, toAdminAPIErr(ctx, err), r.URL)

View File

@ -149,7 +149,7 @@ func LookupConfig(kvs config.KVS) (cfg Config, err error) {
// has not been changed from its "default" value, if it has been changed honor new settings.
if kvs.GetWithDefault(Speed, DefaultKVS) == "default" {
if kvs.Get(Delay) != "" && kvs.Get(MaxWait) != "" {
if err = lookupDeprecatedScannerConfig(kvs, &cfg); err != nil {
if err = lookupDeprecatedScannerConfig(kvs, &cfg); err == nil {
return cfg, err
}
}