Skip to content
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

Merged
merged 2 commits into from
Jun 20, 2016

Conversation

c-silva
Copy link
Contributor

@c-silva c-silva commented Jun 6, 2016

Tries to solve issue already reported:
#51

@@ -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)
Copy link
Contributor

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.

@domcleal
Copy link
Contributor

domcleal commented Jun 7, 2016

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
@c-silva
Copy link
Contributor Author

c-silva commented Jun 8, 2016

Hi, yes, that was the reason. The tests are passed now.

@domcleal
Copy link
Contributor

domcleal commented Jun 9, 2016

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]
Copy link
Member

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

Copy link
Contributor Author

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
@c-silva
Copy link
Contributor Author

c-silva commented Jun 17, 2016

Hi, take a look. Hope it fits the purpose.

@domcleal domcleal merged commit 15c77c9 into theforeman:master Jun 20, 2016
@domcleal
Copy link
Contributor

Perfect, thanks @c-silva!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants