From 75a720ead1f001ccea57eee466525eb9a47f6ce7 Mon Sep 17 00:00:00 2001 From: Simon Siebert Date: Sat, 19 Mar 2022 18:26:26 +0100 Subject: [PATCH] outposts/ldap: prevent operations error from nil dereference (#2447) closes #2526 --- internal/outpost/ldap/search/direct/direct.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/internal/outpost/ldap/search/direct/direct.go b/internal/outpost/ldap/search/direct/direct.go index 6df9cd32e..a7be9b2f5 100644 --- a/internal/outpost/ldap/search/direct/direct.go +++ b/internal/outpost/ldap/search/direct/direct.go @@ -252,7 +252,7 @@ func (ds *DirectSearcher) Search(req *search.Request) (ldap.ServerSearchResult, if scope >= 0 && (strings.EqualFold(req.BaseDN, ds.si.GetBaseDN()) || utils.HasSuffixNoCase(req.BaseDN, ds.si.GetBaseVirtualGroupDN())) { singlevg := utils.HasSuffixNoCase(req.BaseDN, ","+ds.si.GetBaseVirtualGroupDN()) - if !singlevg || utils.IncludeObjectClass(filterOC, constants.GetContainerOCs()) { + if !singlevg && utils.IncludeObjectClass(filterOC, constants.GetContainerOCs()) { entries = append(entries, utils.GetContainerEntry(filterOC, ds.si.GetBaseVirtualGroupDN(), constants.OUVirtualGroups)) scope -= 1 }