Merge pull request #699 from fofloinn/master

Converts group and subgroup to lowercase for comparison.
This commit is contained in:
Mariano Cano 2021-09-08 16:05:33 -07:00 committed by GitHub
commit 837db2e147
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -5,6 +5,7 @@ import (
"encoding/binary" "encoding/binary"
"encoding/json" "encoding/json"
"math/big" "math/big"
"strings"
"time" "time"
"github.com/pkg/errors" "github.com/pkg/errors"
@ -455,10 +456,10 @@ func containsAllMembers(group, subgroup []string) bool {
} }
visit := make(map[string]struct{}, lg) visit := make(map[string]struct{}, lg)
for i := 0; i < lg; i++ { for i := 0; i < lg; i++ {
visit[group[i]] = struct{}{} visit[strings.ToLower(group[i])] = struct{}{}
} }
for i := 0; i < lsg; i++ { for i := 0; i < lsg; i++ {
if _, ok := visit[subgroup[i]]; !ok { if _, ok := visit[strings.ToLower(subgroup[i])]; !ok {
return false return false
} }
} }