Oved Ourfali has posted comments on this change. Change subject: aaa: sync: handle group loops ......................................................................
Patch Set 1: (2 comments) http://gerrit.ovirt.org/#/c/35663/1/backend/manager/modules/aaa/src/main/java/org/ovirt/engine/core/aaa/AuthzUtils.java File backend/manager/modules/aaa/src/main/java/org/ovirt/engine/core/aaa/AuthzUtils.java: Line 120: Line 121: private static ExtMap constructGroupsMembershipTree(ExtMap entity, ExtKey key, Map<String, ExtMap> groupsCache, Deque<String> loopPrevention) { Line 122: List<ExtMap> groups = new ArrayList<>(); Line 123: for (ExtMap memberOf : entity.get(key, Collections.<ExtMap> emptyList())) { Line 124: if (loopPrevention.contains(memberOf.get(GroupRecord.ID))) { you're taking the ID in this method about 3 times, so better have it at the beginning of the loop, and use it all the time. Line 125: log.error( Line 126: "Group recursion detected for group '{}' stack is {}", Line 127: memberOf.get(GroupRecord.NAME), Line 128: loopPrevention Line 136: groupsCache, Line 137: loopPrevention Line 138: ) Line 139: ); Line 140: loopPrevention.pop(); can't the same group (GroupRecord.ID) appear later on, when moving to the next group in the for loop? Shouldn't this work with some set instead? Line 141: } Line 142: } Line 143: entity.put(key, groups); Line 144: return entity; -- To view, visit http://gerrit.ovirt.org/35663 To unsubscribe, visit http://gerrit.ovirt.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ie90ad3cbef9675be8c0ceba47c22609a9985b518 Gerrit-PatchSet: 1 Gerrit-Project: ovirt-engine Gerrit-Branch: master Gerrit-Owner: Alon Bar-Lev <alo...@redhat.com> Gerrit-Reviewer: Alon Bar-Lev <alo...@redhat.com> Gerrit-Reviewer: Oved Ourfali <oourf...@redhat.com> Gerrit-Reviewer: Yair Zaslavsky <yzasl...@redhat.com> Gerrit-Reviewer: automat...@ovirt.org Gerrit-Reviewer: oVirt Jenkins CI Server Gerrit-HasComments: Yes _______________________________________________ Engine-patches mailing list Engine-patches@ovirt.org http://lists.ovirt.org/mailman/listinfo/engine-patches