-
Notifications
You must be signed in to change notification settings - Fork 35
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Prevent infinite recurse when 2 groups are members of each other #53
Conversation
@@ -20,7 +20,7 @@ def _groups_from_ldap_data(payload) | |||
data = [] | |||
if !payload.nil? | |||
first_level = payload[:memberof] | |||
total_groups = _walk_group_ancestry(first_level) | |||
total_groups, b = _walk_group_ancestry(first_level, first_level) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
a) Replace b
with _
if you're discarding the variable.
b) The equals signs aren't lined up any more.
c) The extra argument to _walk_group_ancestry
isn't declared in its method.
Please also check the test failures, they appear at the moment to be because the method doesn't have a second argument defined. |
…es to solve issue already reported: theforeman#51 Fix _walk_group_ancestry method declaration with extra variable Refer unused variable with _ Lineup equals signs
Hi, yes, that was the reason. The tests are passed now. |
Great, thanks. Would you be willing to write a test for this, simulating the looped membership? If not I can add it. |
end | ||
end | ||
set | ||
return [set, known_groups] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nitpick, return
is optional here
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ok!
Style correction in return line
Hi, take a look. Hope it fits the purpose. |
Perfect, thanks @c-silva! |
Tries to solve issue already reported:
#51